Skip to content

feat: publish prebuilt native assets - #315

Open
HamdaanAliQuatil wants to merge 1 commit into
masterfrom
prebuilt-native-assets
Open

feat: publish prebuilt native assets#315
HamdaanAliQuatil wants to merge 1 commit into
masterfrom
prebuilt-native-assets

Conversation

@HamdaanAliQuatil

@HamdaanAliQuatil HamdaanAliQuatil commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

This builds trusted desktop native libraries during the pub.dev release workflow and includes them in the published package without committing binaries to the repository.

What changes:

  • hook/build.dart uses a matching packaged library from prebuilt/<target>/, falling back to the existing CMake source build when no prebuilt is available.
  • Consumers and CI can set build_from_source: true to bypass an available prebuilt explicitly.
  • The publish workflow builds Linux x64, macOS arm64/x64, and Windows x64 artifacts, validates them, assembles the package, and publishes only from a version tag.
  • Linux is built on Ubuntu 20.04 and checked for a maximum GLIBC 2.31 requirement. macOS deployment targets are checked at 10.15 for x64 and 11.0 for arm64.
  • Pull requests run the same four-platform build and package validation. The validation exercises both the prebuilt and forced source-build paths and reports the exact compressed pub archive size.

Local validation:

  • dart analyze hook/build.dart
  • dart format --output=none --set-exit-if-changed hook/build.dart
  • dart test -p vm test/aes_ctr_counter_wrap_test.dart

CI assembled the four-platform pub archive at 6.34 MiB compressed (6,646,685 bytes). The four native libraries are 8.61 MiB uncompressed (9,032,224 bytes).

Comment thread hook/build.dart Outdated
Comment thread hook/build.dart Outdated
Comment thread prebuilt/README.md Outdated
Comment thread prebuilt/README.md Outdated
Comment thread .github/workflows/build-prebuilt-assets.yml Outdated
@HamdaanAliQuatil
HamdaanAliQuatil requested a review from jonasfj July 14, 2026 15:17
@mosuem

mosuem commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Hi @HamdaanAliQuatil , would you mind taking a look at #325 ? I implemented basically the same thing, based on https://github.com/unicode-org/icu4x/blob/main/ffi/dart/hook/build.dart, which works quite well.

@HamdaanAliQuatil HamdaanAliQuatil changed the title feat: add prebuilt native asset infrastructure feat: publish prebuilt native assets Aug 18, 2026
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.

3 participants