summaryrefslogtreecommitdiff
path: root/tools/buildman/control.py
AgeCommit message (Collapse)Author
2025-07-01buildman: Support an in-tree build in the current dirSimon Glass
Allow -w to be used with -i to do a build without a separate output directory. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27buildman: Add a way to build a particular targetSimon Glass
At present buildman only supports building the default target. Generally this is what is wanted, but in some cases boards erroneously have a different target for product extra files. Add a --target option to help. Also add a comment indicating which letters are free for new options. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-17u_boot_pylib: Move gitutil into the librarySimon Glass
Move this file into U-Boot's Python library, so that it is no-longer part of patman. This makes a start on: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35 Signed-off-by: Simon Glass <sjg@chromium.org>
2024-09-26buildman: Allow skipping the dtc buildSimon Glass
For most boards, the device-tree compiler is built in-tree, ignoring the system version. Add a special option to skip this build. This can be useful when the system dtc is up-to-date, as it speeds up the build. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26buildman: Show board list with -xSimon Glass
When -x is used, buildman does not show the list of boards that will be built, since there are no terms which cause boards to be added, only terms which cause them to be removed. Add a special case to fix this. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com>
2024-07-08Revert "buildman: Always use the full path in CROSS_COMPILE"Tom Rini
There are operations in buildman that result in running the cross-tools (such as performing size checks) and now that we have not modified PATH to know where our tools are, these operations fail. This reverts commit 6c0a3cf75f72370deec3ee516a9dd377397af207. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-03buildman: Always use the full path in CROSS_COMPILESimon Glass
The feature to set the toolchain path does not seem to be needed. It causes problems with venv (see [1]). Let's remove it. Add some tests while we are here. It does not look like any docs changes are needed for this. [1] https://patchwork.ozlabs.org/project/uboot/patch/20240621131423.2363294-6-sjg@chromium.org/ Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
2024-07-03buildman: Add a way to limit the number of buildmansSimon Glass
Buildman uses all available CPUs by default, so running more than one or two concurrent processes is not normally useful. However in some CI cases we want to be able to run several jobs at once to save time. For example, in a lab situation we may want to run a test on 20 boards at a time, since only the build step actually takes much CPU. Add an option which allows such a limit. When buildman starts up, it waits until the number of running processes goes below the limit, then claims a spot in the list. The list is maintained with a temporary file. Note that the temp file is user-specific, since it is hard to create a locked temporary file which can be accessed by any user. In most cases, only one user is running jobs on a machine, so this should not matter. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-03buildman: Add a flag to force mrproper on failureSimon Glass
When a file is removed by a commit (e.g. include/common.h yay!) it can cause incremental build failures since one of the dependency files from a previous build may mention the file. Add an option to run 'make mrproper' automatically when a build fails. This can be used to automatically resolve the problem, without always adding the large overhead of 'make mrproper' to every build. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-23buildman: Show progress when regenerating the board.cfg fileSimon Glass
This can take a while, so show a message when starting. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by Tom Rini <trini@konsulko.com>
2023-08-05buildman: Exit after reading toolchainSimon Glass
Recent refactoring changed buildman to continue operation after fetching a toolchain. Fix this. Fixes: b8680646521 ("bulidman: Move toolchain handling to a function") Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add an option to check maintainers and targetsSimon Glass
In poking around it seems that many boards don't define a CONFIG_TARGET Kconfig variable. This is not strictly necessary, but add an option to buildman so these can be viewed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a way to print the architecture for a boardSimon Glass
This is useful for some tools and is easily available for buildman. Add a new --print-arch option. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert camel case in builder.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert camel case in bsettings.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert to argparseSimon Glass
Use argparse to parse the arguments, since OptionParser is deprecated now. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Create a function to get number of built commitsSimon Glass
Move this code into a function. This removes the last pylint error in the control module. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Use get_alow_missing() directly to avoid varSimon Glass
Avoid an unnecessary local variable by moving this code to a function. This fixes the pylint warning about too many local variables. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move getting the adjust_cfg into run_builder()Simon Glass
Move this into its own function to reduce the size of do_buildman(). Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move checking for make into run_builder()Simon Glass
This is not needed until the builder is run. Move it there to reduce the size of the do_buildman() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Adjust show_toolchain_prefix() to not returnSimon Glass
This function does not need to return. Simplify the code by exiting immediately. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Drop some unnecessary variablesSimon Glass
Drop some variables at the end of the do_bulidman() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Moving running of the builder into a functionSimon Glass
Move this code into a new function. This removes the pylint warning about too many branches. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Tweak commits and show_bloatSimon Glass
Move setting of show_bloat to adjust_options() and adjust how the commits variable is set. Together these remove the pylint warning about too many statements. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move remaining builder properties to constructorSimon Glass
Do these all in the constructor, so it is consistent. Move the stray builder comment into the correct place. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Avoid too many returns in do_buildman()Simon Glass
Fix the pylint warning by using a variable instead of lots of 'return' statements. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move commit numbering into determine_series()Simon Glass
Commits are numbered for use in tests. Do this in determine_series() since it is already dealing with the series. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move setting up the output dir into a functionSimon Glass
Move this code into a separate function to reduce the size of the main do_buildman() directory. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move counting of commits into a functionSimon Glass
Move this code into a separate function to avoid a pylint warning in determine_series(). Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Build option-adjusting into a functionSimon Glass
Create a separate function to adjust options. Also move show_actions() up as far as we can in the function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Pass option values to show_actions()Simon Glass
Pass in the individual values rather than the whole options object, so we can see what is needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Pass option values to get_action_summary()Simon Glass
Pass in the individual values rather than the whole options object, so we can see what is needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move output-file setup into one placeSimon Glass
Collect the two parts of the output-file handling into single place. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24bulldman: Set up output_dir earlierSimon Glass
Set up output_dir at the start of the main function, instead of updating the options.output_dir option. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24bulidman: Move toolchain handling to a functionSimon Glass
Move the code for dealing with toolchains out into its own function, to reduce the size of the main function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move Boards-object code into a functionSimon Glass
Move the code which obtains a Boards object into its own function, to reduce the size of the main function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24bulidman: Move more code to determine_series()Simon Glass
Move some more series-related code here, to reduce the size of the main function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move board-selection code into a functionSimon Glass
Create a new determine_boards() function to hold the code which selects which boards to build. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move dry-run handling higher in do_buildman()Simon Glass
Move this up above where the builder is created, since it no-longer makes use of the builder. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Drop use of builder in show_actions()Simon Glass
This function only needs the output directory from the builder. This is passed into the builder, so just pass the same value to show_actions(). The avoids needing a builder to call show_actions(). Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move fetch-arch code into a separate functionSimon Glass
Reduce the size of the do_buildman() function a little by moving the code that handles --fetch-arch into a separate function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move series calculations into a separate functionSimon Glass
Reduce the size of the do_buildman() function a little by moving the code that figures out the series into a separate function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move full-help processing to mainSimon Glass
This does not need any of the control features. Move it out of main to reduce the size of the do_buildman() function. For Python 3.6 the -H feature will not work, but this does not seem to be a huge problem, as it dates from 2016. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Fix most pylint warnings in controlSimon Glass
Tidy up the easier-to-fix pylint warnings in module 'control'. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Convert camel case in control.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Provide an argument to the -R optionSimon Glass
Allow writing the file to a selected location, since otherwise this is controlled by the buildman configuration, so cannot be determined by the caller. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: https://source.denx.de/u-boot/u-boot/-/issues/17
2023-07-24buildman: Add an option to check maintainersSimon Glass
Rather than using the -R option to get this report as a side effect, add a dedicated option for it. Disable CI for now as there are some missing maintainers, unfortunately. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-28tools: Fall back to importlib_resources on Python 3.6Jan Kiszka
importlib.resources became part of 3.7 only. Allow using distros with 3.6 and the importlib_resources backport. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08buildman: Use importlib to find the helpSimon Glass
Use this function so that the help can be found even when buildman is running from a package. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08buildman: Fix use of a type as a variableSimon Glass
Using 'str' as a variable makes it impossible to use it as a type in the same function. Fix this by using a different name. Signed-off-by: Simon Glass <sjg@chromium.org>