Should exit with an explanitory error if product for splitting rule is undeclared
Closed this issue · 1 comments
In the master build-essential stratum here:
http://git.baserock.org/cgit/baserock/baserock/definitions.git/tree/strata/build-essential.morph#n44
A 'product' is defined for build-essential-minimal
Later in the glibc chunk it is referred to:
http://git.baserock.org/cgit/baserock/baserock/definitions.git/tree/strata/build-essential.morph#n263
However, it also refers to other names, like build-essential-runtime, without having to declare that 'product', an unsuspecting definitions author will easily overlook this, and encounter a stack trace like the one below.
YBD should print an error explaining what the definitions author did wrong, I could submit a patch for this, but I dont fully understand why one has to define this 'product' and not the runtime one (so I would not know what the informative error message should be).
Stack trace:
Traceback (most recent call last):
File "/home/tristan/ABORIGINAL_LINUX/ybd/ybd/main.py", line 69, in
compose(defs, target)
File "/home/tristan/ABORIGINAL_LINUX/ybd/ybd/assembly.py", line 82, in compose
build(defs, component) # bring in 'build-depends', and run make
File "/home/tristan/ABORIGINAL_LINUX/ybd/ybd/assembly.py", line 112, in build
splitting.write_metadata(defs, component)
File "/home/tristan/ABORIGINAL_LINUX/ybd/ybd/splitting.py", line 121, in write_metadata
write_stratum_metafiles(defs, component)
File "/home/tristan/ABORIGINAL_LINUX/ybd/ybd/splitting.py", line 204, in write_stratum_metafiles
splits[target].append(artifact)
KeyError: 'build-essential-minimal'
Splitting-rules are no longer undeclared - we have default-splits