Add THIRD_PARTY_NOTICES.md and a generator for it - #111
Merged
Conversation
abrarshivani
force-pushed
the
third-party-notices
branch
from
August 11, 2026 01:09
573d441 to
ffbd3df
Compare
abrarshivani
marked this pull request as ready for review
August 11, 2026 03:13
abrarshivani
force-pushed
the
third-party-notices
branch
9 times, most recently
from
August 14, 2026 19:22
18b9739 to
49cb4c0
Compare
Signed-off-by: Abrar Shivani <ashivani@nvidia.com>
abrarshivani
force-pushed
the
third-party-notices
branch
from
August 14, 2026 19:48
49cb4c0 to
6698246
Compare
tariq1890
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
THIRD_PARTY_NOTICES.mdfor this module's third-party content, the scriptthat generates it, and a CI check that fails when deps change without the notices
being refreshed.
The same change is already merged in gpu-operator, mig-parted, k8s-device-plugin,
k8s-driver-manager and nvidia-container-toolkit.
The existing
NOTICEfile is unchanged.What to review
Hand-written:
hack/generate-third-party-notices.shhack/notices/licenses/BSD-3-Clause.txtMakefile.github/workflows/golang.ymlversions.mk.gitignoreGenerated:
THIRD_PARTY_NOTICES.md(394 lines).hack/is new. The pin lives inversions.mk, this repo's existing versionmechanism, since there is no
tools.goor tools module.How it works
make third-party-notices:./bin/go-licensesso the pinned version runsgo-licenses saveandcsvonce per platform, then mergevendor/modules.txtNOTICEmake check-third-party-noticesregenerates and diffs. It runs as a job ingolang.ymlon every build, with no changed-paths filter: the inventory is theimport closure of
./..., so it moves whenever an ordinary.gofile changesits imports, not only when
go.modorvendor/change.Implementation notes
./..., not./cmd/.... This is a library with nocmd/and nomain.go. Nothing releases a binary, so the module itself is the distributedartifact.
pkg/pciids/default_pci.idsis covered. This is the trap in this repo: abundled 1.5 MB third-party database that
go-licensescannot see.NOTICEalready attributes it, but a file named
THIRD_PARTY_NOTICES.mdis what acompliance process picks up, and an omission there is invisible precisely
because the document looks complete. Both files now carry it.
NOTICEis the single source of truth for that file. The election isstated there in prose and read back from there, so the two cannot drift apart.
A reworded
NOTICEfails the run rather than silently dropping an entry.a second place.
make update-pcidboverwrites that file wholesale, so ahand-maintained copy would keep asserting the old version's notice.
--ignoreis not used at all. It is a rawstrings.HasPrefixmatch on thepackage path, not a path-segment match, and an ignored package is dropped
silently with a zero exit.
--ignore=gowould takegolang.org/x/*with it,and
--ignore=github.com/NVIDIA/go-nvlibwould also swallow a real dependencypublished as
go-nvlib-extra/.... This repo's own packages are dropped in aseparate pass that compares whole path segments.
LC_ALL=Con every sort and grep.Whole-line
sort -urather thansort -t, -k1,1 -u. The awk counts instead ofusing
in, which mawk and BSD awk disagree on.grep -aso a NUL byte cannotchange the fence width.
mv, notcp, so an interrupted run cannot leave ahalf-written file.
Scope
Three third-party modules are linked:
go-nvml,google/uuidandgolang.org/x/sys. One bundled non-Go file:default_pci.ids.The header states the boundary in three parts: Go module dependencies, bundled
non-Go files, and what is excluded (the Go standard library, and NVIDIA's own
code under
LICENSE).testify,go-spew,go-difflibandyaml.v3are vendored for tests and arecorrectly absent, with no filter needed.
Guards: a
NOTICEthat describes no bundled files is fatal, an entry whose fileis missing is fatal, and a declared SPDX id with no license text is fatal, since
an identifier on its own is not a notice.
Shipping
Committed to the repo.
NOTICEis byte-for-byte unchanged and remains part ofthe distribution.
Testing
9682e099…,matching the committed file.
golang:1.25.6-bookworm, the Go versionversions.mkpins, on both linux/amd64 and linux/arm64./usr/bin/awkismawk there, so the license join is exercised on the awk that breaks the naive
form, against BWK awk on macOS.
go list -deps ./...over all four platforms in thematrix: 4 linked third-party packages, 3 index rows, 0 uncovered, 0 unused.
blocks, 0
Unknown, 0 missing text, 0 unresolved module paths. A row with nolicense text is fatal rather than rendered as unavailable, since every dep here
is vendored.
BWK awk with identical output: a package carrying two licenses joins as
BSD-3-Clause / MPL-2.0with no leading separator and duplicates collapsed, a=>replace resolves to the replacement's module path, a replace pointing at alocal path exits 1, and the local-module filter keeps a
go-nvlib-extrasibling while dropping
go-nvlib/pkg/....NOTICE, aNOTICEwhose prose cannot be parsed, aNOTICEelecting a license this generator does not know, aNOTICEnaming afile that does not exist, an elected SPDX id whose text is absent, a missing
vendor/modules.txt, a modules.txt with no module lines, and an absent orwrong-architecture
go-licenses. Each exits non-zero with a clear message,leaves the committed file untouched, and writes no partial file.
bin/,make third-party-noticesinstalls the pinnedgo-licensesand produces theidentical document. With a macOS binary planted in
bin/and the generator rununder linux/amd64, it fails with that guidance rather than an exec error.
shellcheckclean.actionlintreports nothing on the new job thatit does not already report identically on the three existing ones.
make buildand
make testpass in the container.