Skip to content

Generate complete third-party notices for all targets - #536

Merged
Anton-4 merged 1 commit into
roc-lang:mainfrom
Anton-4-bot:third-party-notices
Oct 23, 2026
Merged

Anton-4 merged 1 commit into
roc-lang:mainfrom
Anton-4-bot:third-party-notices

Conversation

@Anton-4-bot

Copy link
Copy Markdown
Contributor

Closes #446

THIRD_PARTY_LICENSES.md listed only a hand-picked subset of crates, so the macOS and Linux bundles shipped tokio, hyper, rustls, ring, SQLite and about 60 other statically linked crates without their notices.

Changes

  • scripts/third_party_notices.py regenerates everything below a marker in THIRD_PARTY_LICENSES.md. The hand-written Windows MSVC section above it is unchanged.

    • Runs cargo metadata --filter-platform for all 5 Roc targets and follows normal dependencies only (no build or dev dependencies). That gives 86 crates, with the targets that link each one.
    • Copies every license file in each crate's source, deduplicated, plus copyright comments from the tops of source files. The Windows producer does the same.
    • Fails if a license expression is outside the reviewed PERMISSIVE_LICENSES set (LLVM-exception is also allowed), or if a crate has no license file.
    • --check regenerates in memory and fails with a diff when the committed file is stale. It runs in ci.yml (validate) and in the release build before bundling.
  • Prebuilt native inputs. Each one is traced by hash to an upstream package and recorded in licenses/native-inputs.json with its full upstream license text:

    • x64musl libc.a and crt1.o: Alpine 3.18 musl-dev 1.2.4-r3
    • arm64musl libc.a and crt1.o: Debian 11 musl-dev 1.2.2-1
    • libunwind.a (both arches): Rust 1.87.0 self-contained musl runtime (rust-lang/llvm-project acaea3d, LLVM 20.1.1)

    The check fails if any of these files changes, or if an unrecorded file appears in a macOS or Linux target directory.

  • Rust standard library: the notices point to targets/x64win/licenses/rust/COPYRIGHT-library.html, which the bundle already ships (checked in 0.26.0). It covers every target.

  • Windows SDK: Supply redistributable MSVC startup and runtime inputs #512 already handled this. No SDK or CRT archives are copied anymore.

  • roc-lang/http: this package is not redistributed in the bundle. Roc downloads it from its own release.

  • Docs and tests: CONTRIBUTING.md documents the regeneration procedure. scripts/test_third_party_notices.py has unit tests for the generator.

Review notes

  • Over-inclusion is deliberate. Every offered license of dual-licensed crates is included, and so are proc-macro crates and nested license files. The generated file is about 238 KB.
  • I used a stdlib-only script instead of cargo-about. It needs no new tooling in CI and reuses the reviewed license set the Windows producer already uses.
  • The issue asks for maintainer or legal review of the result. This PR does not replace that review.

Pull request authored by Claude Opus 5.5.

🤖 Generated with Claude Code

THIRD_PARTY_LICENSES.md only listed a hand-picked subset of crates, so
the macOS and Linux bundles shipped tokio, hyper, rustls, ring, SQLite
and ~60 other statically linked crates without their notices.

scripts/third_party_notices.py now regenerates everything after a marker
from `cargo metadata` for every Roc target: each linked package's
original license files plus its source-header copyright comments, the
Rust standard library notice location, and the prebuilt musl/libunwind
inputs. Those binaries are now recorded in licenses/native-inputs.json
with verified origins (Alpine 3.18 musl-dev 1.2.4-r3, Debian 11
musl-dev 1.2.2-1, Rust 1.87.0 self-contained libunwind) and full
upstream license texts. CI and the release workflow run `--check`.

Closes roc-lang#446

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Anton-4
Anton-4 merged commit c8ce0b5 into roc-lang:main Oct 23, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate complete third-party license notices

2 participants