source: rtems-docs/rsb/source-builder.rst @ 42d50d7

5
Last change on this file since 42d50d7 was 3d055ec, checked in by Chris Johns <chrisj@…>, on 11/02/16 at 06:38:32

RSB: Fix the history.

  • Property mode set to 100644
File size: 8.2 KB
Line 
1.. comment SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. comment COPYRIGHT (c) 2012 - 2016.
4.. comment Chris Johns <chrisj@rtems.org>
5
6RTEMS Source Builder
7====================
8
9The RTEMS Source Builder or RSB is a tool to build packages from source. It is
10used by the RTEMS project to build it's compilers and OS. The RSB helps
11consolidate the details you need to build a package from source in a controlled
12and verifiable way. The tool is aimed at developers of software who use tool
13sets for embedded development. The RSB is not limited to building tools just
14for RTEMS, you can build bare metal development environments.
15
16Embedded development typically uses cross-compiling tool chains, debuggers, and
17debugging aids. Together we call these a **tool set**. The RTEMS Source Builder
18is designed to fit this specific niche but is not limited to it. The RSB can be
19used outside of the RTEMS project and we welcome this.
20
21The RTEMS Source Builder is typically used to build a set of tools or a **build
22set**. A **build set** is a collection of packages and a package is a specific
23tool, for example gcc or gdb, or library. The RTEMS Source Builder attempts to
24support any host environment that runs Python and you can build the package
25on. The RSB is not some sort of magic that can take any piece of source code
26and make it build. Someone at some point in time has figured out how to build
27that package from source and taught this tool.
28
29The RTEMS Source Builder has been tested on:
30
31- ArchLinux
32- CentOS
33- Fedora
34- Raspbian
35- Ubuntu (includes XUbuntu)
36- Linux Mint
37- openSUSE
38- FreeBSD
39- NetBSD
40- MacOS
41- Windows
42
43.. topic:: Setting up your Host
44
45   :ref:`Hosts` details setting up hosts.
46
47The RTEMS Source Builder has two types of configuration data. The first is the
48*build set*. A *build set* describes a collection of packages that define a set
49of tools you would use when developing software for RTEMS. For example the
50basic GNU tool set is binutils, gcc, and gdb and is the typical base suite of
51tools you need for an embedded cross-development type project. The second type
52of configuration data is the configuration files and they define how a package
53is built. Configuration files are scripts loosely based on the RPM spec file
54format and they detail the steps needed to build a package. The steps are
55*preparation*, *building*, and *installing*. Scripts support macros, shell
56expansion, logic, includes plus many more features useful when build packages.
57
58The RTEMS Source Builder does not interact with any host package management
59systems. There is no automatic dependence checking between various packages you
60build or packages and software your host system you may have installed. We
61assume the build sets and configuration files you are using have been created
62by developers who do. Support is provided for package config or ``pkgconfg``
63type files so you can check and use standard libraries if present. If you have
64a problem please ask on our :r:list:`devel`.
65
66.. comment: TBD: The section "Installing and Tar Files" does not exist.
67
68This documentation caters for a range of users from new to experienced RTEMS
69developers. New users can follow the Quick Start section up to the "Installing
70and Tar Files" to get a working tools and RTEMS. Users building a binary tool
71set for release can read the "Installing and Tar Files". Users wanting to run
72and test bleeding edge tools or packages, or wanting update or extend the RSB's
73configuration can read the remaining sections.
74
75.. topic:: Bug Reporting
76
77   If you think you have found a problem please see :ref:`Bugs, Crashes, and
78   Build Failures`.
79
80Why Build from Source?
81----------------------
82
83The RTEMS Source Builder is not a replacement for the binary install systems
84you have with commercial operating systems or open source operating system
85distributions. Those products and distributions are critically important and
86are the base that allows the RSB to work. The RTEMS Source Builder sits
87somewhere between you manually entering the commands to build a tool set and a
88tool such as ``yum`` or ``apt-get`` to install binary packages made
89specifically for your host operating system. Building manually or installing a
90binary package from a remote repository are valid and real alternatives. The
91RSB provides the specific service of repeatably being able to build tool sets
92from source code. The process leaves you with the source code used to build
93the tools and the ability to rebuilt it.
94
95If you are developing a system or product that has a long shelf life or is used
96in a critical piece of infrastructure that has a long life cycle being able to
97build from source is important. It insulates the project from the fast ever
98changing world of the host development machines. If your tool set is binary and
99you have lost the ability to build it you have lost a degree of control and
100flexibility open source gives you. Fast moving host environments are
101fantastic. We have powerful multi-core computers with huge amounts of memory
102and state of the art operating systems to run on them however the product or
103project you are part of may need to be maintained well past the life time of
104these host. Being able to build from source an important and critical part of
105this process because you can move to a newer host and create an equivalent tool
106set.
107
108Building from source provides you with control over the configuration of the
109package you are building. If all or the most important dependent parts are
110built from source you limit the exposure to host variations. For example the
111GNU C compiler (gcc) currently uses a number of 3rd party libraries internally
112(gmp, mpfr, etc). If your validated compiler generating code for your target
113processor is dynamically linked against the host's version of these libraries
114any change in the host's configuration may effect you. The changes the host's
115package management system makes may be perfectly reasonable in relation to the
116distribution being managed however this may not extend to you and your
117tools. Building your tools from source and controlling the specific version of
118these dependent parts means you are not exposing yourself to unexpected and
119often difficult to resolve problems. On the other side you need to make sure
120your tools build and work with newer versions of the host operating
121system. Given the stability of standards based libraries like ``libc`` and ever
122improving support for standard header file locations this task is becoming
123easier.
124
125The RTEMS Source Builder is designed to be audited and incorporated into a
126project's verification and validation process. If your project is developing
127critical applications that needs to be traced from source to executable code in
128the target, you need to also consider the tools and how to track them.
129
130If your IT department maintains all your computers and you do not have suitable
131rights to install binary packages, building from source lets you create your
132own tool set that you install under your home directory. Avoiding installing
133any extra packages as a super user is always helpful in maintaining a secure
134computing environment.
135
136History
137-------
138
139The RTEMS Source Builder is a stand alone tool based on another tool called the
140*SpecBuilder* written by Chris Johns. The *SpecBuilder* was written around 2010
141for the RTEMS project to provide Chris with a way to build tools on hosts that
142did not support RPMs. At the time the RTEMS tools maintainer only supported
143*spec* files and these files held all the vital configuration data needed to
144create suitable tool sets. The available SRPM and *spec* files by themselves
145where of little use because a suitable ``rpm`` tool was needed to use them. At
146the time the available versions of ``rpm`` for a number of non-RPM hosts were
147broken and randomly maintained. The solution Chris settled on was to use the
148*spec* files and to write a Python based tool that parsed the *spec* file
149format creating a shell script that could be run to build the package. The
150approach proved successful and Chris was able to track the RPM version of the
151RTEMS tools on a non-RPM host for a number of years.
152
153The *SpecBuilder* tool did not build tools or packages unrelated to the RTEMS
154Project where no suitable *spec* file was available so another tool was
155needed. Rather than start again Chris decided to take the parsing code for the
156*spec* file format and build a new tool called the RTEMS Source Builder.
Note: See TracBrowser for help on using the repository browser.