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
In the README, there is an example that uses a MUSL target to create a statically-linked binary. I was just wondering, if that build target isn't already present in the default image, how would we add it?
But the aarch64-unknown-linux-musl build target isn't available in the image by default, so I get the following error:
error[E0463]: can't find crate for `core`
|
= note: the `aarch64-unknown-linux-musl` target may not be installed
= help: consider downloading the target with `rustup target add aarch64-unknown-linux-musl`
For more information about this error, try `rustc --explain E0463`.
error: could not compile `memchr` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `regex-syntax` (lib) due to 1 previous error
Error: Failed to execute in container: ["cargo", "build", "--release", "--target", "aarch64-unknown-linux-musl"]
Caused by:
Podman command (["container", "exec", "-w", "/build", "--", "b3b41540bbdb4f6e48e5061ba27314ed868587817f3f16b4439cc0d755a0da47", "cargo", "build", "--release", "--target", "aarch64-unknown-linux-musl"]) failed to execute: ExitStatus(unix_wait_status(25856))
The text was updated successfully, but these errors were encountered:
I'm currently using an Arch Linux build environment for my statically linked binaries. There's a rust-aarch64-musl package that can be used together with musl-aarch64.
Before this was a thing, I explicitly selected a non-rust docker image, added rustup as a package and then installed an explicit toolchain version, as noted in the readme:
# select a specific Rust release so it's documented which one has been used
rustup default 1.80.1
rustup target add aarch64-unknown-linux-musl
rustup target add x86_64-unknown-linux-musl
I don't know if rustup target add resolves to a deterministic version with regular Rust images, but could be worth a try.
I asked somebody from the debian-rust team and apparently it's also possible to use the dpkg multiarch feature to make a different build target available, but I'm not sure if this is currently properly implemented in repro-env (you may need to generate your own repro-env.lock).
I hope this helps, let me know if you have trouble getting this to work!
In the README, there is an example that uses a MUSL target to create a statically-linked binary. I was just wondering, if that build target isn't already present in the default image, how would we add it?
For example, here is my
repro-env.toml
file:I use this build command:
But the
aarch64-unknown-linux-musl
build target isn't available in the image by default, so I get the following error:The text was updated successfully, but these errors were encountered: