Compare commits

..

5 Commits

Author SHA1 Message Date
Simon Glass
7381ec48b8 gitlab: Add a StarFive VisionFive2 to the sjg lab
I have one of these boards loaded with Ubuntu 24.10 (64-bit). Add an
entry for it so that it can be used for testing.

Series-to: u-boot
Series-cc: trini, heinrich
Cover-letter:
gitlab: Fixes to get StarFive VisionFive2 into the sjg lab
This board fought valiantly against attempts to add it to my lab. After
several hours of debugging, I found problems in the Labgrid integration
(not included here), test.py and buildman

This series fixes these and the board now seems to be reliable enough.

Note that the board fails test_dm_compat

Link: https://github.com/labgrid-project/labgrid/pull/1411
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-14 10:57:18 -07:00
Simon Glass
fa3b6c235d buildman: Record an error if a toolchain is missing
Buildman has always treated the lack of a toolchain as an infrastructure
problem rather than a build failure.

However the logic for this is not correct, since it does not write a
'done' file in this case.

As a result, one of two things can happen.

1. If a previous build ran in the same (output) directory, the outcome
   of *that* build is recorded as the outcome of this one
2. Otherwise, no outcome is recorded

Obviously this inconsistency is not ideal. While (2) is rare, it can be
very confusing as the build sort-of fails but does not produce any
summary output with 'buildman -s'

Overall it seems better to attribute a toolchain issue to the boards
that it affects. This results in clear failures which can be examined,
no matter what happened in the .bm-work directory previously.

So write a 'done' file for each build when a toolchain is missing.

The end result of this patch is to make missing toolchains much more
obvious. It should be things a bit easier for novice users.
2024-12-14 10:40:06 -07:00
Simon Glass
f3982a9c12 buildman: Drop unused OUTPUT_FILE constant
This is not actually used but its presence suggests that it is the
filename for the board database. Drop it to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-14 10:34:02 -07:00
Simon Glass
8292f801e9 test/py: Handle u-boot-test-getrole failure
This script can fail if there is no toolchain available for the board.
At present this is not handled very nicely, in that only the error
output is reported. It is much more useful to see everything, so
combine stdout and stderr and report them both.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-14 10:34:02 -07:00
Simon Glass
8c5793fdd6 test/py: Provide the correct U_BOOT_SOURCE_DIR to getrole
The u-boot-test-getrole script runs before the normal environment
variables have been set up. This is unavoidable since the script is
providing necessary information to test.py

This means that U_BOOT_SOURCE_DIR is not set in the environment.

As a result, Labgrid uses its default source path, configured in its
environment variable. While this may happen to work, it is not correct.
Also, it causes problems when running from Gitlab, where the runner may
not have access to that source path.

Provide the required source path in U_BOOT_SOURCE_DIR so that Labgrid
does the right thing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: bf89a8f1fc ("test: Introduce the concept of a role")

[1] https://patchwork.ozlabs.org/project/uboot/patch/20241211131858.520639-1-sjg@chromium.org/

Commit-notes:
This patch is intended to be applied on top of [1], which fixes a
similar issue, but only within pytest itself. It should be possible to
drop that patch and just use this one, but it is a bit nonsensical to
ask Labgrid for something which test.py already knows, so both patches
are valuable.
END
2024-12-14 10:33:15 -07:00
7 changed files with 4 additions and 45 deletions

View File

@@ -692,24 +692,7 @@ nyan-big:
ROLE: nyan-big
<<: *lab_dfn
rpi:
vision5:
variables:
ROLE: rpi
<<: *lab_dfn
# StarFive VisionFive 2
vf2:
variables:
ROLE: vf2
<<: *lab_dfn
colibrimx8:
variables:
ROLE: colibrimx8
<<: *lab_dfn
# NVIDIA Jetson TK1
tk1:
variables:
ROLE: tk1
ROLE: vision5
<<: *lab_dfn

View File

@@ -265,7 +265,7 @@ class Builder:
reproducible_builds=False, force_build=False,
force_build_failures=False, force_reconfig=False,
in_tree=False, force_config_on_failure=False, make_func=None,
dtc_skip=False, build_target=None):
dtc_skip=False):
"""Create a new Builder object
Args:
@@ -315,7 +315,6 @@ class Builder:
retrying a failed build
make_func (function): Function to call to run 'make'
dtc_skip (bool): True to skip building dtc and use the system one
build_target (str): Build target to use (None to use the default)
"""
self.toolchains = toolchains
self.base_dir = base_dir
@@ -364,7 +363,6 @@ class Builder:
raise ValueError('Cannot find dtc')
else:
self.dtc = None
self.build_target = build_target
if not self.squash_config_y:
self.config_filenames += EXTRA_CONFIG_FILENAMES

View File

@@ -286,8 +286,6 @@ class BuilderThread(threading.Thread):
"""
if config_only:
args.append('cfg')
elif self.builder.build_target:
args.append(self.builder.build_target)
result = self.make(commit, brd, 'build', cwd, *args, env=env)
cmd_list.append([self.builder.gnu_make] + args)
if (result.return_code == 2 and

View File

@@ -1329,10 +1329,6 @@ 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
single board.
Build summary
-------------

View File

@@ -22,7 +22,6 @@ def add_upto_m(parser):
This is split out to avoid having too many statements in one function
"""
# Available JqzZ
parser.add_argument('-a', '--adjust-cfg', type=str, action='append',
help='Adjust the Kconfig settings in .config before building')
parser.add_argument('-A', '--print-prefix', action='store_true',
@@ -154,8 +153,6 @@ def add_after_m(parser):
parser.add_argument('-T', '--threads', type=int,
default=None,
help='Number of builder threads to use (0=single-thread)')
parser.add_argument('--target', type=str,
default=None, help='Build target to use')
parser.add_argument('-u', '--show_unknown', action='store_true',
default=False, help='Show boards with unknown build result')
parser.add_argument('-U', '--show-environment', action='store_true',

View File

@@ -785,9 +785,6 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None,
args.verbose)
return 0
if args.config_only and args.target:
raise ValueError('Cannot use --config-only with --target')
# Create a new builder with the selected args
builder = Builder(toolchains, output_dir, git_dir,
args.threads, args.jobs, checkout=True,
@@ -813,7 +810,7 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None,
force_build_failures = args.force_build_failures,
force_reconfig = args.force_reconfig, in_tree = args.in_tree,
force_config_on_failure=not args.quick, make_func=make_func,
dtc_skip=args.dtc_skip, build_target=args.target)
dtc_skip=args.dtc_skip)
TEST_BUILDER = builder

View File

@@ -1152,13 +1152,3 @@ CONFIG_SOC="fred"
'board': 'ARM Board 0',
'config': 'config0',
'target': 'board0'}, []), res)
def testTarget(self):
"""Test that the --target flag works"""
lines = self.check_command('--target', 'u-boot.dtb')[0]
# It should not affect the defconfig line
self.assertNotIn(b'u-boot.dtb', lines[0])
# It should appear at the end of the build line
self.assertEqual(b'u-boot.dtb', lines[1].split()[-1])