Skip to content

fix(frontends): handle other drives, compiler launchers and app-target modules - #54

Merged
dgarske merged 1 commit into
masterfrom
fix/frontends-copilot-wolftpm-658
Nov 4, 2026
Merged

dgarske merged 1 commit into
masterfrom
fix/frontends-copilot-wolftpm-658

Conversation

@sameehj

@sameehj sameehj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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.

  • compdb, Windows drives. os.path.commonpath() raises ValueError when a source and --root are on two drives. The frontend stopped with a traceback. Now it treats that source as outside --root and skips it, as included_sources._scan() already does.
  • zephyr, compiler launchers. With ccache arm-zephyr-eabi-gcc ..., the settings capture ran ccache -dM -E .... Now the frontend strips ccache, sccache, distcc and icecc with the _compiler_index() helper from included_sources.py.
  • zephyr, app-target modules. wolfTPM adds its sources with target_sources(app PRIVATE ...). Its objects are under CMakeFiles/app.dir/, not modules/<name>/, so the frontend found no sources. The new --target app option takes the objects of that target under --root. The default selection does not change.

Tests

  • New tests for each fix in tests/test_compdb_sbom.py and tests/test_zephyr_sbom.py. All four new tests fail on master and 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_sync and tests/test_sbom.py pass locally.

…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.
Copilot AI balanced review requested due to automatic review settings November 3, 2026 08:17

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.

🟢 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 --target selection 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
dgarske merged commit ee2719b into master Nov 4, 2026
4 checks passed
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