Skip to content

chore: close the two remaining license-review items, and guard headers in CI - #853

Merged
nihalpasham merged 2 commits into
mainfrom
fix/osrb-spdx-and-notices
Aug 13, 2026
Merged

nihalpasham merged 2 commits into
mainfrom
fix/osrb-spdx-and-notices

Conversation

@nihalpasham

Copy link
Copy Markdown
Collaborator

The open-source license review re-checked main at 15fa9d9 and confirmed everything from #812 fixed, leaving two items. Both are addressed here, plus the CI guard the review suggested. Licensing metadata and CI only; no logic, API, or behavior changes.

The two remaining items

  1. Source headers: scripts/check-book-api-names.sh and scripts/check-reserved-prefixes.sh landed after chore: fix Apache-2.0 license notice and attribution gaps #812 merged (ci: guard the device-API names the book shows in Rust blocks #819, ci: move the reserved-prefix guard into a script #835) without the standard SPDX header. Both now carry it.

  2. Third-party notices: the rangemap sub-crate embedded under crates/fuzzer/rustlantis/ carries its own LICENSE-APACHE and LICENSE-MIT copies, which THIRD_PARTY_NOTICES did not mention. The Rustlantis entry now names that path. Both copies are byte-identical to the rustlantis top-level texts (verified with diff).

The guard

Headers have now drifted twice (the 32 files #812 fixed, then the two scripts above), so this adds scripts/check-spdx-headers.sh in the existing check-*.sh style:

  • Requires the two-line SPDX header within the first 15 lines of every tracked *.rs *.sh *.py *.cu *.c *.h *.ll file: 1789 files in scope, measured header depth never exceeds line 4.
  • Excludes crates/fuzzer/rustlantis/** (embedded third-party code keeps its upstream form; adding an NVIDIA copyright line to code we do not own would be wrong).
  • Carries a checked exemption for the two CUTLASS-derived BSD-3-Clause benchmark helpers the review accepted as-is: each entry must exist and must still carry its BSD-3-Clause identifier, so a rename or relicense fails the run instead of quietly exempting nothing.
  • Self-test canary in the house style: the run fails if the patterns stop separating a compliant header from a missing one.
  • Runs as a fourth job of the cargo-deny workflow (pure text check, no toolchain, ~3s) and from just check-guards; CONTRIBUTING's License Headers section now points at it.

Validation

  • bash scripts/check-spdx-headers.sh passes on this branch.
  • Stripping a header makes it fail naming the file; breaking either exemption invariant (missing file, missing BSD identifier) fails with a targeted message.
  • check-book-api-names.sh and check-reserved-prefixes.sh still pass after the header insertion.
  • Workflow YAML validated with yaml.safe_load.

…s in CI

The open-source review of commit 15fa9d9 confirmed everything from #812
fixed and left two items, both addressed here:

1. Source headers: scripts/check-book-api-names.sh and
   scripts/check-reserved-prefixes.sh landed after #812 merged (#819,
   #835) without the standard SPDX header. Both now carry it.

2. Third-party notices: the rangemap sub-crate under
   crates/fuzzer/rustlantis/ carries its own LICENSE-APACHE and
   LICENSE-MIT copies, which THIRD_PARTY_NOTICES did not mention. The
   Rustlantis entry now names that path; both texts are byte-identical
   to the rustlantis top-level ones.

The review also suggested a CI guard, since headers have now drifted
twice. scripts/check-spdx-headers.sh requires the two-line header on
every tracked *.rs *.sh *.py *.cu *.c *.h *.ll file outside the
vendored rustlantis subtree, with a checked exemption for the two
CUTLASS-derived BSD-3-Clause helpers the review accepted as-is. It runs
as a fourth job of the cargo-deny workflow and from 'just check-guards',
and CONTRIBUTING's License Headers section points at it.

Signed-off-by: nihalpasham <[email protected]>
@nihalpasham nihalpasham added build-related Build scripts, toolchain discovery, or compilation setup QoL-improvement Quality-of-life improvement; not a correctness fix labels Aug 13, 2026
…ices

# Conflicts:
#	scripts/check-book-api-names.sh
@nihalpasham
nihalpasham merged commit 9ed907b into main Aug 13, 2026
44 checks passed
@nihalpasham
nihalpasham deleted the fix/osrb-spdx-and-notices branch September 5, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-related Build scripts, toolchain discovery, or compilation setup QoL-improvement Quality-of-life improvement; not a correctness fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant