Skip to content

fix(iar): honor <excluded> for the selected config - #14

Open
MarkAtwood wants to merge 1 commit into
masterfrom
fix/iar-excluded-files
Open

MarkAtwood wants to merge 1 commit into
masterfrom
fix/iar-excluded-files

Conversation

@MarkAtwood

@MarkAtwood MarkAtwood commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

This walks groups recursively, skips groups excluded for the selected configuration, and drops individually excluded files.

tests/test_iar_sbom.py covers 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 into selftest.yml.

On the STSAFE Benchmark project in wolfssl-examples, the ST-SAFE_Benchmark config drops from 101 to 92 listed sources: the excluded wolfSSL group (internal.c, ssl.c, tls.c, tls13.c, ...) no longer shows up.

Copilot AI review requested due to automatic review settings July 24, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 thread share/frontends/iar_sbom.py Outdated
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
@MarkAtwood
MarkAtwood force-pushed the fix/iar-excluded-files branch from eb96aeb to 1a30227 Compare August 13, 2026 01:15
@MarkAtwood
MarkAtwood force-pushed the fix/iar-excluded-files branch from 1a30227 to 0e132ab Compare September 29, 2026 01:06
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
MarkAtwood force-pushed the fix/iar-excluded-files branch from f31ec4a to 33613c8 Compare October 1, 2026 20:54
@MarkAtwood MarkAtwood changed the title fix(iar): honor per-config <excluded> source files fix(iar): honor <excluded> for the selected config Oct 1, 2026
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.

2 participants