Skip to content

[boring] Bundle the prebuilt libraries in the published package - #2866

Draft
mosuem wants to merge 1 commit into
boring-ci-hardeningfrom
boring-bundle-binaries
Draft

mosuem wants to merge 1 commit into
boring-ci-hardeningfrom
boring-bundle-binaries

Conversation

@mosuem

@mosuem mosuem commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Note

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

Important

Stacked on #2899 (this PR targets its branch, so the diff only shows the bundling change).

Bundles package:boring's prebuilt libraries in the package archive published to pub.dev, instead of attaching them to boring-binaries-* GitHub releases that the build hook downloads, and publishes with SLSA Build L3 provenance via dart-lang/setup-dart/.github/workflows/publish.yml (dart-lang/setup-dart#213).

CI

  • boring_binaries.yaml now also runs on boring-v<version> tags. It builds the libraries for all 11 prebuilt targets from the tagged commit (bundled-files-*), tests the archive on Linux, macOS, and Windows, and delegates publishing to dart-lang/setup-dart/.github/workflows/publish.yml (bundled-files, attest: true, running in test-run mode on non-tag runs). publish.yaml skips boring-v* tags so firehose does not publish the package without the libraries.
  • Drops per-binary intermediate provenance attestation in favor of setup-dart's SLSA Build L3 attestation over the complete package.tar.gz archive (which covers all bundled libraries).
  • Removes the release and pin jobs, so there are no more boring-binaries-* pre-releases or pin PRs. The libraries are built from the tagged commit, so they always match the vendored BoringSSL. That makes hashes.dart, tool/regenerate_hashes.dart, tool/check_prebuilt_binaries.sh, and the matching steps in boring.yaml unnecessary.
  • Adds pkgs/boring/.pubignore, which pub reads instead of .gitignore, so prebuilt/ goes into the archive while git still ignores it.
  • Supply-chain hardening (pinned NASM, pinned macOS cross-toolchain, precompile without OIDC permissions) is split out into [boring] Pin NASM and the macOS cross-toolchain, and attest in a separate job #2899, which this PR is stacked on. The pinned macOS cross-toolchain step moves with the cross-compilation tests into boring_binaries.yaml, and the separate attest job is dropped since setup-dart attests the whole archive.

Build hook

  • fetch mode (hook/build.dart) and the link-failure fallback (hook/link.dart) now read prebuilt/<target>/<library> from the package root (lib/src/hook_helpers/prebuilt.dart, which replaces fetch.dart). There's no download, hash check, or cache anymore.
  • A git/path dependency has no prebuilt/, so it gets a BuildError that points to buildMode: checkout.
  • tool/precompile_binaries.dart writes to prebuilt/<target>/ instead of bin/boring-<target>-<library>. A local run therefore makes a checkout usable in fetch mode.

Tests

  • Moves the cross-compilation tests from tree_shaking_test.dart to prebuilt_test.dart. They now build against BORING_PACKAGE_DIR (the extracted archive), and the file also checks that all 22 libraries are there. Without that variable the file is skipped, as it is in boring.yaml. The cross-toolchain setup moves to boring_binaries.yaml with it.

CI notes

Notes

@github-actions github-actions Bot added type-infra A repository infrastructure change or enhancement package:boring labels Nov 12, 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 refactors the package:boring build process to bundle prebuilt libraries directly within the published package under prebuilt/ instead of downloading them from GitHub Releases during the build. This removes the need for network access in the default fetch build mode. The changes include removing download-related utilities and hash verification files, updating hooks to load the bundled libraries, and adding new tests to verify the prebuilt binaries. Feedback on the new tests suggests simplifying the absolute package URI creation using Directory.absolute.uri and using this absolute URI to locate the example file for improved robustness.

Comment thread pkgs/boring/test/prebuilt_test.dart Resolved
Comment thread pkgs/boring/test/prebuilt_test.dart Resolved
@github-actions

github-actions Bot commented Nov 12, 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?
boring Breaking 0.4.2 0.5.0 0.5.0 ✔️

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
boring ✔️ All dependencies utilized correctly.

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
pkgs/boring/hook/build.dart 💔 Not covered
pkgs/boring/hook/link.dart 💔 Not covered
pkgs/boring/lib/src/hook_helpers/build_options.dart 💚 88 %
pkgs/boring/lib/src/hook_helpers/prebuilt.dart 💚 100 %
pkgs/boring/lib/src/hook_helpers/targets.dart 💚 100 %
pkgs/boring/tool/precompile_binaries.dart 💔 Not covered

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.

Bundles package:boring's prebuilt libraries in the package archive
published to pub.dev, instead of attaching them to `boring-binaries-*`
GitHub releases that the build hook downloads, and publishes with SLSA
Build L3 provenance via dart-lang/setup-dart's publish.yml.

- boring_binaries.yaml also runs on `boring-v<version>` tags: it builds
  the libraries for all prebuilt targets from the tagged commit, tests the
  package archive on Linux, macOS, and Windows, and publishes it via
  setup-dart (`bundled-files`, `attest: true`). publish.yaml skips
  `boring-v*` tags.
- Removes the `release`, `pin`, and `attest` jobs, hashes.dart,
  tool/regenerate_hashes.dart, and tool/check_prebuilt_binaries.sh, as the
  libraries are built from the tagged commit.
- `fetch` mode and the link-failure fallback read
  `prebuilt/<target>/<library>` from the package root (prebuilt.dart
  replaces fetch.dart). tool/precompile_binaries.dart writes there.
- Moves the cross-compilation tests to test/prebuilt_test.dart, which runs
  against the extracted package archive (BORING_PACKAGE_DIR).
@mosuem
mosuem force-pushed the boring-bundle-binaries branch from 4f242bf to c6d8d35 Compare November 18, 2026 09:39
@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.

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

package:boring type-infra A repository infrastructure change or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant