Skip to content

fix(sbom): don't tie the copyright start bound to SOURCE_DATE_EPOCH - #61

Merged
sameehj merged 1 commit into
masterfrom
fix/copyright-start-before-build-year
Nov 24, 2026
Merged

sameehj merged 1 commit into
masterfrom
fix/copyright-start-before-build-year

Conversation

@Frauschi

Copy link
Copy Markdown
Member

gen-sbom exits with an error when SOURCE_DATE_EPOCH is before the copyright start year (Nix's 1980 default, or a pinned 0), even with the default start of 2006, so products vendoring the toolkit fail make sbom / the CMake sbom target there.

Changes

  • Bound --copyright-start by the later of the build year and the current year, not the build year alone
  • Write the start year alone when the build year is earlier than the start
  • Describe that form in the --copyright-start help and share/README.md

Testing

  • TestCopyrightStart: copyright line for a build year before the start; with a 1980 SOURCE_DATE_EPOCH, no flag, 2006 and 2025 produce an SBOM; the bound is checked at the current year and at a future build year

gen-sbom required 1000 <= --copyright-start <= build year, and the
build year comes from SOURCE_DATE_EPOCH. Reproducible-build setups pin
that to a placeholder before 2006 (Nix stdenv's 315532800 is 1980, some
use 0), so every SBOM run failed there, even with the default start of
2006. Before --copyright-start existed those builds wrote an SBOM.

The upper bound is now the latest of the build year, the current year
and the default start. It still catches a mistyped future year, any
real start year works whatever the epoch, and the default passes even
on a host whose clock is also before 2006. Checking against the clock
does not affect the output, which still depends only on
SOURCE_DATE_EPOCH.

When the build year is earlier than the start, the copyright line
carries the start year alone ("Copyright (C) 2006 wolfSSL Inc.")
rather than a reversed range or a start clamped to the placeholder
year. The help text and share/README.md describe that form.
Copilot AI balanced review requested due to automatic review settings November 24, 2026 10:44
@Frauschi Frauschi self-assigned this Nov 24, 2026

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 block the SBOM copyright-year handling changes.

No open issues 🎉

What changed in this PR

Fixes SBOM generation when SOURCE_DATE_EPOCH predates the copyright start year, while leaving creation timestamps unchanged.

Changes:

  • Allows copyright start years up to the later of the build year and current year.
  • Emits only the start year when the build year is not later.
  • Documents the behavior and adds regression tests for old epochs and validation boundaries.
File Description
tests/​test_gen_sbom.py Tests copyright output with old epochs and current/future year bounds.
share/​README.md Documents copyright formatting and the revised upper bound.
share/​gen-sbom Updates copyright validation, rendering, and CLI help.

Review effort: Balanced

@Frauschi

Copy link
Copy Markdown
Member Author

@claude review

@claude claude Bot 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.

Code review found no issues

No high-confidence issues detected in this change.

@Frauschi Frauschi assigned sameehj and unassigned Frauschi Nov 24, 2026
@Frauschi
Frauschi requested a review from sameehj November 24, 2026 10:53
@sameehj
sameehj merged commit f5385c8 into master Nov 24, 2026
7 checks passed
@Frauschi
Frauschi deleted the fix/copyright-start-before-build-year branch November 24, 2026 11:19
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