fix(iar): honor <excluded> for the selected config - #14
Open
MarkAtwood wants to merge 1 commit into
Open
MarkAtwood wants to merge 1 commit into
MarkAtwood wants to merge 1 commit into
Conversation
Contributor
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
MarkAtwood
force-pushed
the
fix/iar-excluded-files
branch
from
August 13, 2026 01:15
eb96aeb to
1a30227
Compare
MarkAtwood
force-pushed
the
fix/iar-excluded-files
branch
from
September 29, 2026 01:06
1a30227 to
0e132ab
Compare
collect_sources walks every <file> and ignores IAR's <excluded><configuration> markers, so the SBOM lists sources the selected configuration does not compile. An <excluded> block can sit on a single file or on a group, where it covers every file in the group and its nested subgroups. Walk groups recursively, skip groups excluded for the selected configuration, and drop individually excluded files. Adds tests/test_iar_sbom.py, wired into selftest.yml.
MarkAtwood
force-pushed
the
fix/iar-excluded-files
branch
from
October 1, 2026 20:54
f31ec4a to
33613c8
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_sourceswalks every<file>and ignores IAR's<excluded><configuration>markers, so the SBOM lists sources the selected configuration does not compile. An<excluded>block can sit on a single file or on a group, where it covers every file in the group and its nested subgroups.This walks groups recursively, skips groups excluded for the selected configuration, and drops individually excluded files.
tests/test_iar_sbom.pycovers a file excluded for the selected config, one excluded for a different config, a nested group excluded for the selected config, the same group kept for another config, and one<excluded>naming two configurations. Wired intoselftest.yml.On the STSAFE Benchmark project in wolfssl-examples, the
ST-SAFE_Benchmarkconfig drops from 101 to 92 listed sources: the excludedwolfSSLgroup (internal.c,ssl.c,tls.c,tls13.c, ...) no longer shows up.