You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add libclang to LUCI bots so that we can run package:ffigen #105695
I'm unfamiliar with the setup on our Flutter LUCI bots, so I cannot recommend how to get/package them. Maybe @athomas has suggestions if the bots are sufficiently similar to the Dart bots.
The install location does not matter, default locations are the best. We can add these to package:ffigen and automatically detect it. Alternatively, we can also pass in a path to the test as a commandline argument.
@dcharkes Luci bots have been relying on package binaries stored in chromium CIPD. Could you help prepare an executable binary that we can upload to cipd? Then we can reference the package from LUCI recipes in LUCI bots.
On Cirrus CI, libclang is already availble and the test using it succeeds.
For the LUCI bots @athomas and I tried installing it in the Linux Bionic image, but that has libclang 6 and ffigen needs libclang >= 9. So that would bring us back to CIPD package which we would have to maintain.
Running a GitHub action and installing libclang there works, however the way the tool-tests are written require ../../bin/cache/dart-sdk/bin/dart. So we would need to write the test in another way.
@dcharkes Luci bots have been relying on package binaries stored in chromium CIPD. Could you help prepare an executable binary that we can upload to cipd? Then we can reference the package from LUCI recipes in LUCI bots.
However, those downloads do not provide a libclang for all 3 operating systems.
So, We'd get them via other means. I'd usually get them through a package manager for the operating system.
MacOS
$ mdfind -name libclang.dylib
...
# The version of one of these.
$ /Users/dacoharkes/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -v
Android (8075178, based on r437112b) clang version 14.0.1 (https://android.googlesource.com/toolchain/llvm-project 8671348b81b95fc603505dfc881b45103bee1731)
...
# libclang is self-contained and does not require dependencies (as far as I can see).
$ objdump --reloc --dynamic-reloc /Users/dacoharkes/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/lib64/libclang.dylib
/Users/dacoharkes/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/lib64/libclang.dylib:
Linux
$ which clang
...
$ cd /usr/lib/llvm-13
...
# It is not standalone on Linux
/usr/lib/x86_64-linux-gnu$ readelf -d libclang-13.so.13.0.1
Dynamic section at offset 0x1fd3bf8 contains 34 entries:
Tag Type Name/Value
...
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libLLVM-13.so.1]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]
...
(To be on the save side I'd include every .so file in lib/ from the Linux LLVM download for arm64 on that GitHub downloads page.)
Windows
To be explored.
@keyonghan Just to confirm. You'd like me to provide 3 archives (for each OS one) that contain libclang and its dependencies. (This seems horrible compared to using a package manager.)
Activity
keyonghan commentedon Jun 9, 2022
@dcharkes Luci bots have been relying on package binaries stored in chromium CIPD. Could you help prepare an executable binary that we can upload to cipd? Then we can reference the package from LUCI recipes in LUCI bots.
dcharkes commentedon Jun 15, 2022
Some more exploration:
../../bin/cache/dart-sdk/bin/dart. So we would need to write the test in another way.keyonghan commentedon Jun 21, 2022
I am removing the infra ticket queue project. Please loop back if anything is needed from flutter infra side.
dcharkes commentedon Jun 28, 2022
The latest release of libclang is 14.0.6 https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.6. (We need at least version 9.)
However, those downloads do not provide a
libclangfor all 3 operating systems.So, We'd get them via other means. I'd usually get them through a package manager for the operating system.
MacOS
Linux
(To be on the save side I'd include every .so file in
lib/from the Linux LLVM download for arm64 on that GitHub downloads page.)Windows
To be explored.
@keyonghan Just to confirm. You'd like me to provide 3 archives (for each OS one) that contain libclang and its dependencies. (This seems horrible compared to using a package manager.)
keyonghan commentedon Jun 28, 2022
That is correct. Packages that are platform dependent come with separate archives in cipd. One example: https://chrome-infra-packages.appspot.com/p/flutter/device_doctor
Update plugin_ffi generated file to match FFIgen 9.0.0 (#134614)
Update plugin_ffi generated file to match FFIgen 9.0.0 (flutter#134614)
matanlurey commentedon Feb 22, 2025
This is something the Dart team would have to own if it's important, we don't have the resources do this ourselves.
(If not, feel free to close)