-
Notifications
You must be signed in to change notification settings - Fork 74
[native_toolchain_c] Fix treeshaking on mac #2399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR Health
Breaking changes
|
Package | Change | Current Version | New Version | Needed Version | Looking good? |
---|---|---|---|---|---|
hooks_runner | Breaking | 0.21.0 | 0.21.0 | 0.22.0 Got "0.21.0" expected >= "0.22.0" (breaking changes) |
|
native_toolchain_c | Breaking | 0.16.8 | 0.17.0 | 0.17.0 | ✔️ |
This check can be disabled by tagging the PR with skip-breaking-check
.
Changelog Entry ✔️
Package | Changed Files |
---|
Changes to files need to be accounted for in their respective changelogs.
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 symbols |
---|
License Headers ✔️
// Copyright (c) 2025, 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/jni/lib/src/third_party/generated_bindings.dart |
pkgs/native_doc_dartifier/lib/native_doc_dartifier.dart |
pkgs/native_doc_dartifier/lib/src/native_doc_dartifier_base.dart |
pkgs/objective_c/lib/src/ns_input_stream.dart |
We have tests for binary sizes: pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart Shouldn't pkgs/native_toolchain_c/test/clinker/treeshake_test.dart and pkgs/native_toolchain_c/test/clinker/treeshake_cross_test.dart already invoke those? Why aren't those tests failing before this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need some sort of a test to verify that a symbol that previously wasn't treeshaken on macos is now removed.
Yes, those are getting invoked.
It seems like prior to this PR some symbols were already treeshaken. The existing tests are confirming that. But apparently it doesn't treeshake some other symbols marked as global. We'll need a specific new test for those cases. |
I agree on the calls for a test ;) I'll figure out how to build one. |
Are the global symbols visible with Otherwise, maybe add a global symbol that holds on to stuff? E.g. like a very very very long |
By creating a list of symbols to be exported.
Also needs to be tested with ICU4X, but manually setting this seems to do the trick to solve dart-lang/i18n#989
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.