Skip to content

Commit 15711cc

Browse files
authored
ncs: prevent duplicate target names (#119)
suit-generator now prints an error when the build has two images with the same CONFIG_SUIT_ENVELOPE_TARGET. Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
1 parent 72e873d commit 15711cc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ncs/build.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def read_configurations(configurations):
4040
# add prefix _ to the names starting with digits, for example:
4141
# 802154_rpmsg_subimage will be available in the templates as _802154_rpmsg_subimage
4242
image_name = f"_{name}" if re.match("^[0-9].*]", name) else name
43+
44+
if image_name in data:
45+
existing_binary = data[image_name]["binary"]
46+
raise ValueError("Two images have the same CONFIG_SUIT_ENVELOPE_TARGET value: "
47+
f"{binary} and {existing_binary}")
48+
4349
data[image_name] = {
4450
"name": name,
4551
"config": BuildConfiguration(kconfig),

0 commit comments

Comments
 (0)