atanunq / viu

Terminal image viewer with native support for iTerm and Kitty
MIT License
2.53k stars 56 forks source link

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found #68

Closed vamoko closed 1 year ago

vamoko commented 3 years ago

Got this error on Ubuntu 18.04, using https://github.com/atanunq/viu/releases/download/v1.3.0/viu

viu: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by viu)

Attempt to fix with, but didn't work:

apt install -y libc6 libc-bin
RoneoOrg commented 3 years 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.
atanunq commented 3 years ago

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 :)

simonSlamka commented 3 years ago

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.

ossie-git commented 3 years ago

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

blooalien commented 2 years ago

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. :)

mehedi02 commented 2 years ago

I got the same error for docker in Jenkins container. How should I resolve that. I am running on Manjaro linux

g-cyan commented 2 years ago

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.

g-cyan commented 2 years ago
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build --release 

This may work.

mehedi02 commented 2 years ago

@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

g-cyan commented 2 years ago

@mehedi02 I used that command to compile rust program and I assume that rust is not used in Jenkins.

g-cyan commented 2 years ago
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build --release 

This may work.

Sorry , this only be meant to rust compilation.

mehedi02 commented 2 years ago

@g-cyan thanks for reply. do you have any idea how to solve glibc 2.32 not found (required by docker) in jenkins container

g-cyan commented 2 years ago

@mehedi02 Sorry , I can't help it since I am not good at jenkins.

Gokul-C commented 2 years ago

@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.

SkwalExe commented 2 years ago

Worked for me with RUSTFLAGS='--cfg procmacro2_semver_exempt'

Akpad3tsi commented 1 year ago

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 ?

theAkito commented 1 year ago

Anyone who gets that error should upgrade his Linux system or use a newer version of the particular Docker image's base image.

leiqi96 commented 1 year ago

1, compile glibc-2.33 to libc-2.33.so, http://ftp.gnu.org/gnu/libc/glibc-2.33.tar.gz

  1. then link libc.so.6 to libc-2.33.so may solve it.
pepa65 commented 1 year ago

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

mahesh2121 commented 1 year ago

same issue for me jenkins container i am trying to run docker but give same error. any help

pepa65 commented 1 year ago

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"

chengzequn commented 1 year ago

same issue for me jenkins container i am trying to run docker but give same error. any help

do you have a solution?

chengzequn commented 1 year ago

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?