modules: fail on invalid ZEPHYR_EXTRA_MODULES
Add error checking in zephyr_module.py so that if the user manually specifies ZEPHYR_EXTRA_MODULES and the list contains something that isn't in fact a valid module, we scream and die. This should help with diagnosing module errors. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
e2f647b08b
commit
34346c41ac
1 changed files with 6 additions and 4 deletions
|
@ -174,7 +174,7 @@ def main():
|
||||||
parser.add_argument('-m', '--modules', nargs='+',
|
parser.add_argument('-m', '--modules', nargs='+',
|
||||||
help="""List of modules to parse instead of using `west
|
help="""List of modules to parse instead of using `west
|
||||||
list`""")
|
list`""")
|
||||||
parser.add_argument('-x', '--extra-modules', nargs='+',
|
parser.add_argument('-x', '--extra-modules', nargs='+', default=[],
|
||||||
help='List of extra modules to parse')
|
help='List of extra modules to parse')
|
||||||
parser.add_argument('-w', '--west-path', default='west',
|
parser.add_argument('-w', '--west-path', default='west',
|
||||||
help='Path to west executable')
|
help='Path to west executable')
|
||||||
|
@ -201,9 +201,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
projects = args.modules
|
projects = args.modules
|
||||||
|
|
||||||
if args.extra_modules is not None:
|
projects += args.extra_modules
|
||||||
projects += args.extra_modules
|
extra_modules = set(args.extra_modules)
|
||||||
|
|
||||||
|
|
||||||
kconfig = ""
|
kconfig = ""
|
||||||
cmake = ""
|
cmake = ""
|
||||||
|
@ -219,6 +218,9 @@ def main():
|
||||||
kconfig += process_kconfig(project, meta)
|
kconfig += process_kconfig(project, meta)
|
||||||
cmake += process_cmake(project, meta)
|
cmake += process_cmake(project, meta)
|
||||||
sanitycheck += process_sanitycheck(project, meta)
|
sanitycheck += process_sanitycheck(project, meta)
|
||||||
|
elif project in extra_modules:
|
||||||
|
sys.exit(f'{project}, given in ZEPHYR_EXTRA_MODULES, '
|
||||||
|
'is not a valid zephyr module')
|
||||||
|
|
||||||
if args.kconfig_out:
|
if args.kconfig_out:
|
||||||
with open(args.kconfig_out, 'w', encoding="utf-8") as fp:
|
with open(args.kconfig_out, 'w', encoding="utf-8") as fp:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue