nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

/lib64/libc.so.6: version `GLIBC_2.28' not found (required by libserde_derive) #208

Closed farzadmf closed 1 year ago

farzadmf commented 1 year ago

Hi, I need to set up a fresh machine from scratch, and I'm having problems installing cargo-update

I'm seeing this error (this is part of :

error: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /tmp/cargo-installGafUMe/release/deps/libserde_derive-6b7c87819d8d53e4.so)
   --> /home/farzadmf/bin/tools/cargo/registry/src/github.com-1ecc6299db9ec823/cargo-update-11.0.0/src/lib.rs:370:1
    |
370 | extern crate serde_derive;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
  --> /home/farzadmf/bin/tools/cargo/registry/src/github.com-1ecc6299db9ec823/cargo-update-11.0.0/src/ops/config.rs:59:45
   |
59 | #[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
   |                                             ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
...

Sorry, I'm not expert in Rust (not even a novice 😛 ), but I'm guessing the first line there is to blame.

A bit of a background: I'm using homebrew in my Linux distribution, and my Linux distribution's glibc libraries are old (as you can say by the fact that /lib64/libc.so.6 doesn't have GLIBC_2.28 (my /home/linuxbrew/.linuxbrew/opt/glibc/libc.so.6 is a new one and should be fine, but it's not being picked up for some reason)

Even when I do ldd /tmp/cargo-installgZnjSN/release/deps/libserde_derive-6b7c87819d8d53e4.so, I see this:

    linux-vdso.so.1 (0x00007ffff79e5000)
    libgcc_s.so.1 => /home/linuxbrew/.linuxbrew/lib/gcc/current/libgcc_s.so.1 (0x00007f7d01f28000)
    libc.so.6 => /home/linuxbrew/.linuxbrew/opt/glibc/lib/libc.so.6 (0x00007f7d017ef000)
    /home/linuxbrew/.linuxbrew/Cellar/glibc/2.35_1/lib64/ld-linux-x86-64.so.2 (0x00007f7d01f4d000)

So, I'm not sure why it's using /lib64/libc.so.6

If I try setting LD_LIBRARY_PATH=$HOMEBREW_PREFIX/opt/glibc/lib, I get segmentation fault all over the place, and I basically cannot run any commdn

I've been trying different things, and I've failed. I was wondering if you can help me with this.

Let me know if I can provide more information that can help.

nabijaczleweli commented 1 year ago

idk anything about the macintosh, or about homebrew. what I do know is that you shouldn't expect to be able to break your libc like this and succeed. maybe you need to pass the equvalent of -L? or not crossgrade your system like this? dunno.

farzadmf commented 1 year ago

Fair point, and I totally agree with you. Homebrew seems to be the only complete universal package manager that I can use ; works the same everywhere except Windows, but seems like it's doing some things extra (or missing things) on Linux (or at least the Linux distribution I'm using.

But yeah, I know my message here is maybe incomplete and a bit ambiguous, but that's a sign of my desparation, trying everything and not succeeding. I was hoping for a miracle maybe that someone sees this and says: "Oh yeah, it's because of this and that, and you can do \ to fix it"

nabijaczleweli commented 1 year ago

Well, I can tell you from experience that replacing your libc, especially partially, is fixed by "very carefully reverting it to the one that was there originally and being very happy you could still boot/log in". idk what else to tell you

farzadmf commented 1 year ago

Hey @nabijaczleweli , I really appreciate your responses, but I do understand that this question was mostly a shot in the dark, hoping for an answer.

BUT, the good thing is that I FINALLY figured it out, and not that anyone would need it, but I'm gonna mention it just in case somebody faces the same issue.

I had a hunch that this would be an easy fix, but finding the fix was SUUUUPER HARD (at least for me).

The reason for this happening was the pkg-config binary. When I install brew (and set it up in my shell), it basically causes brew's pkg-config to be the first in PATH, and that's what messes up everything.

What I did was to make sure my system's pkg-config (in my case, /usr/bin/pkg-config) is picked up first, and everything is working fine now (so the other errors were a bit misleading, directing me to search for things that are not directly responsible)

One extra thing that I needed to do was to re-install rust for it to pick up the "good" libraries.

Anyway, quite a journey for me, and maybe here was my rubber duck since I finally solved my issue after almost one week spending time on the matter here and there!