summaryrefslogtreecommitdiff
path: root/tools/buildman
AgeCommit message (Collapse)AuthorFilesLines
2022-02-09patman: Convert camel case in terminal.pySimon Glass4-45/+45
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Rename Color() method to build()Simon Glass4-41/+41
This method has the same name as its class which is confusing. It is also annoying when searching the code. It builds a string with a colour, so rename it to build(). Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Rename Print() to Tprint()Simon Glass2-30/+30
Rename this function so that when we convert it to snake case it will not conflict with the built-in print() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in test_util.pySimon Glass1-2/+2
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in gitutil.pySimon Glass4-14/+14
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in command.pySimon Glass5-13/+13
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in tools.pySimon Glass4-8/+8
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09buildman: Allow adjusting board config on the flySimon Glass5-8/+93
Add a -a option to specify changes to the config before the build commences. For example buildman -a ~CONFIG_CMDLINE disables CONFIG_CMDLINE before doing the build. This makes it easier to try things out as well as to write tests without creating a new board or manually manging the .config file. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09buildman: Provide a hint on how to debug thread crashesSimon Glass2-2/+4
If a thread crashes it is helpful to try the operation again with threading disabled. Add a hint about that. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09buildman: Add helper functions for updating .config filesSimon Glass3-2/+360
At present the only straightforward way to write tests that need a slightly different configuration is to create a new board with its own configuration. This is cumbersome. It would be useful if buildman could adjust the configuration of a build on the fly. In preparation for this, add a utility library which can modify a .config file according to various parameters passed to it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09buildman: Make use of test_utilSimon Glass1-15/+11
Use test_util to run the tests, with the ability to select a single test to run, if desired. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09buildman: Add a flag to control the tracebackSimon Glass2-0/+5
At present the full horror of the Python traceback is shown by default. It is normally only useful for debugging. Turn it off by default and add a --debug flag to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25patman: Tidy up the download function a littleSimon Glass1-1/+1
Reverse the order of the return tuple, so that the filename is first. This seems more obvious than putting the temporary directory first. Correct a bug that leaves a space on the final line. Allow the caller to control the name of the temporary directory. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25buildman: Move the download function to toolsSimon Glass1-45/+1
This function is handy for binman as well. Move it into the shared 'tools' module. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25tools: Add init files for Python toolsSimon Glass1-0/+0
Add some empty __init__ files for binman, buildman and dtoc so that pylint is able to recognise these as Python modules and produce more useful pylint output. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-10-21buildman: Add gcc-11.1.0 to the directory listTom Rini1-1/+1
While CI has been using gcc-11.1.0 for a long time, we have not updated buildman to match. Correct this omission. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-10-20buildman: Detect Kconfig loopsSimon Glass1-1/+42
Hex and int Kconfig options are supposed to have defaults. This is so we can configure U-Boot without having to enter particular values for the items that don't have specific values in the board's defconfig file. If this rule is not followed, then introducing a new Kconfig can produce a loop like this: Break things (BREAK_ME) [] (NEW) Error in reading or end of file. Break things (BREAK_ME) [] (NEW) Error in reading or end of file. The continues forever since buildman passes /dev/null to 'conf', and the build system just tries again. Eventually there is so much output that buildman runs out of memory. We can detect this situation by looking for a symbol (like 'BREAK_ME') which has no default (the '[]' above) and is marked as new. If this appears multiple times in the output, we know something is wrong. Add a filter function for the output which detects this situation. Allow it to return True to terminate the process. Implement this termination in cros_subprocess. With this we get a nice message: buildman --board sandbox -T0 Building current source for 1 boards (0 threads, 32 jobs per thread) sandbox: w+ sandbox +.config:66:warning: symbol value '' invalid for BREAK_ME + +Error in reading or end of file. +make[3]: *** [scripts/kconfig/Makefile:75: syncconfig] Terminated +make[2]: *** [Makefile:569: syncconfig] Terminated +make: *** [Makefile:177: sub-make] Terminated +(** did you define an int/hex Kconfig with no default? **) Signed-off-by: Simon Glass <sjg@chromium.org>
2021-10-20buildman: Write output even on fatal errorSimon Glass1-6/+6
At present buildman does not write any output (to the 'out' and 'err) files if the build terminates with a fatal error. This is to avoid adding lots of spam to the logs. However there are times when this is actually useful, such as when the build fails for an obscure reason such as a Kconfig loop. Update the logic to always write the output, so that the user gets a clue as to what is happening. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-24tools: Refactor full help printingPaul Barker1-6/+4
Collect the code for printing the full help message of patman, buildman and binman into a single function in patman.tools. Signed-off-by: Paul Barker <paul.barker@sancloud.com>
2021-09-04net: Rename SPL_NET_SUPPORT to SPL_NETSimon Glass1-4/+4
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-04mmc: Rename MMC_SUPPORT to MMCSimon Glass1-4/+4
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> [trini: Fixup some incorrect renames] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-28Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOSTSimon Glass1-1/+1
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-29buildman: Use bytes for the environmentSimon Glass3-11/+30
At present we sometimes see problems in gitlab where the environment has 0x80 characters or sequences which are not valid UTF-8. Avoid this by using bytes for the environment, both internal to buildman and when writing out the 'env' file. Add a test to make sure this works as expected. Reported-by: Marek Vasut <marex@denx.de> Fixes: e5fc79ea718 ("buildman: Write the environment out to an 'env' file") Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-29buildman: Handle exceptions in threads gracefullySimon Glass4-11/+56
There have been at least a few cases where an exception has occurred in a thread and resulted in buildman hanging: running out of disk space and getting a unicode error. Handle these by collecting a list of exceptions, printing them out and reporting failure if any are found. Add a test for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-29buildman: Use common code to send an resultSimon Glass1-8/+13
At present the code to report a build result is duplicated. Put it in a common function to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-29buildman: Tidy up a few commentsSimon Glass3-5/+20
Add some function comments which are missing, or missing arguments. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-04-06buildman: Add an encoding to the out-env fileSimon Glass1-1/+2
The environment may contain some unicode characters. At least that is what seemed to happen on one commit: Building current source for 1 boards (0 threads, 64 jobs per thread) 0 0 0 /1 -1 (starting) Traceback (most recent call last): File ".../tools/buildman/buildman", line 64, in <module> ret_code = control.DoBuildman(options, args) File "tools/buildman/control.py", line 372, in DoBuildman options.keep_outputs, options.verbose) File ".../tools/buildman/builder.py", line 1704, in BuildBoards results = self._single_builder.RunJob(job) File ".../tools/buildman/builderthread.py", line 526, in RunJob self._WriteResult(result, job.keep_outputs, job.work_in_output) File ".../tools//buildman/builderthread.py", line 349, in _WriteResult print('%s="%s"' % (var, env[var]), file=fd) UnicodeEncodeError: 'ascii' codec can't encode characters in position 311-312: ordinal not in range(128) The problem defies repetition with any change at all to buildman. But let's set an encoding in any case. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-05buildman: Support single-threaded operationSimon Glass6-30/+68
At present even if only a single thread is in use, buildman still uses threading. For some debugging it is helpful to do everything in the main process. Allow -T0 to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-02-14buildman: 'Thread' object has no attribute 'isAlive'Heinrich Schuchardt1-1/+1
The isAlive() method was deprecated in Python 3.8 and has been removed in Python 3.9. See https://bugs.python.org/issue37804. Use is_alive() instead. Since Python 2.6 is_alive() has been a synonym for isAlive(). So there should be no problems for users using elder Python 3 versions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-23buildman: Remove output binaries before buildingSimon Glass1-1/+13
Buildman reuses build directories from previous builds to avoid the cost of 'make mrproper' for every build. If the previous build produced an SPL image but the current one does not, the SPL image will remain and buildman will think it is a result of building the current board. Remove these files before building, to avoid this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Rename functions in patchstreamSimon Glass1-3/+3
Rename these functions to lower case as per PEP8. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-09-22buildman: Use git worktrees instead of git clones when possibleAlper Nebi Yasak2-8/+42
This patch makes buildman create linked working trees instead of clones of the source repository, but keeps updating the older clones of the repository that might already exist. These worktrees share "everything except working directory specific files such as HEAD, index, etc." with the source repository. See the git-worktree(1) manual page for more information. If git-worktree isn't available, silently falls back to cloning the repository. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2020-09-22tools: Drop unnecessary use of __file__Simon Glass1-3/+0
There are few places where the path of the current modules is calculated but not used. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-29buildman: Show the build rate at the endSimon Glass2-1/+15
It is interesting to note the number of builds completed per second to track machine performance and build speed. Add a 'rate' value at the end of the build to show this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-29buildman: Correct the testOutputDir() unit testSimon Glass1-2/+1
This current fails with an error. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 7664b03ffc5 ("buildman: Remove _of_#_ from results directory paths")
2020-07-29buildman: Allow using older versions of genboardscfg.pySimon Glass1-2/+8
Older versions of this script don't support the -q flag. Since buildman runs this script from when it starts, we may get the old version. Fix this in two ways: 1. Use the version from the same tree as buildman is run from, if available 2. Failing that, allow the -q flag to be missing Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-01kconfiglib: Update to the 14.1.0 releaseTom Rini1-242/+372
A large number of changes have happened upstream since our last sync in commit 65e05ddc1ae2 ("kconfiglib: Update to the 12.14.0 release"). The big motivation for this sync is support for user defined macros within Kconfig. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-06-12buildman: Remove _of_#_ from results directory pathsOvidiu Panait2-9/+9
Currently, the following scenario will rebuild the first commit even though it is not really necessary - the commit sha or the position in the patchset did not change: $ git am <local-patch-0001> $ tools/buildman/buildman -P -E -W -b master mx6 <do some more development work> $ git am <local-patch-0002> $ tools/buildman/buildman -P -E -W -b master mx6 <- will rebuild the first commit as well, even though nothing has changed about it. This is due to the fact that previous results directories get removed when the number of commits change. By removing the _of_#_ part of the directory path, the commits will be rebuilt only if the commit sha or the position in the patchset changes. Also, update the testcase to reflect this change. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-04-26patman: Tidy up sys.path changesSimon Glass2-3/+1
Now that we are using absolute paths we can remove some of the sys.path mangling that appears in the tools. We only need to add the path to 'tools/' so that everything can find modules relative to that directory. The special paths for finding pylibfdt remain. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26patman: Move to absolute importsSimon Glass7-27/+26
At present patman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move patman to use absolute imports. This requires changes in tools which use the patman libraries (which is most of them). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26buildman: Move to absolute importsSimon Glass6-29/+30
At present buildman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move buildman to use absolute imports. Also adjust moveconfig.py too since it uses some buildman modules and cannot work without this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26buildman: Rename the main moduleSimon Glass2-1/+1
Python does not like the module name being the same as the module directory. To allow buildman modules to be used from other tools, rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26patman: Drop references to __future__Simon Glass1-2/+0
We don't need these now that the tools using Python 3. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26buildman: Write output files when using -wSimon Glass3-14/+26
At present buildman does not write its own output files (err, done, the environment) when using -w. However this is useful for when the build is run with -s to check it. In fact ProduceResultSummary() reads the result from those files rather than using the 'result' info directly. So ProcessResult() does not work with -w at present. It does not print any output. Fix this by writing output files even when -w is used. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26buildman: Use out-env for environment outputSimon Glass2-1/+8
At present the environment used by U-Boot is written to the 'env' directory. This is fine when the output directory is not the same as the source directory, but when it is (as with -w) it conflicts with the source directory of the same name. Rename 'env' to 'out-env' to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26buildman: Make sure that -o is given with -wSimon Glass4-3/+13
It is a bad idea to use the default output directory ('..') with -w since it does a build in that directory and writes various files these. Require that -o is given to avoid this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26buildman: Correct operation of -A flagSimon Glass1-1/+1
This was broken when -a was removed and unfortunately there are no tests for this. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26buildman: Fix test for new 9.2 kernelSimon Glass1-1/+1
The naming is slightly different on kernel.org now. Update the regex so that the test still passes. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Change the exit codesSimon Glass3-9/+9
The current exit codes of 128 and 129 are useful in that they do not conflict with those returned by tools, but they are not actually valid. It seems better to pick some codes which work with 'bit bisect run'. Update them to 100 (for errors) and 101 (for warnings). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Update the TODO itemsSimon Glass1-6/+11
A few of these have been done. Drop those and add some new ideas. Signed-off-by: Simon Glass <sjg@chromium.org>