Skip to content

[boring] Pin NASM and the macOS cross-toolchain, and attest in a separate job - #2899

Open
mosuem wants to merge 3 commits into
mainfrom
boring-ci-hardening
Open

mosuem wants to merge 3 commits into
mainfrom
boring-ci-hardening

Conversation

@mosuem

@mosuem mosuem commented Nov 18, 2026

Copy link
Copy Markdown
Member

Note

This PR was generated by an AI coding agent (Jetski) on behalf of @mosuem.

Supply-chain hardening for package:boring's CI. None of it depends on how the prebuilt libraries are distributed. This is the first PR in a stack; #2866 (bundling the libraries in the published package) builds on it.

  • NASM: replaces ilammy/setup-nasm, which downloads NASM from a mutable branch of its repository without checking the download, with a local composite action, .github/actions/setup-nasm. It downloads NASM 2.16.01 directly from nasm.us and verifies a pinned SHA-256 (matching Scoop's manifest). It's used in boring.yaml and in boring_binaries.yaml, which builds the released Windows libraries.
  • macOS Linux cross-toolchain: replaces the unpinnable brew install messense/macos-cross-toolchains/... tap in the test job of boring.yaml with a direct download of the v15.2.0 release tarball (arm64/x86_64) and a SHA-256 check, like the Windows cross-toolchain.
  • precompile permissions: precompile runs compilers and other build tools, so it no longer gets id-token: write / attestations: write. A new attest job, which only downloads the binaries-* artifacts, attests their provenance before release uploads them. gh attestation verify <file> --repo dart-lang/tools keeps working.

…rate job

- ilammy/setup-nasm downloads NASM from a mutable branch of its repository,
  and only then from nasm.us, without checking the download, so its pinned
  commit doesn't pin the NASM that assembles the released Windows libraries.
  A local composite action, .github/actions/setup-nasm, downloads NASM
  2.16.01 from nasm.us instead and checks it against a pinned SHA-256.
- The `test` job of boring.yaml installed the macOS Linux cross-toolchain
  from a Homebrew tap, which can't be pinned. It now downloads the v15.2.0
  release tarball and checks its SHA-256, like the Windows cross-toolchain.
- The `precompile` job had `id-token: write` and `attestations: write` to
  attest the libraries, so every step in it, including compilers and
  third-party actions, could mint OIDC tokens. A new `attest` job downloads
  the libraries and attests them, and `precompile` only gets
  `contents: read`.
@mosuem
mosuem requested a review from a team as a code owner November 18, 2026 09:25
@github-actions github-actions Bot added the type-infra A repository infrastructure change or enhancement label Nov 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new GitHub Action to set up NASM on Windows by downloading it, verifying its SHA-256 checksum, and adding it to the path. A review comment suggests passing the file path directly to sha256sum instead of using stdin redirection (<) to prevent potential CRLF translation issues on Windows.

Comment thread .github/actions/setup-nasm/action.yml Resolved
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Health

Publish ✔️
Package Version Status Publish tag (post-merge)
package:boring 0.5.0 ready to publish boring-v0.5.0
  • 16 already published.
  • 26 WIP (no publish necessary).

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

This check can be disabled by tagging the PR with skip-publish-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check (for example, for non-user-visible changes when the package version is already at -wip).

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?

This check can be disabled by tagging the PR with skip-breaking-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Unused Dependencies ✔️
Package Status
None No packages found to check.

For details on how to fix these, see dependency_validator.

This check can be disabled by tagging the PR with skip-unused-dependencies-check.

License Headers ✔️
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/html/test/differential_test.dart
pkgs/html/test/dom_parsing_test.dart
pkgs/html/test/mxss_test.dart
pkgs/html/test/noah_ark_clause_limit_test.dart

This check can be disabled by tagging the PR with skip-license-check.

Coverage ✔️
File Coverage

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

Avoids any text-mode stdin handling on Windows.
With a path argument, GNU sha256sum escapes the backslashes of a Windows
path such as D:\a\_temp and prefixes its output with `\`, so the hash
didn't match.
@github-actions

Copy link
Copy Markdown

Package publishing

If you have publishing permissions, you can use the links below to publish the changes after merging this PR.

Package Version Status Publish tag (post-merge)
package:boring 0.5.0 ready to publish boring-v0.5.0
  • 16 already published.
  • 26 WIP (no publish necessary).

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@mosuem
mosuem requested a review from jonasfj November 18, 2026 12:50

This branch has not been deployed

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

Labels

type-infra A repository infrastructure change or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant