Skip to content

fix(iar): honor per-config <excluded> source files - #14

Open
MarkAtwood wants to merge 2 commits into
masterfrom
fix/iar-excluded-files
Open

fix(iar): honor per-config <excluded> source files#14
MarkAtwood wants to merge 2 commits into
masterfrom
fix/iar-excluded-files

Conversation

@MarkAtwood

Copy link
Copy Markdown

collect_sources walked every <file> via root.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 into selftest.yml. Independent of the other open review PRs (only selftest.yml overlaps, in a different region).

Addresses SBOM-gpex.9.

sameehj and others added 2 commits July 23, 2026 15:54
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.
Copilot AI review requested due to automatic review settings July 24, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
sameehj force-pushed the master branch 4 times, most recently from 3ab77f9 to 9bdf5b7 Compare July 24, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants