Repository navigation
fix(frontends): handle other drives, compiler launchers and app-target modules - #54
Merged
Merged
Conversation
…t modules Copilot found these on wolfSSL/wolfTPM#658, in the vendored copies. - compdb: on Windows, commonpath() raises ValueError for a source and a --root on two drives. Treat that source as outside --root, as included_sources already does. - zephyr: strip ccache, sccache, distcc and icecc from the compile command, so the settings capture runs the real compiler. - zephyr: add --target. A module that calls target_sources(app ...), as wolfTPM does, has no modules/<name>/ object directory, so the default selection found no sources. --target app takes the objects of that target under --root. The default does not change.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the SBOM frontend edge-case fixes and target-selection support.
No open issues 🎉
What changed in this PR
This PR fixes three edge cases in the shared SBOM frontends ahead of re-vendoring into wolfTPM, while preserving default Zephyr module selection.
Changes:
- Skip sources on other Windows drives with an outside-root warning instead of raising an exception.
- Strip supported compiler launchers before capturing Zephyr settings.
- Add
--targetselection for app-target module sources, with regression tests and usage documentation.
| File | Description |
|---|---|
tests/test_zephyr_sbom.py |
Tests target selection, missing target entries, and compiler launcher handling. |
tests/test_compdb_sbom.py |
Tests warning and skipping when paths are on different drives. |
share/README.md |
Documents --target app for app-target modules. |
share/frontends/zephyr_sbom.py |
Adds target selection and reuses compiler launcher detection. |
share/frontends/compdb_sbom.py |
Handles cross-drive errors during root filtering. |
Review effort: Balanced
dgarske
approved these changes
Nov 4, 2026
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.
Copilot found these three problems on wolfSSL/wolfTPM#658, in the vendored copies of the frontends. The fixes go here first, so the wolfTPM drift check stays clean after the re-vendor.
os.path.commonpath()raisesValueErrorwhen a source and--rootare on two drives. The frontend stopped with a traceback. Now it treats that source as outside--rootand skips it, asincluded_sources._scan()already does.ccache arm-zephyr-eabi-gcc ..., the settings capture ranccache -dM -E .... Now the frontend stripsccache,sccache,distccandiceccwith the_compiler_index()helper fromincluded_sources.py.target_sources(app PRIVATE ...). Its objects are underCMakeFiles/app.dir/, notmodules/<name>/, so the frontend found no sources. The new--target appoption takes the objects of that target under--root. The default selection does not change.Tests
tests/test_compdb_sbom.pyandtests/test_zephyr_sbom.py. All four new tests fail onmasterand pass on this branch.test_compdb_sbom,test_zephyr_sbom,test_included_sources,test_iar_sbom,test_sbom_mk,test_sbom_cmake_install,test_wolfssl_compliance_tooling_syncandtests/test_sbom.pypass locally.