fix: ic_bundle list arguments - #11
Merged
Merged
Conversation
EXTRA_FILES and EXTRA_POSTFIXES are documented as lists but were declared in the
one_value_keywords slot, so the docstring's own EXTRA_POSTFIXES example failed:
CMake Error at src/ic_bundle.cmake:80 (message):
Unparsed arguments: -app-signed.hex;-app-update-s-e.gbl
They move to multi_value_keywords. The previous workaround -- quoting a
semicolon-joined string -- keeps working, since the foreach still expands it.
EXTRA_FILES was also never read after set_default(), so passing it bundled
nothing at all. It now copies each path into the bundle as
"${FULL_NAME}_<file name>". Naming rather than preserving the source name keeps
every file in the bundle identifiable once it is pulled back out of the zip,
which is the reason the other artifacts are renamed; the docstring now says so
explicitly, since the argument takes arbitrary paths and the destination was
previously unspecified.
Both are exercised by a new test project rather than by extending the existing
one, because ic_bundle() creates a target literally named `bundle` and so cannot
be called twice within one CMake project. Reverting src/ic_bundle.cmake alone
fails 8 of the 9 new asserts, so the test covers the defect rather than the fix.
Found while bundling signed MCUboot artifacts from a Zephyr sysbuild project,
where the application image emits zephyr.signed.bin and zephyr.signed.hex beside
its unsigned output and the bootloader hex comes from a sibling build domain.
Co-Authored-By: claude-opus-5[1m] <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10.
ic_bundle()'s two list arguments now behave as documented.EXTRA_POSTFIXESEXTRA_FILESBoth were in the
one_value_keywordsslot:The existing workaround — quoting a semicolon-joined string — still works, since the
foreachexpands it either way.One decision worth confirming
EXTRA_FILEShad no specified destination name, so this copies each file as${FULL_NAME}_<file name>:Renaming rather than preserving
zephyr.hexfollows what the rest of the function does, and it keeps files identifiable once they are pulled out of the zip — which is what a release job does. Easy to change to a bare basename if you'd rather; the docstring now states whichever it is.Tests
A new
tests/test_ic_bundle_extra_args/project rather than an extension of the existing one, becauseic_bundle()creates a target literally namedbundleand so cannot be called twice inside one CMake project. (Not fixed here — it is a separate concern from #10.)The test covers the defect, not just the fix. Reverting
src/ic_bundle.cmakealone:and with the fix applied:
How this came up
Bundling signed MCUboot artifacts from a Zephyr sysbuild project: the application image emits
zephyr.signed.binandzephyr.signed.hexbeside its unsigned output, and the bootloader hex comes from a sibling build domain.EXTRA_POSTFIXESis the right tool for the first pair andEXTRA_FILESfor the second — the first needed the quoting workaround and the second could not be used at all.Warning
LLM Disclosure
This post was authored by claude-opus-5[1m] on behalf of @JPHutchins. I hit both problems while bundling signed MCUboot artifacts in one of her Zephyr projects, and she asked me to fix them upstream.