mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-26 08:31:28 +00:00
buildman: Make sure that -o is given with -w
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>
This commit is contained in:
parent
97944d3f7d
commit
88daaef19f
4 changed files with 13 additions and 3 deletions
|
@ -1091,7 +1091,8 @@ the -w option, for example:
|
||||||
|
|
||||||
buildman -o /tmp/build --board sandbox -w
|
buildman -o /tmp/build --board sandbox -w
|
||||||
|
|
||||||
This will write the full build into /tmp/build including object files.
|
This will write the full build into /tmp/build including object files. You must
|
||||||
|
specify the output directory with -o when using -w.
|
||||||
|
|
||||||
|
|
||||||
Other options
|
Other options
|
||||||
|
|
|
@ -76,8 +76,7 @@ def ParseArgs():
|
||||||
default=False, help="Do a dry run (describe actions, but do nothing)")
|
default=False, help="Do a dry run (describe actions, but do nothing)")
|
||||||
parser.add_option('-N', '--no-subdirs', action='store_true', dest='no_subdirs',
|
parser.add_option('-N', '--no-subdirs', action='store_true', dest='no_subdirs',
|
||||||
default=False, help="Don't create subdirectories when building current source for a single board")
|
default=False, help="Don't create subdirectories when building current source for a single board")
|
||||||
parser.add_option('-o', '--output-dir', type='string',
|
parser.add_option('-o', '--output-dir', type='string', dest='output_dir',
|
||||||
dest='output_dir', default='..',
|
|
||||||
help='Directory where all builds happen and buildman has its workspace (default is ../)')
|
help='Directory where all builds happen and buildman has its workspace (default is ../)')
|
||||||
parser.add_option('-O', '--override-toolchain', type='string',
|
parser.add_option('-O', '--override-toolchain', type='string',
|
||||||
help="Override host toochain to use for sandbox (e.g. 'clang-7')")
|
help="Override host toochain to use for sandbox (e.g. 'clang-7')")
|
||||||
|
|
|
@ -175,6 +175,10 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
|
||||||
if options.incremental:
|
if options.incremental:
|
||||||
print(col.Color(col.RED,
|
print(col.Color(col.RED,
|
||||||
'Warning: -I has been removed. See documentation'))
|
'Warning: -I has been removed. See documentation'))
|
||||||
|
if not options.output_dir:
|
||||||
|
if options.work_in_output:
|
||||||
|
sys.exit(col.Color(col.RED, '-w requires that you specify -o'))
|
||||||
|
options.output_dir = '..'
|
||||||
|
|
||||||
# Work out what subset of the boards we are building
|
# Work out what subset of the boards we are building
|
||||||
if not boards:
|
if not boards:
|
||||||
|
|
|
@ -569,3 +569,9 @@ class TestFunctional(unittest.TestCase):
|
||||||
self._RunControl('-b', self._test_branch, '-o', self._output_dir,
|
self._RunControl('-b', self._test_branch, '-o', self._output_dir,
|
||||||
'-w', clean_dir=False, boards=board_list)
|
'-w', clean_dir=False, boards=board_list)
|
||||||
self.assertIn("single commit", str(e.exception))
|
self.assertIn("single commit", str(e.exception))
|
||||||
|
|
||||||
|
board_list = board.Boards()
|
||||||
|
board_list.AddBoard(board.Board(*boards[0]))
|
||||||
|
with self.assertRaises(SystemExit) as e:
|
||||||
|
self._RunControl('-w', clean_dir=False)
|
||||||
|
self.assertIn("specify -o", str(e.exception))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue