Repository navigation
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
There was a problem hiding this comment.
Code Review
This pull request refactors the build and link hooks of package:boring to use package:prebuilt_code_assets, significantly reducing boilerplate code for fetching prebuilt binaries, building from source with CMake, tree-shaking, and managing release hashes. The tests and CLI tools have also been updated to use shared utilities from the new package. The review feedback suggests a minor improvement in pkgs/boring/lib/src/hook_helpers/library.dart to avoid a conceptual circular dependency by calling boringReleaseConfig(version) directly instead of referencing the global boringLibrary instance.
PR Health
Coverage
|
| File | Coverage |
|---|---|
| pkgs/boring/hook/build.dart | 💔 Not covered |
| pkgs/boring/hook/link.dart | 💔 Not covered |
| pkgs/boring/lib/src/hook_helpers/hashes.dart | 💔 Not covered |
| pkgs/boring/lib/src/hook_helpers/library.dart | 💔 Not covered |
| pkgs/boring/tool/precompile_binaries.dart | 💔 Not covered |
| pkgs/boring/tool/regenerate_hashes.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.
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.
Breaking changes ✔️
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| boring | Breaking | 0.4.1 | 0.4.2-wip | 0.4.2-wip | ✔️ |
This check can be disabled by tagging the PR with skip-breaking-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.
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 |
|---|---|---|
| boring | self._SymbolAddresses | bindings/boringssl.g.dart::SymbolAddresses bindings/boringssl.g.dart::addresses |
| boring | self.__va_list_tag | bindings/boringssl.g.dart::BIO_vsnprintf::args bindings/boringssl.g.dart::OPENSSL_vasprintf::args |
| boring | self.__locale_struct | bindings/boringssl.g.dart::locale_t |
This check can be disabled by tagging the PR with skip-leaking-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.
497fe69 to
80e6a01
Compare
80e6a01 to
20ec155
Compare
de2d1f6 to
8f6e8fe
Compare
8f6e8fe to
1c4d61b
Compare
1c4d61b to
a8d8e0f
Compare
1afa2e4 to
9541079
Compare
9541079 to
e9980d3
Compare
hook/build.dart gains the `fetch` (default), `checkout` and `local` build modes, configured under `hooks.user_defines.boring`. `fetch` downloads the library of the pinned release and verifies it against the SHA-256 hashes in lib/src/hook_helpers/hashes.dart, falling back to the CMake build if there is none. When linking is enabled, the build hook provides a static library, and hook/link.dart links a dynamic library with only the functions that the application uses, as recorded by the Dart compiler for the @RecordUse() bindings. In the `fetch` mode, it falls back to the prebuilt dynamic library if linking fails, for example without a C toolchain for the target when cross-compiling. - The hashes are computed with package:crypto. - test/tree_shaking_test.dart builds the example natively and for linux-arm64, with and without a cross toolchain. The `test` job installs one on each OS. - Pushing a `boring-binaries-v<version>` tag triggers the boring_binaries.yaml workflow, which builds the release libraries and attaches them to that pre-release. tool/regenerate_hashes.dart then pins their SHA-256 hashes. The hashes and download URLs still point at the 0.4.1 release of github.com/mosuem/boring until the first release from this repository.
Replace the hook helpers for fetching, verifying, building and linking with package:prebuilt_code_assets, which implements the same build modes and tree shaking for any package with prebuilt native code. What is specific to package:boring, the release configuration and the CMake build, is in lib/src/hook_helpers/library.dart, which both hooks and the release tools share. - tool/precompile_binaries.dart and tool/regenerate_hashes.dart use the package's CLI runners with the same options, so the binaries workflow is unchanged. - test/tree_shaking_test.dart uses its ELF helpers. - Drop the dependencies only the replaced helpers used, and with them dart_dependency_validator.yaml, which is no longer needed.
e9980d3 to
7ba2f75
Compare
|
Have you talked to @dcharkes about |
The native interop team does not want to own it on it on dart-lang/native. We feel like it's an dart-lang/ecosystem package. Dart-lang/native owns the low-level building blocks. How those building blocks are stitched together is an ecosystem question. And we don't have the capacity to maintain it. (Separately, it makes some decisions that we don't agree with, such as hosting on github artifacts.) For the full review see: dart-lang/native#3719 I do agree we maybe want a package in this direction, otherwise every package needs to reinvent the wheel. But until that time maybe duplicating the code is the cleaner solution because it doesn't commit us to maintaining some public API and agreeing on a bunch of design decisions. |
Part 4 of 4 of moving package:boring to dart-lang/tools. For an overview, see #2614. This PR is mosuem/boring#7.
It replaces the hook helpers for fetching, verifying, building, and linking with package:prebuilt_code_assets. That package implements the same build modes and tree shaking for any package with prebuilt native code. What's specific to package:boring now lives in
lib/src/hook_helpers/library.dart: the release configuration and the CMake build.tool/precompile_binaries.dartandtool/regenerate_hashes.dartnow use the package's CLI runners. The options are the same, soboring_binaries.yamldoesn't change.test/tree_shaking_test.dartnow uses the package's ELF helpers.dart_dependency_validator.yamlis removed, because nothing needs ignoring anymore.Open question. package:prebuilt_code_assets is a 0.1.x package from mosuem/prebuilt_code_assets. It has no publisher, and pub.dev doesn't detect its license. Its hook code runs on the machine of everyone who depends on package:boring, so it should probably move to a dart-lang repository and publisher first. #2615 and #2616 can land without this PR.