Skip to content
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

[ffi] tree-shaking does not remove dependency .so library from the build #52970

Open
Tracked by #50565
makinghappen opened this issue Jul 18, 2023 · 3 comments
Open
Tracked by #50565
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi triaged Issue has been triaged by sub team

Comments

@makinghappen
Copy link

When building a project which includes a dependency having a native .so library linked via dart:ffi, it will be included in the resulting build even thou calls to that library were removed by tree-shaking dart code.

Flutter 3.11.0-0.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 350d2c3a6c (8 weeks ago) • 2023-05-23 15:52:05 -0700
Engine • revision 7eca5cd1c5
Tools • Dart 3.1.0 (build 3.1.0-63.1.beta) • DevTools 2.23.1

@a-siva a-siva added library-ffi area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Jul 18, 2023
@a-siva
Copy link
Contributor

a-siva commented Jul 18, 2023

//cc @dcharkes

@dcharkes
Copy link
Contributor

With DynamicLibrary.open, the path to the dynamic library is only known at runtime, so we cannot tree-shake.
We're working on an approach with which we know the dynamic libraries statically with @Native external functions. See #50565. This will enable us to tree-shake the native code in the future.

@a-siva
Copy link
Contributor

a-siva commented Nov 16, 2023

@dcharkes should this issue also be listed in #50565 under items listed in refine core support

@a-siva a-siva added the triaged Issue has been triaged by sub team label Nov 16, 2023
@dcharkes dcharkes changed the title tree-shaking does not remove dependency .so library from the build [ffi] tree-shaking does not remove dependency .so library from the build Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-ffi triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

3 participants