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
@SkyperTHC thank you for opening this. Yes, I'd like to solve this here, as the glibc mismatch has continued to be a pain point from time to time (e.g., #103), making it difficult to run on older Linux systems.
We want to include an additional file like noseyparker-v0.17.0-x86_64-unknown-linux-musl.tar.gz in future releases, which is fully statically linked.
Notes
Okay, so I tried a few things. Simply enabling the crt-static target feature for the x86_64-unknown-linux-gnu target fails early on:
error: cannot produce proc-macro for `clap_derive v4.5.4` as the target `x86_64-unknown-linux-gnu` does not support these crate types
A few minutes of research indicates that this may be a limitation of the *-linux-gnu targets...
Instead, using the x86_64-unknown-linux-musl target seems like it works, but setting up an Ubuntu-based build environment with all the necessary tools appears to be more complicated than simply doing an apt install of a few packages. (I get errors about musl-g++ missing...)
@SkyperTHC does this match your experience, or am I missing something about building statically-linked Rust programs on Linux?
Fully static x86_64 Linux binaries do get built within the Alpine-based Docker image. One option for building the *unknown-linux-musl release would be to use the Dockerfile.alpine build and simply copy the release out of there. Another option might be using cross.
Azathothas
added a commit
to Azathothas/Toolpacks
that referenced
this issue
Apr 29, 2024
The x86_64 release binary rarely works on Linux because of libc mismatches. It would be desirable to have a statically compiled binary as well.
I'm currently using these steps to compile a static binary using your
Dockerfile.alpine
:The statically compiled binary is then created in
target/x86_64-unknown-linux-musl/release/noseyparker-cli
Happy to fiddle it into hour GitHub CI/CD but feels like it would be easier for you - gimme a shout.
The text was updated successfully, but these errors were encountered: