Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLIBC_2.25 requirement is not met in Ubuntu 16.04.6 #11808

Closed
rrjanbiah opened this issue Mar 24, 2022 · 7 comments
Closed

GLIBC_2.25 requirement is not met in Ubuntu 16.04.6 #11808

rrjanbiah opened this issue Mar 24, 2022 · 7 comments

Comments

@rrjanbiah
Copy link

The latest available GLIBC version available is 2.23, but rust-analyzer needs 2.25. Please note that we can't build > 2.23 in any old machines as that results in core dump with segmentation fault. So, if the GLIBC requirement is reduced, it will help Ubuntu 16.04.6 machines.

rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)

Most likely 0.2.964 as the version command crashes with

/home/me/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /home/me/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer)

rustc version: (eg. output of rustc -V)

rustc 1.59.0 (9d1b2106e 2022-02-23)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)

N/A

@lnicola
Copy link
Member

lnicola commented Mar 24, 2022

You can do rustup +nightly component add rust-analyzer-preview. You can still use a different toolchain to compile your code.

Ubuntu 16.04 is unsupported and we can't easily build binaries for it.

@lnicola lnicola closed this as completed Mar 24, 2022
@rrjanbiah
Copy link
Author

Ubuntu 16.04 is unsupported and we can't easily build binaries for it.

Forgive my ignorance. But, it seems to me that you have in fact built binaries for the Ubuntu 16.04, but linked a new glibc version (2.25 vs 2.23). If the that can't be done, may better to fail in the first place.

@lnicola
Copy link
Member

lnicola commented Mar 24, 2022

We're building these binaries on Ubuntu 18.04 (GLIBC 2.27), the oldest distro available in GitHub Actions. We could use Docker, but it's a relatively large bump in complexity, and we don't want to struggle to support EOL distros.

The ones in rustup are built on something ancient so they work everywhere.

@rrjanbiah
Copy link
Author

@lnicola

Thank you so much that finally I got it working. Unfortunately, I was taking more time to understand what you're suggesting.

In case, if anyone is coming to this ticket through Google...

For Ubuntu 16.04 and for the GLIBC_2.25, most of the forums recommend to build GLIBC from the source. But, do NOT build it; if you do so, your system will be crashed with segmentation fault and can't even get into recovery mode. Only option is to recover through a Ubuntu live CD/USB by replacing libc6 files.

As mentioned by @lnicola, we must install the rust-analyzer through rustup. Here are the steps that I followed:

# Install rust-analyzer through rustup
# Note: Mentioned in https://rust-analyzer.github.io/manual.html#rustup but not in the Extension page
rustup +nightly component add rust-analyzer-preview

# find the "new" rust-analyzer location which is installed through rustup
rustup +nightly which rust-analyzer
# above command will return something like `~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer`

# check if the "new" rust-analyzer works
~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer --version
# will return something like `rust-analyzer b594f9c 2022-03-24 dev`


# Delete or rename the binary that's not working (available inside the extension folder)
mv ~/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer ~/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer.bak

# Create symlink (Note: path may be different) so that the new binary will be picked up
ln -s ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer ~/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer

@lnicola
Copy link
Member

lnicola commented Mar 25, 2022

You only need the first two steps. You can then set the server path using rust-analyzer.server.path in the Code settings.

And yes, I strongly advise against trying to rebuild GLIBC. You're presumably using Ubuntu 16.04 because you don't want to change your distro, while the C library is the most important package in there. The other solution is to build rust-analyzer from source.

@rrjanbiah
Copy link
Author

@lnicola Thank you

@MorseWayne
Copy link

@lnicola

Thank you so much that finally I got it working. Unfortunately, I was taking more time to understand what you're suggesting.

In case, if anyone is coming to this ticket through Google...

For Ubuntu 16.04 and for the GLIBC_2.25, most of the forums recommend to build GLIBC from the source. But, do NOT build it; if you do so, your system will be crashed with segmentation fault and can't even get into recovery mode. Only option is to recover through a Ubuntu live CD/USB by replacing libc6 files.

As mentioned by @lnicola, we must install the rust-analyzer through rustup. Here are the steps that I followed:

# Install rust-analyzer through rustup
# Note: Mentioned in https://rust-analyzer.github.io/manual.html#rustup but not in the Extension page
rustup +nightly component add rust-analyzer-preview

# find the "new" rust-analyzer location which is installed through rustup
rustup +nightly which rust-analyzer
# above command will return something like `~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer`

# check if the "new" rust-analyzer works
~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer --version
# will return something like `rust-analyzer b594f9c 2022-03-24 dev`


# Delete or rename the binary that's not working (available inside the extension folder)
mv ~/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer ~/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer.bak

# Create symlink (Note: path may be different) so that the new binary will be picked up
ln -s ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer ~/.vscode/extensions/matklad.rust-analyzer-0.2.964/server/rust-analyzer

this is pretty good solution, thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants