-
Notifications
You must be signed in to change notification settings - Fork 710
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
Can't compile ring with target aarch64-unknown-linux-musl #1414
Comments
Same here. |
My solution was to use the |
This is critical to be able to deploy to AWS Lambda. To reproduce:
In this case all the cross compilation requirmemts were met as I had been able to deploy other Rust based software. |
After more tests, now it's work with |
Do we have an ETA? This is 100% blocking for many people. Respectfully pinging @briansmith with good vibes and good intentions. |
What is the output of Look at mk/cargo.sh and .github/ci.yml to see how to configure cross-compilation. I would recommend doing it with clang. Feel free to submit a PR that adds the I think using clang instead of gcc for the C compiler (again, see mk/cargo.sh) will make it work easier. |
For portability, gcc should also be supported as some platforms I'm trying to use Ubuntu to cross compile and deploy to AWS lambda, Ring seems to be the only thing blocking that. Thing is, Ubuntu support is core for a lot of devs because of its use for wsl2 (on windows to allow unix via containers) and because a lot of devs use ubuntu laptops for rust development machines professionally when their companies are too cheap to provide macbooks. On my Ubuntu machine I can show that they are installed by simply typing |
I bet it does work. Presently you need to install a working musl toolchain for it. I believe if you use clang instead, it is easier.
Please make a PR to add your configuration to ring's CI/CD, if you can. Then it would be easy for me to debug it. |
Unfortunately the code I'm deploying is such I can't make it public; but there is an easy repo. In this case, I have a working musl toolchain on ubuntu; I was able to deploy to lambda just fine on it until I added the lambda_web crate; it seems to be triggered by the dependency of brotli and that pulls in Ring. |
|
You didn't give me the STR. |
I'm confused by this comment and don't know what you mean. The crate is at https://crates.io/crates/lambda-web/
|
Just gonna cross-post this which solved the issue for me: #563 (comment) |
@briansmith I’m running into the same issue described here, is there anything I could do to help? |
For the record I've been able to compile ring for aarch64 by using llvm like Brian mentioned. I've taken environment variables from StackOverflow that took it from ring's config file: ENV CC_aarch64_unknown_linux_musl=clang
ENV AR_aarch64_unknown_linux_musl=llvm-ar
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld" This of course needs LLVM and musl-tools: |
Just encountered this today: With RUST_BACKTRACE=1, the error output is:
I'll try switching to LLVM for now |
I did the same env setup. I am getting the following error.
Using docker with |
I'm guessing that something in your configuration is confusing clang about what headers to use. In build.rs we have this:
Try removing the |
This comment was marked as outdated.
This comment was marked as outdated.
Not sure if this could help anyone but if you are using
If we did not add this option, I found that Maybe even if we don't use
|
I was able to solve all my compilation issues by using cross project:
|
Great! I am going to close this issue then. |
### Change list - Update with a fix to not implement Fd support on Windows. From omerbenamram/pyo3-file#19. - Have to wait for redhat to get their shit together: https://status.redhat.com/incidents/qh68rjfg6xs6 - The aarch64 build is failing with ``error: failed to run custom build command for `ring v0.17.8` `` which looks to be briansmith/ring#1414.
it doesn't work using zigbuild though |
I don't use ring directly but via jsowebtoken, rustls, etc.
I am trying to compile on AWS Graviton EC2 and get the following error for the following command:
cargo build --release --target aarch64-unknown-linux-musl
If you see the error message below, what stands out is:
No such file or directory (os error 2)', /home/ssm-user/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/ring-0.16.20/build.rs:653:9
error: failed to run custom build command for
ring v0.16.20
Caused by:
process didn't exit successfully:
/tmp/lambda_build/target/release/build/ring-6fdf78c41c5d5ad7/build-script-build
(exit status: 101)--- stdout
OPT_LEVEL = Some("z")
TARGET = Some("aarch64-unknown-linux-musl")
HOST = Some("aarch64-unknown-linux-gnu")
CC_aarch64-unknown-linux-musl = None
CC_aarch64_unknown_linux_musl = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_aarch64-unknown-linux-musl = None
CFLAGS_aarch64_unknown_linux_musl = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = None
--- stderr
running "aarch64-linux-musl-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-U_FORTIFY_SOURCE" "-DNDEBUG" "-c" "-o/tmp/lambda_build/target/aarch64-unknown-linux-musl/release/build/ring-8d8172b2ed11f37e/out/aesv8-armx-linux64.o" "/home/ssm-user/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesv8-armx-linux64.S"
thread 'main' panicked at 'failed to execute ["aarch64-linux-musl-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-U_FORTIFY_SOURCE" "-DNDEBUG" "-c" "-o/tmp/lambda_build/target/aarch64-unknown-linux-musl/release/build/ring-8d8172b2ed11f37e/out/aesv8-armx-linux64.o" "/home/ssm-user/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesv8-armx-linux64.S"]: No such file or directory (os error 2)', /home/ssm-user/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/ring-0.16.20/build.rs:653:9
The text was updated successfully, but these errors were encountered: