-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Open
Open
<
8000
div>
Copy link
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
While investigating disk space shortages, I discovered that Flutter’s Android tools package includes a large NDK copy where all symlinks have been resolved into actual files.
Normal NDK from the official Android site:
[/path/to/ndk/28.2.13676358/toolchains/llvm/prebuilt/linux-x86_64/bin]$ ls -al | grep ^l
lrwxrwxrwx. 1 user user 8 Jul 27 07:59 clang -> clang-19
lrwxrwxrwx. 1 user user 5 Jul 27 07:59 clang++ -> clang
lrwxrwxrwx. 1 user user 6 Jul 27 07:59 ld -> ld.lld
lrwxrwxrwx. 1 user user 3 Jul 27 07:59 ld64.lld -> lld
lrwxrwxrwx. 1 user user 3 Jul 27 07:59 ld.lld -> lld
lrwxrwxrwx. 1 user user 3 Jul 27 07:59 lld-link -> lld
lrwxrwxrwx. 1 user user 15 Jul 27 07:59 llvm-addr2line -> llvm-symbolizer
lrwxrwxrwx. 1 user user 7 Jul 27 07:59 llvm-dlltool -> llvm-ar
lrwxrwxrwx. 1 user user 7 Jul 27 07:59 llvm-lib -> llvm-ar
lrwxrwxrwx. 1 user user 7 Jul 27 07:59 llvm-ranlib -> llvm-ar
lrwxrwxrwx. 1 user user 12 Jul 27 07:59 llvm-readelf -> llvm-readobj
lrwxrwxrwx. 1 user user 12 Jul 27 07:59 llvm-strip -> llvm-objcopy
lrwxrwxrwx. 1 user user 7 Jul 27 07:59 llvm-windres -> llvm-rc
lrwxrwxrwx. 1 user user 3 Jul 27 07:59 wasm-ld -> lld
NDK bundled with Flutter’s Android tools:
[/path/to/flutter/engine/src/flutter/third_party/android_tools/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin]$ ls -al | grep ^l
[/path/to/flutter/engine/src/flutter/third_party/android_tools/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin]$ ls -al clang*
-r-xr-xr-x. 1 user user 135276024 Oct 2 04:29 clang
-r-xr-xr-x. 1 user user 135276024 Oct 2 04:29 clang++
-r-xr-xr-x. 1 user user 135276024 Oct 2 04:29 clang-19
-r-xr-xr-x. 1 user user 75759408 Oct 2 04:29 clang-check
-r-xr-xr-x. 1 user user 44910272 Oct 2 04:29 clangd
-r-xr-xr-x. 1 user user 3817168 Oct 2 04:29 clang-format
-r-xr-xr-x. 1 user user 75664920 Oct 2 04:29 clang-scan-deps
-r-xr-xr-x. 1 user user 53089504 Oct 2 04:29 clang-tidy
As shown above, clang
, clang++
, and clang-19
are all separate files of ~135 MB each.
In the official NDK, they are symlinks to the same file.
This means Flutter’s Android tools are effectively duplicating large binaries, inflating the NDK’s size by hundreds (if not thousands) of megabytes.
Expected behavior
NDK binaries in Flutter’s Android tools should preserve symlinks instead of copying file contents.
This would significantly reduce disk usage and improve developer experience.
Environment
- Flutter version: 9dff19e
ctkqiang
Metadata
Metadata
Assignees
Labels
in triagePresently being triaged by the triage teamPresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds