Skip to content

feat: add link hook for treeshaking native symbols via record_use#326

Draft
mosuem wants to merge 9 commits into
google:masterfrom
mosuem:add-link-hook-treeshaking
Draft

feat: add link hook for treeshaking native symbols via record_use#326
mosuem wants to merge 9 commits into
google:masterfrom
mosuem:add-link-hook-treeshaking

Conversation

@mosuem

@mosuem mosuem commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds hook/link.dart leveraging CLinker and record_use to treeshake unused BoringSSL native symbols.
  • Updates hook/build.dart to compile static libraries when static linking or link hooks are enabled, and routes static assets to ToLinkHook.
  • Updates src/CMakeLists.txt to honor the BUILD_SHARED_LIBS option.
  • Adds .github/workflows/treeshake-test.yml matrix workflow to run desktop tests with native symbol treeshaking.

@mosuem
mosuem marked this pull request as draft July 15, 2026 13:59
mosuem added 9 commits July 17, 2026 15:18
- Upgrade ffigen dependency to ^20.0.0 in pubspec.yaml
- Consolidate YAML ffigen configs into tool/ffigen.dart
- Update tool/update-bindings.sh to run dart run tool/ffigen.dart
- Re-generate native bindings
- Add hooks.user_defines.webcrypto.buildMode: fetch to pubspec.yaml
- Support fetch, build, and local build modes in hook/build.dart
- Add lib/src/hook_helpers/hashes.dart and tool/regenerate_hashes.dart for SHA256 integrity checks
- Add .github/workflows/release-artifacts.yml matrix workflow supporting Linux, macOS, Windows, Android, and iOS
- Pin workflow actions to full commit SHA hashes
- Add hook/link.dart using CLinker and record_use for native symbol treeshaking
- Update hook/build.dart to support static library building and ToLinkHook routing
- Add .github/workflows/treeshake-test.yml workflow for desktop treeshake testing
- Update src/CMakeLists.txt to support BUILD_SHARED_LIBS
@mosuem
mosuem force-pushed the add-link-hook-treeshaking branch from 7992f50 to 41ebdee Compare July 17, 2026 15:18
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.

1 participant