Repository navigation
Third-party notices for ported code, in source and in what we ship - #337
Merged
Merged
Conversation
shipThird-party notices for ported code and linked crates, in source and in what we ship
Psy-Fer
enabled auto-merge (squash)
October 22, 2026 09:53
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.
Third-party notices for ported code, in source and in what we ship
An audit of third-party code in the tree found two ports with incomplete licence notices (DegNorm,
sgt.h) and one reimplementation that should credit its source (libc++). All three licences are permissive and compatible with MIT; this adds the notices.src/degnorm/degnorm/nmf.py,__main__.pydegnorm/mod.rs, not inLICENSES/src/solo/sgt.rssgt.h, as vendored by STARsrc/solo/libcxx_rng.rsmt19937,generate_canonical,discrete_distributionInventory
Every third-party source the tree ports or credits: STAR and STAR-rs (already in
LICENSES/), DegNorm,sgt.h, and libc++. Checked against STAR's own bundled third-party code (htslib,bam_cat.c, Opal, SimpleGoodTuring): onlysgt.hwas ported. Opal is used through hyalite, a separate crate, and the test oracle builds against STAR's copy.Changes
LICENSES/gainsDEGNORM_LICENSE,SGT_LICENSEandLIBCXX_LICENSE, each the upstream text verbatim:setup.pysays MIT;source/SimpleGoodTuring/sgt.h;libcxx/LICENSE.TXT.LICENSES/README.mdsays which files each one covers.src/solo/sgt.rscarries Elworthy's full notice, conditions and disclaimer. The BSD licence requires it in source copies; a pointer toLICENSES/isn't enough. Its header also corrects "Gadsby & Sampson" to Sampson and Gale, as the original says.src/solo/libcxx_rng.rsnames libc++ and its licence. The file reproduces libc++'s behaviour: the standard Mersenne Twister, plus about 20 lines each matching how libc++'sgenerate_canonicalanddiscrete_distributionconsume it, checked against libc++ as a black box. The notice is there for attribution. LLVM ships noNOTICEfile, so Apache 2.0 §4(d) has nothing more to pass on.Sampson's original code: Elworthy's
sgt.hadapts Geoffrey Sampson's Simple Good-Turing program. Sampson issued it for any use, with acknowledgment welcome but not required;LICENSES/README.mdacknowledges him.README.md's License section now points toLICENSES/for the third-party terms.tests/data/cr4_opal_oracle.cppcredited Opal to Alexander Dobin. STAR's copy says MIT, © 2014 Martin Šošić. The oracle only links it at build time and doesn't copy it, so this corrects the credit line.Binary distributions now carry the notices. MIT, BSD and Apache all require them there too, and until now STAR's MIT notice was missing from them as well.
README.mdandLICENSE; they now also includeLICENSES/..dockerignoreexcludedLICENSE. It now shipsLICENSEandLICENSES/in/usr/share/doc/rustar-aligner/. A test build confirmed all six notice files reach the image.LICENSES/, and still does (cargo package --list).Cargo.toml:licenseis nowMIT AND BSD-2-Clause, the accurate SPDX expression, sincesgt.rsis a port of BSD 2-clause code. libc++ isn't added: no libc++ code is copied.cargo packageaccepts the expression.Notices of linked crates:
THIRD_PARTY_LICENSES.mdThe binaries statically link 88 crates, and almost all their licences require the notice in binary copies. Nothing shipped them until now.
scripts/third-party-licenses.shgeneratesTHIRD_PARTY_LICENSES.mdwithcargo-about0.9.2. It downloads the prebuilt musl binary (x86_64 or aarch64), pinned by SHA-256 (checked against the published checksums), and runs it withabout.tomlandabout.hbs.about.tomlaccepts only permissive licences: MIT, Apache-2.0 (with or without the LLVM exception), BSD-2/3-Clause, ISC, Unicode-3.0, Unicode-DFS-2016, Unlicense and Zlib. A dependency under anything else fails generation (tested by removing Zlib from the list).Licence files cargo-about misses are "clarified" in
about.toml, each pinned by checksum:COPYINGinlibdeflate-sys(the C library it compiles in);regex-syntax's Unicode data licence;LICENSEand Elworthy's notice. Without that, cargo-about wrote a placeholder BSD text, "Copyright (c) ".mimalloc's Microsoft notice is found without help.
Gate on silent drops: on a checksum mismatch, cargo-about only warns, drops the clarification, and exits 0. The libdeflate notice simply vanished in a test. A clean run logs nothing, so the script fails on any warning and deletes the incomplete file (tested).
Coverage: every one of the 88 crates linked on Linux is in the file, plus the Windows/macOS-only crates, since one file serves every platform.
Where it runs:
third-party-licensesjob generates the file once; each platform build downloads it into its archive./usr/share/doc/rustar-aligner/. A full local image build confirmedLICENSE,LICENSES/andTHIRD_PARTY_LICENSES.mdare there, and the binary runs.licensesjob runs the same script and is required by "Checks pass", so a bad licence fails the pull request that brings it in, not the release.Repo: the generated file is gitignored; nothing to keep in sync by hand.
No code changes; 800 tests, clippy and fmt clean.