diff options
Diffstat (limited to 'tools/buildman/buildman.rst')
-rw-r--r-- | tools/buildman/buildman.rst | 215 |
1 files changed, 114 insertions, 101 deletions
diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index 8c45a841024..9e850b26ec0 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -6,7 +6,7 @@ Buildman build tool Quick-start ----------- -If you just want to quickly set up buildman so you can build something (for +If you just want to quickly set up Buildman so you can build something (for example Raspberry Pi 2): .. code-block:: bash @@ -22,12 +22,12 @@ example Raspberry Pi 2): What is this? ------------- -This tool handles building U-Boot to check that you have not broken it -with your patch series. It can build each individual commit and report -which boards fail on which commits, and which errors come up. It aims -to make full use of multi-processor machines. +This tool builds U-Boot to check that you have not broken it with your +patch series. It can build each individual commit and report which boards +fail on which commits, and which errors come up. It aims to make full use +of multi-processor machines. -A key feature of buildman is its output summary, which allows warnings, +A key feature of Buildman is its output summary, which allows warnings, errors or image size increases in a particular commit or board to be quickly identified and the offending commit pinpointed. This can be a big help for anyone working with >10 patches at a time. @@ -63,7 +63,7 @@ can be run repeatedly on the same branch after making changes to commits on that branch. In this case it will automatically rebuild commits which have changed (and remove its old results for that commit). It is possible to build a branch for one board, then later build it for another board. This adds to -the output, so now you have results for two boards. If you want buildman to +the output, so now you have results for two boards. If you want Buildman to re-build a commit it has already built (e.g. because of a toolchain update), use the -f flag. @@ -81,9 +81,9 @@ a time. A thread starts at the first commit, configures the source for your board and builds it. Then it checks out the next commit and does an incremental build (i.e. not using 'make xxx_defconfig' unless you use -C). Eventually the thread reaches the last commit and stops. If a commit causes -an error or warning, buildman will try it again after reconfiguring (but see +an error or warning, Buildman will try it again after reconfiguring (but see -Q). Thus some commits may be built twice, with the first result silently -discarded. Lots of errors and warnings will causes lots of reconfigures and your +discarded. Lots of errors and warnings will cause lots of reconfigures and your build will be very slow. This is because a file that produces just a warning would not normally be rebuilt in an incremental build. Once a thread finishes building all the commits for a board, it starts on the commits for another @@ -100,14 +100,14 @@ threads do not affect the state of your git repository. Any checkouts done by the thread affect only the working directory for that thread. Buildman automatically selects the correct tool chain for each board. You -must supply suitable tool chains (see --fetch-arch), but buildman takes care -of selecting the right one. +must supply suitable tool chains (see ``--fetch-arch``), but Buildman takes +care of selecting the right one. Buildman generally builds a branch (with the -b flag), and in this case builds the upstream commit as well, for comparison. So even if you have one commit in your branch, two commits will be built. Put all your commits in a branch, set the branch's upstream to a valid value, and all will be well. -Otherwise buildman will perform random actions. Use -n to check what the +Otherwise Buildman will perform random actions. Use -n to check what the random actions might be. Buildman effectively has two modes: without -s it builds, with -s it @@ -115,7 +115,7 @@ summarises the results of previous (or active) builds. If you just want to build the current source tree, leave off the -b flag. This will display results and errors as they happen. You can still look at -them later using -se. Note that buildman will assume that the source has +them later using -se. Note that Buildman will assume that the source has changed, and will build all specified boards in this case. Buildman is optimised for building many commits at once, for many boards. @@ -153,9 +153,9 @@ You can also use -x to specifically exclude some boards. For example: means to build all arm boards except nvidia, freescale and anything ending with 'ball'. -For building specific boards you can use the --boards (or --bo) option, which -takes a comma-separated list of board target names and be used multiple times -on the command line: +For building specific boards you can use the ``--boards`` (or ``--bo``) option, +which takes a comma-separated list of board target names and can be used +multiple times on the command line: .. code-block:: bash @@ -183,7 +183,7 @@ Setting up git checkout -b my-branch origin/master # Add some commits to the branch, reading for testing -#. Create ~/.buildman to tell buildman where to find tool chains (see +#. Create ~/.buildman to tell Buildman where to find tool chains (see buildman_settings_ for details). As an example:: # Buildman settings file @@ -212,7 +212,7 @@ Setting up The toolchain-alias section indicates that the i386 toolchain should be used to build x86 commits. - Note that you can also specific exactly toolchain prefixes if you like:: + Note that you can also specify toolchain prefixes if you like:: [toolchain-prefix] arm: /opt/arm-eabi-4.6/bin/arm-eabi- @@ -222,18 +222,18 @@ Setting up [toolchain-prefix] arm: /opt/arm-eabi-4.6/bin/arm-eabi-gcc - This tells buildman that you want to use this exact toolchain for the arm + This tells Buildman that you want to use this exact toolchain for the arm architecture. This will override any toolchains found by searching using the [toolchain] settings. - Since the toolchain prefix is an explicit request, buildman will report an + Since the toolchain prefix is an explicit request, Buildman will report an error if a toolchain is not found with that prefix. The current PATH will be searched, so it is possible to use:: [toolchain-prefix] arm: arm-none-eabi- - and buildman will find arm-none-eabi-gcc in /usr/bin if you have it + and Buildman will find arm-none-eabi-gcc in /usr/bin if you have it installed. Another example:: @@ -241,11 +241,11 @@ Setting up [toolchain-wrapper] wrapper: ccache - This tells buildman to use a compiler wrapper in front of CROSS_COMPILE. In + This tells Buildman to use a compiler wrapper in front of CROSS_COMPILE. In this example, ccache. It doesn't affect the toolchain scan. The wrapper is - added when CROSS_COMPILE environtal variable is set. The name in this - section is ignored. If more than one line is provided, only the last one - is taken. + added when the CROSS_COMPILE environment variable is set. The tag name in + this section is not important. If more than one line is provided, only the + last one is used. #. Make sure you have the required Python pre-requisites @@ -440,7 +440,7 @@ Setting up You can download toolchains and update the [toolchain] section of the settings file to find them. - To make this easier, buildman can automatically download and install + To make this easier, Buildman can automatically download and install toolchains from kernel.org. First list the available architectures:: $ ./tools/buildman/buildman --fetch-arch list @@ -476,15 +476,28 @@ Setting up Buildman should now be set up to use your new toolchain. - At the time of writing, U-Boot has these architectures: + At the time of writing, U-Boot supports these architectures: - arc, arm, m68k, microblaze, mips, nios2, powerpc, sandbox, sh, x86, xtensa + - ARC (arc) + - ARM (arm) + - Motorola 68k (m68k) + - MicroBlaze (microblaze) + - MIPS (mips) + - Nios II (nios2) + - PowerPC (powerpc) + - RISC-V (riscv) + - Sandbox (sandbox) + - SuperH (sh) + - x86 (x86) + - Xtensa (xtensa) + + Each entry list the architecture's name, followed by its code name in U-Boot. How to run it ------------- -First do a dry run using the -n flag: (replace <branch> with a real, local +First do a dry run using the -n flag (replace <branch> with a real, local branch with a valid upstream): .. code-block:: bash @@ -492,7 +505,7 @@ branch with a valid upstream): ./tools/buildman/buildman -b <branch> -n If it can't detect the upstream branch, try checking out the branch, and -doing something like 'git branch --set-upstream-to upstream/master' +doing something like ``git branch --set-upstream-to upstream/master`` or something similar. Buildman will try to guess a suitable upstream branch if it can't find one (you will see a message like "Guessing upstream as ..."). You can also use the -c option to manually specify the number of commits to @@ -528,7 +541,7 @@ As an example:: This shows that it will build all 1059 boards, using 4 threads (because we have a 4-core CPU). Each thread will run with -j1, meaning that each make job will use a single CPU. The list of commits to be built helps you -confirm that things look about right. Notice that buildman has chosen a +confirm that things look about right. Notice that Buildman has chosen a 'base' directory for you, immediately above your source tree. Buildman works entirely inside the base directory, here ../lcd9b, @@ -640,7 +653,7 @@ But if you did want to see just the errors for lubbock, use: If you see error lines marked with '-', that means that the errors were fixed by that commit. Sometimes commits can be in the wrong order, so that a breakage is introduced for a few commits and fixed by later commits. This -shows up clearly with buildman. You can then reorder the commits and try +shows up clearly with Buildman. You can then reorder the commits and try again. At commit 16, the error moves: you can see that the old error at line 120 @@ -670,7 +683,7 @@ err Output from stderr, if any. Errors and warnings appear here. log - Output from stdout. Normally there isn't any since buildman runs in silent + Output from stdout. Normally there isn't any since Buildman runs in silent mode. Use -V to force a verbose build (this passes V=1 to 'make') toolchain @@ -731,17 +744,17 @@ Note that the 'text' region and 'rodata' are split out. You should add the two together to get the total read-only size (reported as the first column in the output from binutil's 'size' utility). -A useful option is --step which lets you skip some commits. For example ---step 2 will show the image sizes for only every 2nd commit (so it will +A useful option is ``--step`` which lets you skip some commits. For example +``--step 2`` will show the image sizes for only every 2nd commit (so it will compare the image sizes of the 1st, 3rd, 5th... commits). You can also use ---step 0 which will compare only the first and last commits. This is useful +``--step 0`` which will compare only the first and last commits. This is useful for an overview of how your entire series affects code size. It will build only the upstream commit and your final branch commit. You can also use -d to see a detailed size breakdown for each board. This list is sorted in order from largest growth to largest reduction. -It is even possible to go a little further with the -B option (--bloat). This +It is even possible to go a little further with the -B option (``--bloat``). This shows where U-Boot has bloated, breaking the size change down to the function level. Example output is below:: @@ -898,7 +911,7 @@ The .buildman settings file The .buildman file provides information about the available toolchains and also allows build flags to be passed to 'make'. It consists of several -sections, with the section name in square brackets. Within each section are +sections, with the section name in square brackets. Within each section there are a set of (tag, value) pairs. '[global]' section @@ -924,8 +937,8 @@ a set of (tag, value) pairs. This lists the available toolchains. The tag here doesn't matter, but make sure it is unique. The value is the path to the toolchain. Buildman will look in that path for a file ending in 'gcc'. It will then execute - it to check that it is a C compiler, passing only the --version flag to - it. If the return code is 0, buildman assumes that it is a valid C + it to check that it is a C compiler, passing only the ``--version`` flag to + it. If the return code is 0, Buildman assumes that it is a valid C compiler. It uses the first part of the name as the architecture and strips off the last part when setting the CROSS_COMPILE environment variable (parts are delimited with a hyphen). @@ -939,8 +952,7 @@ a set of (tag, value) pairs. '[toolchain-prefix]' section This can be used to provide the full toolchain-prefix for one or more architectures. The full CROSS_COMPILE prefix must be provided. These - typically have a higher priority than matches in the '[toolchain]', due to - this prefix. + typically have a higher priority than matches in the '[toolchain]'. The tilde character ``~`` is supported in paths, to represent the home directory. @@ -949,12 +961,12 @@ a set of (tag, value) pairs. This converts toolchain architecture names to U-Boot names. For example, if an x86 toolchains is called i386-linux-gcc it will not normally be used for architecture 'x86'. Adding 'x86: i386 x86_64' to this section - will tell buildman that the i386 and x86_64 toolchains can be used for + will tell Buildman that the i386 and x86_64 toolchains can be used for the x86 architecture. '[make-flags]' section U-Boot's build system supports a few flags (such as BUILD_TAG) which - affect the build product. These flags can be specified in the buildman + affect the build product. These flags can be specified in the Buildman settings file. They can also be useful when building U-Boot against other open source software. @@ -983,7 +995,7 @@ Quick Sanity Check ------------------ If you have made changes and want to do a quick sanity check of the -currently checked-out source, run buildman without the -b flag. This will +currently checked-out source, run Buildman without the -b flag. This will build the selected boards and display build status as it runs (i.e. -v is enabled automatically). Use -e to see errors/warnings as well. @@ -1002,29 +1014,29 @@ will build commits in us-buildman that are not in upstream/master. Building Faster --------------- -By default, buildman doesn't execute 'make mrproper' prior to building the +By default, Buildman doesn't execute 'make mrproper' prior to building the first commit for each board. This reduces the amount of work 'make' does, and hence speeds up the build. To force use of 'make mrproper', use -the -m flag. -This flag will slow down any buildman invocation, since it increases the amount -of work done on any build. An alternative is to use the --fallback-mrproper +This flag will slow down any Buildman invocation, since it increases the amount +of work done on any build. An alternative is to use the ``--fallback-mrproper`` flag, which retries the build with 'make mrproper' only after a build failure. -One possible application of buildman is as part of a continual edit, build, -edit, build, ... cycle; repeatedly applying buildman to the same change or +One possible application of Buildman is as part of a continual edit, build, +edit, build, ... cycle; repeatedly applying Buildman to the same change or series of changes while making small incremental modifications to the source each time. This provides quick feedback regarding the correctness of recent -modifications. In this scenario, buildman's default choice of build directory +modifications. In this scenario, Buildman's default choice of build directory causes more build work to be performed than strictly necessary. -By default, each buildman thread uses a single directory for all builds. When a +By default, each Buildman thread uses a single directory for all builds. When a thread builds multiple boards, the configuration built in this directory will cycle through various different configurations, one per board built by the thread. Variations in the configuration will force a rebuild of affected source -files when a thread switches between boards. Ideally, such buildman-induced +files when a thread switches between boards. Ideally, such Buildman-induced rebuilds would not happen, thus allowing the build to operate as efficiently as -the build system and source changes allow. buildman's -P flag may be used to +the build system and source changes allow. Buildman's -P flag may be used to enable this; -P causes each board to be built in a separate (board-specific) -directory, thus avoiding any buildman-induced configuration changes in any +directory, thus avoiding any Buildman-induced configuration changes in any build directory. U-Boot's build system embeds information such as a build timestamp into the @@ -1041,9 +1053,9 @@ of the source tree, thus allowing rapid tested evolution of the code:: ./tools/buildman/buildman -Pr tegra -Note also the `--dtc-skip` option which uses the system device-tree compiler to +Note also the ``--dtc-skip`` option which uses the system device-tree compiler to avoid needing to build it for each board. This can save 10-20% of build time. -An alternative is to set DTC=/path/to/dtc when running buildman. +An alternative is to set DTC=/path/to/dtc when running Buildman. Checking configuration ---------------------- @@ -1062,7 +1074,7 @@ For example:: + u-boot.cfg: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_NET=1 + u-boot-spl.cfg: CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 + all: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 CONFIG_SPL_NET=1 - am335x_evm_usbspl : + am335x_evm_usbspl: + u-boot.cfg: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_NET=1 + u-boot-spl.cfg: CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 + all: CONFIG_SPL_ENV_SUPPORT=1 CONFIG_SPL_MMC=1 CONFIG_SPL_NAND_SUPPORT=1 CONFIG_SPL_NET=1 @@ -1073,15 +1085,15 @@ This shows that commit 44 enabled three new options for the board am335x_evm_usbspl which were not enabled in commit 43. There is also a summary for 'arm' showing all the changes detected for that architecture. In this case there is only one board with changes, so 'arm' output is the -same as 'am335x_evm_usbspl'/ +same as 'am335x_evm_usbspl'. The -K option uses the u-boot.cfg, spl/u-boot-spl.cfg and tpl/u-boot-tpl.cfg files which are produced by a build. If all you want is to check the -configuration you can in fact avoid doing a full build, using --config-only. -This tells buildman to configuration U-Boot and create the .cfg files, but not +configuration you can in fact avoid doing a full build, using ``--config-only``. +This tells Buildman to configure U-Boot and create the .cfg files, but not actually build the source. This is 5-10 times faster than doing a full build. -By default buildman considers the follow two configuration methods +By default Buildman considers the following two configuration methods equivalent:: #define CONFIG_SOME_OPTION @@ -1089,9 +1101,9 @@ equivalent:: CONFIG_SOME_OPTION=y The former would appear in a header filer and the latter in a defconfig -file. The achieve this, buildman considers 'y' to be '1' in configuration +file. To achieve this, Buildman considers 'y' to be '1' in configuration variables. This avoids lots of useless output when converting a CONFIG -option to Kconfig. To disable this behaviour, use --squash-config-y. +option to Kconfig. To disable this behaviour, use ``--squash-config-y``. Checking the environment @@ -1120,7 +1132,7 @@ and 'brppt1_spi', removing a trailing semicolon. 'brppt1_nand' gained an a value for 'altbootcmd', but lost one for ' altbootcmd'. The -U option uses the u-boot.env files which are produced by a build. -Internally, buildman writes out an out-env file into the build directory for +Internally, Buildman writes out an out-env file into the build directory for later comparison. defconfig fragments @@ -1166,7 +1178,7 @@ Link-time optimisation (LTO) is designed to reduce code size by globally optimising the U-Boot build. Unfortunately this can dramatically slow down builds. This is particularly noticeable when running a lot of builds. -Use the -L (--no-lto) flag to disable LTO. +Use the -L (``--no-lto``) flag to disable LTO. .. code-block:: bash @@ -1176,7 +1188,7 @@ Use the -L (--no-lto) flag to disable LTO. Doing a simple build -------------------- -In some cases you just want to build a single board and get the full output, use +In case you want to build a single board and get the full output, use the -w option, for example: .. code-block:: bash @@ -1190,13 +1202,13 @@ specify the output directory with -o when using -w. Support for IDEs (Integrated Development Environments) ------------------------------------------------------ -Normally buildman summarises the output and shows information indicating the +Normally Buildman summarises the output and shows information indicating the meaning of each line of output. For example a '+' symbol appears at the start of -each error line. Also, buildman prints information about what it is about to do, +each error line. Also, Buildman prints information about what it is about to do, along with a summary at the end. -When using buildman from an IDE, it is helpful to drop this behaviour. Use the --I/--ide option for that. You might find -W helpful also so that warnings do +When using Buildman from an IDE, it is helpful to drop this behaviour. Use the +``-I/--ide`` option for that. You might also find -W helpful so that warnings do not cause the build to fail: .. code-block:: bash @@ -1215,12 +1227,12 @@ Typically a missing external blob causes a build failure. For build testing of a lot of boards, or boards for which you do not have the blobs, you can use the -M flag to allow missing blobs. This marks the build as if it succeeded, although with warnings shown, including 'Some images are invalid'. If any boards -fail in this way, buildman exits with status 101. +fail in this way, Buildman exits with status 101. -To convert warnings to errors, use -E. To make buildman return success with +To convert warnings to errors, use -E. To make Buildman return success with these warnings, use -W. -It is generally safe to default to enabling -M for all runs of buildman, so long +It is generally safe to default to enabling -M for all runs of Buildman, so long as you check the exit code. To do this, add:: allow-missing = "always" @@ -1261,11 +1273,12 @@ Some options have values, in which case you can change them: buildman -a 'BOOTCOMMAND="echo hello"' CONFIG_SYS_LOAD_ADDR=0x1000 -Note that you must put quotes around string options and the whole thing must be -in single quotes, to make sure the shell leave it alone. +Note that you must put quotes around string options and the whole argument must +be in single quotes to ensure that the shell recognizes it as a single +argument. If you try to set an option that does not exist, or that cannot be changed for -some other reason (e.g. it is 'selected' by another option), then buildman +some other reason (e.g. it is 'selected' by another option), then Buildman shows an error:: $ buildman --board sandbox -a FRED @@ -1279,18 +1292,18 @@ shows an error:: FRED Missing expected line: CONFIG_FRED=y -One major caveat with this feature with branches (-b) is that buildman does not +One major caveat with this feature with branches (-b) is that Buildman does not name the output directories differently when you change the configuration, so -doing the same build again with different configuration will not trigger a -rebuild. You can use -f to work around that. +re-launching Buildman with an updated configuration will not trigger a rebuild. +You can use -f to work around that. Other options ------------- -Buildman has various other command-line options. Try --help to see them. +Buildman has various other command-line options. Try ``--help`` to see them. -To find out what toolchain prefix buildman will use for a build, use the -A +To find out what toolchain prefix Buildman will use for a build, use the -A option. To request that compiler warnings be promoted to errors, use -E. This passes the @@ -1313,29 +1326,29 @@ warnings are found. Note that it can be useful to combine -E and -W. This means that all compiler warnings will produce failures (code 100) and all other warnings will produce success (since 101 is changed to 0). -If there are both warnings and errors, errors win, so buildman returns 100. +If there are both warnings and errors, errors win, so Buildman returns 100. The -y option is provided (for use with -s) to ignore the bountiful device-tree -warnings. Similarly, -Y tells buildman to ignore the migration warnings. +warnings. Similarly, -Y tells Buildman to ignore the migration warnings. -Sometimes you might get an error in a thread that is not handled by buildman, +Sometimes you might get an error in a thread that is not handled by Buildman, perhaps due to a failure of a tool that it calls. You might see the output, but -then buildman hangs. Failing to handle any eventuality is a bug in buildman and +then Buildman hangs. Failing to handle any eventuality is a bug in Buildman and should be reported. But you can use -T0 to disable threading and hopefully figure out the root cause of the build failure. -For situations where buildman is invoked from multiple running processes, it is -sometimes useful to have buildman wait until the others have finished. Use the ---process-limit option for this: --process-limit 1 will allow only one buildman -to process jobs at a time. +For situations where Buildman is invoked from multiple running processes, it is +sometimes useful to have Buildman wait until the others have finished. Use the +``--process-limit`` option for this: ``--process-limit 1`` will allow only one +Buildman to process jobs at a time. To build a particular target, rather than the default U-Boot target, use the -`--target` option. This is unlikely to be useful unless you are building a +``--target`` option. This is unlikely to be useful unless you are building a single board. Buildman normally builds out-of-tree, meaning that the source directory is not disturbed by the build. Use `-i` to do an in-tree build instead. Note that this -does not affect the source directory, since buildman creates a separate git +does not affect the source directory, since Buildman creates a separate git 'worktree' for each board. This means that it is possible to do an in-tree build of an entire branch, or even a 'current source' build for multiple boards. As a special case, you can use `-wi` to do an in-tree build in the current @@ -1344,7 +1357,7 @@ directory. Build summary ------------- -When buildman finishes it shows a summary, something like this:: +When Buildman finishes, it displays a summary, similar to the following: Completed: 5 total built, duration 0:00:21, rate 0.24 @@ -1357,14 +1370,14 @@ U-Boot build. Using boards.cfg ---------------- -This file is no-longer needed by buildman but it is still generated in the +This file is no-longer needed by Buildman but it is still generated in the working directory. This helps avoid a delay on every build, since scanning all -the Kconfig files takes a few seconds. Use the `-R <filename>` flag to force -regeneration of the file - in that case buildman exits after writing the file +the Kconfig files takes a few seconds. Use the ``-R <filename>`` flag to force +regeneration of the file - in that case Buildman exits after writing the file with exit code 2 if there was an error in the maintainer files. To use the default filename, use a hyphen, i.e. `-R -`. -You should use 'buildman -nv <criteria>' instead of greoing the boards.cfg file, +You should use 'buildman -nv <criteria>' instead of greping the boards.cfg file, since it may be dropped altogether in future. @@ -1372,16 +1385,16 @@ Checking maintainers -------------------- Sometimes a board is added without a corresponding entry in a MAINTAINERS file. -Use the `--maintainer-check` option to check this:: +Use the ``--maintainer-check`` option to check this:: $ buildman --maintainer-check WARNING: board/mikrotik/crs3xx-98dx3236/MAINTAINERS: missing defconfig ending at line 7 WARNING: no maintainers for 'clearfog_spi' -Buildman returns with an exit code of 2 if there area any warnings. +Buildman returns with an exit code of 2 if there are any warnings. -An experimental `--full-check option` also checks for boards which don't have a -CONFIG_TARGET_xxx where xxx corresponds to their defconfig filename. This is +An experimental ``--full-check option`` also checks for boards which don't have +a CONFIG_TARGET_xxx where xxx corresponds to their defconfig filename. This is not strictly necessary, but may be useful information. |