Add THIRD_PARTY_NOTICES.md and a generator for it - #387
Draft
abrarshivani wants to merge 1 commit into
Draft
Conversation
This project distributes third-party code from two places, and neither is inventoried today. The first is the C dependencies that mk/*.mk downloads and compiles into libnvidia-container: elftoolchain's libelf, libtirpc, and the modprobe-utils subset of nvidia-modprobe. The second is the Go modules vendored under src/nvcgo, which are linked into libnvidia-container-go.so. hack/generate-notices.sh covers both. For the C half it reads VERSION, PREFIX and URL out of the makefiles rather than carrying its own copy, fetches each pinned archive and quotes the terms from the archive itself, so the document cannot describe a version the build no longer uses. Where a project ships a license file it is quoted verbatim; where it does not, every distinct copyright comment in the files that are actually compiled or installed is collected. That distinction matters most for nvidia-modprobe: its top-level COPYING is GPL-2.0 and covers the nvidia-modprobe binaries, which this repository does not build, while the modprobe-utils sources linked in here are individually MIT-licensed and carry copyrights from IBM, Red Hat and others. For the Go half go-licenses runs once per released architecture and the results are merged, since the import graph is build-tag dependent. The generator is deterministic: two runs on macOS and one in a Linux container produce a byte-identical file. The existing NOTICE, LICENSE, COPYING and COPYING.LESSER are unchanged and remain authoritative for this project's own code and for the elfutils libelf case; the new file states that explicitly and is installed alongside them. go-licenses is pinned in a new deployments/devel/go.mod next to the Dockerfile that already pins the golang version, so dependabot can manage both. The new notices-check CI job runs on every build with no path filter, because the document also goes stale when src/nvcgo/vendor or a version in mk/*.mk changes. Signed-off-by: Abrar Shivani <ashivani@nvidia.com>
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.mdcovering both surfaces of this project, the scriptthat generates it, and a CI check that fails when deps change without the notices
being refreshed.
Same change already proposed for gpu-operator, mig-parted, k8s-device-plugin,
k8s-driver-manager and nvidia-container-toolkit. This repo is mostly C, so it
needed more than
go-licenses.NOTICE,LICENSE,COPYINGandCOPYING.LESSERare unchanged.What to review
70% of the diff is generated. Hand-written:
hack/generate-notices.shdeployments/devel/go.sumMakefile.github/workflows/build.yamldeployments/devel/go.moddeployments/devel/tools.goGenerated:
THIRD_PARTY_NOTICES.md(2385 lines).go-licensesis pinned indeployments/devel/, beside theDockerfilethatalready pins the golang version, so dependabot manages both.
How it works
make noticescovers two surfaces:Go, for the
src/nvcgosubcomponent.go-licenses saveandcsvperplatform against its vendored deps, licenses joined,
module@versionfromsrc/nvcgo/vendor/modules.txt.C, for the three build-time dependencies. Versions and URLs are parsed from
mk/elftoolchain.mk,mk/libtirpc.mkandmk/nvidia-modprobe.mk, each tarballis downloaded at generation time, and the terms are quoted from the archive. The
document's versions are the build's by construction, so they cannot drift.
make notices-checkregenerates and diffs, on every build, no path filter.Implementation notes
mk/common.mkcalls GNU-onlydate -u --iso-8601and errors on any arch outside x86_64/ppc64le/aarch64, soshelling out to
makewould make the generator unrunnable on a macOS host.Only
$(VERSION)and$(PREFIX)are expanded, and any surviving$(isfatal.
rule does not fit. libtirpc ships
COPYING, but it names only Bull S.A. whilethe sources carry around 37 further holders, so the per-file notices are
collected too. elftoolchain ships no
LICENSEorCOPYINGat all, so itsterms come entirely from file headers. Whole comment blocks are collected, not
just copyright lines, because BSD and MIT both require the conditions text to
travel with the notice.
COPYINGisGPL-2.0 and covers binaries this repo does not build:
mk/nvidia-modprobe.mkextracts only
modprobe-utils/and linkslibnvidia-modprobe-utils.a, andthose files are individually MIT. Quoting
COPYINGwould have declared GPL-2.0over code that is not GPL and is statically linked into a BSD-licensed library.
The linked subset is also not purely NVIDIA's: it carries IBM, Red Hat and
Zanoni/Vignatti notices, and
pci-sysfs.csays it is based on libpciaccess.pkg/rpm/SPECS/libnvidia-container.specalready notes the MIT headers.WITH_TIRPCandWITH_LIBELFare rendered as a table grepped from themakefiles, not described in prose, so it cannot rot. That grep surfaced a
third configuration worth knowing about: rhel8 links the system libtirpc via
-ltirpcwithout settingWITH_TIRPC.LC_ALL=Con every awk, not just sorts and greps.libtirpc-1.3.2'ssrc/epoll_sub.chas a Latin-1 comment that aborts macOS awk with a multibyteconversion failure. An
iconvgate on the composed document fails loudly if afuture dependency ships a legacy encoding.
mv, notcp, so an interrupted run cannot leave ahalf-written file.
Scope
Three C dependencies and five Go license roots.
The new file defers to the existing ones rather than replacing them.
LICENSEgoverns this project's own code.
NOTICE,COPYINGandCOPYING.LESSERremainauthoritative for the
WITH_LIBELF=yescase, where elfutils libelf is linkeddynamically under LGPL, and the new document names that configuration and points
at them.
Also out of scope and stated: other link-time system libraries such as
libcapand
libseccomp, host driver components, and build tooling that leaves no codein the artifacts.
THIRD_PARTY_NOTICES.mdis added toDOC_FILES, so it installs beside theexisting four and the rpm subpackages'
%licenseglob picks it up with no specchange.
Testing
golang:1.26.4all byte-identical,sha256
6798827d…. Nothing is cached between runs, so each re-downloads allthree tarballs.
go list -deps ./...over three platforms: 11expected, 11 present, 0 missing, 0 extra.
mk/*.mkfor all three, and bumping libtirpc to 1.3.3 inthe makefile makes
notices-checkfail. That test fetched 1.3.3 and re-quotedit, so it is end-to-end rather than a string comparison.
Unknown, 0 missing text, 0 unresolvedmodule@version, 8sections, fences balanced, valid UTF-8.
an unexpanded make variable, a drifted platform matrix, an unsafe
LICENSES_DIR, and absentgo-licenses. Each exits non-zero with a clearmessage and leaves the committed file untouched.
shellcheckclean.make -nconfirms the default goal is unchanged.Two things worth knowing.
make noticescannot run on macOS, sincemk/common.mkrejects arm64 at parse time, which predates this change; thescript itself runs there. And SourceForge is slow, so the elftoolchain fetch can
take several minutes. The repo's own
make depsalready pulls the same URLs, sothis is not new exposure, but CI runtime is worth watching.
Noticed, not fixed here
pkg/rpm/SPECS/libnvidia-container.specdeclaresGPL-2.0-onlyin itsLicense:field, which appears to come from nvidia-modprobe's top-level
COPYINGratherthan from anything actually linked, and
pkg/deb/copyrightdoes not mentionlibtirpc at all. Both look like gaps, but correcting a distro package's declared
license is a legal call rather than a scripting one.