fix(iar): honor per-config <excluded> source files - #14
Open
MarkAtwood wants to merge 2 commits into
Open
Conversation
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
collect_sources walked every <file> via root.iter('file') and ignored
IAR's <excluded><configuration> markers, so for the selected build
configuration it listed files that config does not compile -- over-
reporting the artifact's source set. Drop a file whose <excluded> block
names the chosen configuration.
Adds tests/test_iar_sbom.py (a file excluded from the selected config is
dropped; one excluded from a different config is kept), wired into
selftest.yml.
There was a problem hiding this comment.
Pull request overview
This PR fixes the IAR .ewp source collection logic so SBOM generation reflects the selected build configuration by excluding <file> entries marked as <excluded> for that configuration, and adds CI-backed unit tests to prevent regressions.
Changes:
- Add per-configuration exclusion handling to
collect_sources()in the IAR SBOM frontend. - Add unit tests validating excluded-file behavior for multiple configurations.
- Wire the new test into the GitHub Actions self-test workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
share/frontends/iar_sbom.py |
Filters out sources excluded from the selected IAR configuration when collecting compiled source files. |
tests/test_iar_sbom.py |
Adds unit tests covering per-configuration <excluded> behavior in .ewp parsing. |
.github/workflows/selftest.yml |
Runs the new IAR frontend unit test in CI and includes it in syntax checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+67
to
+71
| excluded = file_el.find('excluded') | ||
| if excluded is None: | ||
| return False | ||
| return any((c.text or '').strip() == cfg_name | ||
| for c in excluded.findall('configuration')) |
sameehj
force-pushed
the
master
branch
4 times, most recently
from
July 24, 2026 14:09
3ab77f9 to
9bdf5b7
Compare
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.
collect_sourceswalked every<file>viaroot.iter('file')and never consulted IAR's<excluded><configuration>markers, so for the selected build configuration it listed files that config does not compile — over-reporting the artifact's source set (the opposite of an accurate SBOM). Now drops a file whose<excluded>block names the chosen configuration.New
tests/test_iar_sbom.py: a file excluded from the selected config is dropped, one excluded from a different config is kept (per-config correctness both ways). Wired intoselftest.yml. Independent of the other open review PRs (onlyselftest.ymloverlaps, in a different region).Addresses SBOM-gpex.9.