Closed vamoko closed 1 year ago
I have the exact same error message on Debian 10
libc6
and libc-bin
are already installed:
apt install -y libc6 libc-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc-bin is already the newest version (2.28-10).
libc6 is already the newest version (2.28-10).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
I think this has to do with the way I create the release binary because I compile it locally on a very up-to-date Manjaro Linux. However, I'm not aware of the Rust best practices around this.
If anyone is, please share so that the release process can be improved and work for all of us :)
viu: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by viu)
Same issue here. Building for arm64 throws this error at the end, complaining about glibc 2.32.
Unfortunately, there is no best practice. If you want a statically compiled binary, you can compile against musl. I was able to do so and get it to run successfully:
docker pull rust
docker run --rm --name rust -ti rust bash
apt update
apt -y install musl-tools
git clone https://github.com/atanunq/viu
cd viu
rustup target add x86_64-unknown-linux-musl
cargo build --target x86_64-unknown-linux-musl --release
and then copy the resulting binary. A one-liner of the above which will output it under /tmp
:
docker run --rm --name rust -v /tmp:/tmp -ti rust bash -c "apt update && apt -y install musl-tools && git clone https://github.com/atanunq/viu && cd viu && rustup target add x86_64-unknown-linux-musl && cargo build --target x86_64-unknown-linux-musl --release && cp target/x86_64-unknown-linux-musl/release/viu /tmp/viu"
and to verify:
$ ldd /tmp/viu
statically linked
If you would prefer to build against older GLIBC versions and setup your CI/CD pipeline to do so, you can check out this blog post
A one-liner of the above which will output it under
/tmp
Thanks much for this… Been wanting to put this useful sounding tool to use. Now I can, with minimal effort. :)
I got the same error for docker in Jenkins container. How should I resolve that. I am running on Manjaro linux
I encounter the same problem of /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.32' not found
as I try to cargo build --release
of actix-web.
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build --release
This may work.
@g-cyan Can you please explain where should I add the above command? I am very new to this problem. Can you explain in detail
@mehedi02 I used that command to compile rust program and I assume that rust is not used in Jenkins.
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build --release
This may work.
Sorry , this only be meant to rust compilation.
@g-cyan thanks for reply. do you have any idea how to solve glibc 2.32 not found (required by docker) in jenkins container
@mehedi02 Sorry , I can't help it since I am not good at jenkins.
@g-cyan thanks for reply. do you have any idea how to solve glibc 2.32 not found (required by docker) in jenkins container
@mehedi02 i got the same error in docker container of jenkins can please tell me how to solve this.
Worked for me with RUSTFLAGS='--cfg procmacro2_semver_exempt'
I got the same error for docker in Jenkins container. How should I resolve that. I am running on Manjaro linux
Have you been able to find a solution for this ?
Anyone who gets that error should upgrade his Linux system or use a newer version of the particular Docker image's base image.
1, compile glibc-2.33 to libc-2.33.so, http://ftp.gnu.org/gnu/libc/glibc-2.33.tar.gz
I think this has to do with the way I create the release binary because I compile it locally on a very up-to-date Manjaro Linux. However, I'm not aware of the Rust best practices around this.
If anyone is, please share so that the release process can be improved and work for all of us :)
This addition seems to fix it: https://github.com/becheran/mlc/commit/ecac2bd854ff94440447554cbf1bc9354eea5714
same issue for me jenkins container i am trying to run docker but give same error. any help
This one-liner builds a static version with musl:
docker run --rm --name rust -v /tmp:/tmp -ti rust bash -c "apt update && apt -y install musl-tools && git clone https://github.com/atanunq/viu && cd viu && rustup target add x86_64-unknown-linux-musl && cargo build --target x86_64-unknown-linux-musl --release && cp target/x86_64-unknown-linux-musl/release/viu /tmp/viu"
same issue for me jenkins container i am trying to run docker but give same error. any help
do you have a solution?
I got the same error for docker in Jenkins container. How should I resolve that. I am running on Manjaro linux
did you finally solve the issue?
Got this error on Ubuntu 18.04, using https://github.com/atanunq/viu/releases/download/v1.3.0/viu
Attempt to fix with, but didn't work: