Closed surban closed 6 months ago
I'm having trouble reproducing the same error that you're getting. My build is also failing, but it seems to be progressing further than the one you reported.
Your error looks like the message we get when certain clang/llvm libraries are not installed on the host. Verify that you have libclang1
installed. Our User Guide has some instructions for it here, there's also some guidance in bindgen's User Guide (which might be out-dated now?).
Another option would be to install the bindgen-cli
and set the AWS_LC_SYS_EXTERNAL_BINDGEN=1
environment variable to force our build to use that instead of our internal bindings generation.
Let me know if either of these options work for you.
Note: We do verify our build in CI for a few android-related targets (arm-linux-androideabi
, armv7-linux-androideabi
, and aarch64-linux-android
) but we build using cross-rs.
Ok, I was able to get the build succeed on my Ubuntu 22.04 (x86-64) host:
I installed Ubuntu's android-sdk
package and downloaded the r26d NDK. I exported the following two environment variables:
export ANDROID_NDK_ROOT=/home/justsmth/android-ndk/android-ndk-r26d
export ANDROID_SDK_ROOT=/usr/lib/android-sdk
From the aws-lc-rs/aws-lc-rs
subdirectory, I ran the build command:
❯ cargo ndk --target x86_64-linux-android build
Building x86_64 (x86_64-linux-android)
Compiling libc v0.2.154
Compiling fs_extra v1.3.0
Compiling dunce v1.0.4
Compiling paste v1.0.14
Compiling aws-lc-rs v1.7.1 (/home/justsmth/repos/aws-lc-rs/aws-lc-rs)
Compiling mirai-annotations v1.12.0
Compiling untrusted v0.7.1
Compiling zeroize v1.7.0
Compiling jobserver v0.1.26
Compiling cc v1.0.94
Compiling cmake v0.1.50
Compiling aws-lc-sys v0.16.0 (/home/justsmth/repos/aws-lc-rs/aws-lc-sys)
warning: aws-lc-sys@0.16.0: Generating bindings - external bindgen. Platform: x86_64-linux-android
Finished `dev` profile [unoptimized + debuginfo] target(s) in 19.76s
(This was using the "external" bindgen-cli.)
Problem:
Build for Android using
cargo ndk
fails.This is the build output:
Relevant details
AWS-LC-SYS for Rust versions or commit: 0.16.0
System information: for linux, below info can be collected by running
uname -srvmp