Skip to content

[no-ci] check_spdx.py: require explicit license decisions for top-level paths and related cleanup#1913

Merged
rwgk merged 4 commits intoNVIDIA:mainfrom
rwgk:expected_license_identifiers_cont
Apr 15, 2026
Merged

[no-ci] check_spdx.py: require explicit license decisions for top-level paths and related cleanup#1913
rwgk merged 4 commits intoNVIDIA:mainfrom
rwgk:expected_license_identifiers_cont

Conversation

@rwgk
Copy link
Copy Markdown
Collaborator

@rwgk rwgk commented Apr 15, 2026

Follow-on to PR #1897

Summary

  • Enforce an explicit SPDX license identifier for every top-level directory in the repository, so new paths can't slip in without a reviewed license decision.

  • Keep top-level files on an explicit default of Apache-2.0.

  • Continue to accommodate special cases, but treat them as exceptions we want to minimize rather than the default mechanism.

  • Update cuda_bindings/pixi.toml to LicenseRef-NVIDIA-SOFTWARE-LICENSE.

  • Fix the current non-benchmark special cases by updating

    • .coveragerc
    • cuda_python_test_helpers/cuda_python_test_helpers/nvvm_bitcode.py
    • toolshed/build_static_bitcode_input.py
    • toolshed/dump_cutile_b64.py

    to Apache-2.0.

  • Keep cuda_bindings/benchmarks/ as the only remaining special cases for now; those mixed-license cases will be handled in follow-on PRs (see comment below).

Technical details

  • Replace the old prefix-only SPDX policy handling in toolshed/check_spdx.py with explicit TOP_LEVEL_DIRS_LICENSE_IDENTIFIERS and SPECIAL_CASE_LICENSE_IDENTIFIERS mappings.
  • Normalize repo-relative paths before matching so the checker behaves consistently across platforms.
  • Make the checker fail when a file lives under a top-level directory that does not have an explicit expected license.
  • Apply special cases by exact path or glob pattern, with longest-match wins so narrower overrides can coexist with broader rules.
  • Improve license parsing by trimming common comment suffixes and decoding with replacement so malformed bytes still produce deterministic comparisons instead of being treated as missing headers.

@rwgk rwgk added this to the cuda.bindings next milestone Apr 15, 2026
@rwgk rwgk self-assigned this Apr 15, 2026
@rwgk rwgk added P1 Medium priority - Should do cuda.bindings Everything related to the cuda.bindings module cuda.pathfinder Everything related to the cuda.pathfinder module labels Apr 15, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 15, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@leofang leofang requested review from danielfrg and leofang April 15, 2026 02:12
@danielfrg
Copy link
Copy Markdown
Contributor

We agreed to move it the benchmarks to {repo}/benchmarks/{pkg} and that way we can keep the Apache license. I'll move them on my next PR for the benchmarks.

@rwgk rwgk changed the title [no-ci] Add cuda_bindings, cuda_pathfinder, cuda_python in check_spdx.py EXPECTED_LICENSE_IDENTIFIERS [no-ci] check_spdx.py: require explicit license decisions for top-level paths and related cleanup Apr 15, 2026
@rwgk rwgk marked this pull request as ready for review April 15, 2026 17:05
@rwgk rwgk requested a review from mdboom April 15, 2026 17:07
@rwgk rwgk merged commit a8805e5 into NVIDIA:main Apr 15, 2026
23 checks passed
@rwgk rwgk deleted the expected_license_identifiers_cont branch April 15, 2026 17:27
@github-actions
Copy link
Copy Markdown

Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module cuda.pathfinder Everything related to the cuda.pathfinder module P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants