Skip to content

fix(sbom): one timestamp for all routes, one gen-sbom --help, DESTDIR drive letter - #58

Merged
Frauschi merged 2 commits into
masterfrom
fix/driver-sde-help-destdir
Nov 19, 2026
Merged

Frauschi merged 2 commits into
masterfrom
fix/driver-sde-help-destdir

Conversation

@sameehj

@sameehj sameehj commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Three fixes from the review of wolfSSL/wolfBoot#964. These files are vendored, so the fixes belong here.

  • One timestamp for all routes. When SOURCE_DATE_EPOCH is not set, sbom-driver.py uses the last commit time of the checkout that tracks --root. The rule is the same as in sbom-with-sde.cmake and sbom.am: a tarball unpacked inside another checkout gets no value. Before, make sbom used the current time and the CMake target used the commit time, so one checkout got two timestamps and could get two copyright years.
  • One gen-sbom --help per run. The help text is cached, so the up to nine supported-flag checks start one interpreter, not nine.
  • DESTDIR with a Windows drive letter. On Windows, file(INSTALL) drops the drive letter before it adds DESTDIR. install-sbom.cmake and uninstall-sbom.cmake now use the same rule, so uninstall removes what install wrote. The file(MAKE_DIRECTORY) call is removed, because file(INSTALL) creates the directory.

Tests:

  • tests/test_low_findings.py: help read once; driver run with an unset, a set, and an untracked-root SOURCE_DATE_EPOCH.
  • tests/test_sbom_cmake_install.py: drive-letter install and uninstall. It runs only on Windows, and this CI has no Windows runner.

… drive letter

From the wolfSSL/wolfBoot#964 review.

- sbom-driver.py: when SOURCE_DATE_EPOCH is not set, use the last commit
  time of the checkout that tracks --root, with the rule of
  sbom-with-sde.cmake and sbom.am. Before, make sbom used the current
  time and the CMake target the commit time, so one checkout got two
  timestamps and could get two copyright years.
- sbom-driver.py: read gen-sbom --help once per run. Before, each
  supported-flag check started a new interpreter, up to nine per run.
- install-sbom.cmake, uninstall-sbom.cmake: on Windows, file(INSTALL)
  drops a drive letter before it adds DESTDIR. Both scripts now use the
  same path, so uninstall removes what install wrote. Remove the
  file(MAKE_DIRECTORY) call: file(INSTALL) creates the directory.
@sameehj
sameehj requested review from Frauschi and a balanced review from Copilot November 19, 2026 08:41

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.

🔵 Needs a closer look

The drive-letter DESTDIR install/uninstall changes still require native Windows validation, which this review could not perform because the regression test is Windows-only and CI has no Windows runner.

No open issues 🎉

What changed in this PR

This PR makes the shared SBOM tooling more consistent across build systems and fixes Windows staging paths for vendored consumers.

Changes:

  • Use the tracked checkout’s latest commit time when SOURCE_DATE_EPOCH is unset, with regression tests and documentation.
  • Cache gen-sbom --help so capability checks invoke it once per run.
  • Align Windows DESTDIR paths between install and uninstall, with Windows-only test coverage.
File Description
tests/​test_sbom_cmake_install.py Adds Windows drive-letter staging and uninstall coverage.
tests/​test_low_findings.py Tests help caching and timestamp selection.
share/​sbom-driver.py Caches generator help and supplies a Git-derived timestamp fallback.
share/​README.md Documents timestamp selection across build systems.
share/​build/​uninstall-sbom.cmake Removes the Windows drive prefix before prepending DESTDIR.
share/​build/​install-sbom.cmake Corrects the staged-path message and removes redundant directory creation.

Review effort: Balanced

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly small things; the Windows drive-letter test needs a fix before it can pass.

Comment thread tests/test_sbom_cmake_install.py Resolved
Comment thread share/sbom-driver.py Resolved
Comment thread share/sbom-driver.py Resolved
Comment thread tests/test_low_findings.py Resolved
- Read the commit time only when --root is passed, so a front end run
  from inside another checkout does not take that checkout's time.
- Discard the ls-files output. Only its status is used, and decoding
  every tracked path fails on a file name the locale cannot decode.
- Normalize DESTDIR with file(TO_CMAKE_PATH) in the install and uninstall
  scripts, so the status line uses the forward-slash path file(INSTALL)
  writes on Windows.
- Skip the git driver tests when git is not installed.

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Frauschi
Frauschi merged commit 2a2e04a into master Nov 19, 2026
5 checks passed
@Frauschi
Frauschi deleted the fix/driver-sde-help-destdir branch November 19, 2026 11:36
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