summaryrefslogtreecommitdiff
path: root/tools/buildman
AgeCommit message (Collapse)AuthorFilesLines
2023-07-24buildman: Move checking for make into run_builder()Simon Glass1-6/+8
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 Glass1-5/+2
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 Glass1-6/+2
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 Glass1-21/+35
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 Glass1-8/+5
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 Glass2-18/+25
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 Glass1-4/+5
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 Glass1-3/+7
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 Glass1-12/+33
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 Glass1-22/+41
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 Glass1-20/+33
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 Glass1-9/+13
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 Glass1-7/+15
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 Glass1-8/+7
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 Glass1-5/+5
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 Glass1-15/+38
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 Glass1-26/+48
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 Glass1-40/+42
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 Glass1-16/+43
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: Add tests for excluding thingsSimon Glass1-0/+24
Add some tests for the -x flag. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move dry-run handling higher in do_buildman()Simon Glass1-43/+45
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 Glass1-4/+4
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: Add a test for the -A optionSimon Glass1-0/+7
This lacks a test at present. Add one. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Move fetch-arch code into a separate functionSimon Glass1-18/+31
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 Glass1-39/+56
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 Glass2-11/+9
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 Glass2-50/+71
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 Glass4-19/+24
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Tidy up pylint warnings in mainSimon Glass1-13/+12
Tidy up the various pylint warnings in module 'main'. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Provide an argument to the -R optionSimon Glass4-10/+26
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 Glass5-24/+62
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-07-24buildman: Correct logic for missing maintainersSimon Glass2-7/+27
An orphaned board should produce a warning, as should a missing name for the maintainer (when '-' is provided). Add these cases. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Sort the maintainer warningsSimon Glass2-4/+5
Sort the warnings into alphabetical order, for easier reading. Also make sure that the buildman test files are ignored. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Just display a single line for missing maintainersSimon Glass2-3/+6
At present we get multiple lines of output when a board has no MAINTAINERS entry: WARNING: no status info for 'bananapi-m2-pro' WARNING: no maintainers for 'bananapi-m2-pro' Suppress the 'status' one since it is implied by the other. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Correct operation of MAINTAINERS N:Simon Glass2-9/+23
This doesn't work as intended. Instead it scans every defconfig file in the source tree. Fix it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Detect boards with no CONFIG_TARGET definedSimon Glass2-1/+16
We generally expected exactly one of these. Add a check for it. Note: This warning is not displayed by default. An option will be added to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Detect boards with multiple CONFIG_TARGETs definedSimon Glass2-25/+68
The TARGET_xxx options are special in that they refer to a single target. Exactly one should be enabled for each target, corresponding to a defconfig file. Detect configs which result in two TARGET_xxx options being set. For example, at present, TARGET_POLEG and TARET_POLEG_EVB are enabled for the same board. Note: This warning is not displayed by default. An option will be added to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Refactor target handling in Boards.scan()Simon Glass1-3/+5
Move the assert to the top of the function and provide an explicit variables for the target name and base name. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Warn about dangling maintainer entriesSimon Glass2-8/+22
Other than the top-level MAINTAINERS file, all maintainer entries should actually reference a target. Add a warning to detect those that do not. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Tidy up common code in parse_file()Simon Glass1-5/+8
Use a function to add to the maintainers database, to avoid duplicating the same code twice. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a partial test for ensure_board_list()Simon Glass5-14/+126
Create a new function which has the non-UI parts of ensure_board_list(). Add some tests for everything except the N: tag. While we are here, fix the confusing usage of fname inside a loops that also uses fname. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a test for Boards.output_is_new()Simon Glass1-0/+61
Add a test for this code, adjusting the timestamp on various files to check each use case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Add a test for Boards.scan_defconfigs()Simon Glass4-0/+111
Add a test for this code. It requires some defconfig files and a test Kconfig to work with, so copy these into the temporary directory at the start. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Avoid globals in leaf functionsSimon Glass1-13/+26
Rather than using the global thoughout each function, pass in these values. This allows tests to use different values when testing the same functions. Improve a few comments while we are here. No functional change is intended. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Drop dead code to handle :CONFIG_ constructSimon Glass1-13/+1
This is not needed anymore, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 252ed872 ("kconfig: remove meaningless prefixes in defconfig files")
2023-07-24buildman: Rename the ARM boardsSimon Glass1-2/+2
Use names consistent with their target names. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Exit with the return code consistentlySimon Glass1-3/+5
Test should return a suitable exit code when they fail. Fix this and tidy up the code a little. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Allow --debug to enable debuggingSimon Glass1-3/+4
The -D option is used, but plumb it through --debug to enable a full traceback when something goes wrong. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-24buildman: Fix verboose typo and add commentSimon Glass1-2/+9
Fix the typo in the RunTests() function, adding comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-22buildman: Create a requirements.txt fileTom Rini1-0/+2
At this point, buildman requires a few different modules and so we need a requirements.txt to track what modules are needed. Cc: Simon Glass <sjg@chromium.org> Cc: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Neha Malcom Francis <n-francis@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com>