rust-analyzer: "Bootstrap Error" rust-analyzer requires glibc >= 2.28 in latest build.
rust-analyzer no longer will run on Ubuntu 18.04( which bundles glibc 2.27), and other distros which have a glibc older than 2.27.
this issue manifests as a “Bootstrap Error” notably, the extension output will log something along the lines of:
ERROR [2/28/2022, 8:46:56 AM]: Bootstrap error [Error: Failed to execute /home/newuser/.vscode/extensions/matklad.rust-analyzer-0.2.956/server/rust-analyzer --version
when running the binary, we get the following error:
/home/jake/.vscode-server-insiders/extensions/matklad.rust-analyzer-0.3.953/server/rust-analyzer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found (required by /home/jake/.vscode-server-insiders/extensions/matklad.rust-analyzer-0.3.953/server/rust-analyzer)
/home/jake/.vscode-server-insiders/extensions/matklad.rust-analyzer-0.3.953/server/rust-analyzer: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /home/jake/.vscode-server-insiders/extensions/matklad.rust-analyzer-0.3.953/server/rust-analyzer)
current workarounds are mentioned in this comment: https://github.com/rust-analyzer/rust-analyzer/issues/11558#issuecomment-1054802255
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 6
- Comments: 51 (30 by maintainers)
Summary of a workaround
Option 1 - downgrade
1.Open the extension page in VS Code 2. Click on [V] next to Uninstall button 3. Select 0.2.948 and reload
Notes
You will be perpetually stuck on that version.
Option 2 - use pre-prelease via rustup
rustup toolchain install nightly --component rust-analyzer-previewrust-analyzer.server.path. You should see something along these linesEdit in settings.jsonand add"rust-analyzer.server.path": "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer"Notes
You will have to update the extension manually with
rustup updateThen set
rust-analyzer.server.pathto~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer.This is somewhat problematic for us, because our remote development environment for our company is ubuntu 18.04 at current, which means the rust-analyzer extension will suddenly break in a weird way (the error message isn’t that clear about lacking glibc, I had to actually go and execute the bundled r-a binary directly.)
I wonder how many people will run into this issue when this change hits the main release.
To ensure maximum compatibility with the rust-analyzer binary distributed in the vscode extension, should we instead bundle the musl binary?
This issue seems to reappear in the most recent release:
This is on Debian 10.12 that has GLIBC 2.28:
Workaround Option 1 is not working for me. When I try to downgrade to 0.2.948 I get the following error in VSCode:
“Can’t install ‘matklad.rust-analyzer’ extension because it is not compatible with the current version of Visual Studio Code (version 1.64.2).”
For Option 2, note that when searching for rust-analyzer.server.path you need to be in the remote tab of settings.
Getting the same error as @dpypin for Option 1. When I try Option 2, I don’t actually see any
rust-analyzer.server.pathoption. If I put it in manually in settings.json, vscode just says that it is unused. Does that setting work for when the extension is installed remotely over SSH? I followed therustupstep on my remote server, so everything should be installed correctly.Edit: Worth noting that I have the latest version of vscode which is 1.64.2. I’m currently in the process of downgrading to see if I can get it working again.
It should update automatically, so you don’t have to reinstall it. But in the meanwhile you can test a pre-release version by clicking on this button:
(the pre-release versions are generally quite stable)
Next monday.
Done!It seems to working on Ubuntu 18.04 now.But my pre-release version is v0.3.962.
It works for me in
AL2rustup toolchain install nightly --component rust-analyzer-previewASDF"rust-analyzer.server.path": "/home/ec2-user/.asdf/installs/rust/1.69.0/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer",to the remote settings.I suggest building from source for now. The config key is still
rust-analyzer.server.path.The GLIBC version in Debian 9 is too old, you’ll have to use
rustupas described above. Debian 10 should work.Yeah, just keep in mind that it won’t update automatically and the Code extension and server binary might become mismatched.
This was probably caused by https://github.com/rust-lang/rust/pull/90846. We’re pulling in
statxandposix_spawn:@sejr you can download one from https://github.com/rust-analyzer/rust-analyzer/releases,
chmod +xit, then setrust-analyzer.server.path.Is there any way to get one of the previous builds to work with VS Code 1.64.2? This has kinda derailed me in an environment where I can’t use rustup.
Hmm, is there any viable path forward to restore 18.04 support? Ubuntu 18.04 is supported until April 2023, which means it will be in wide use until then (and probably for a while after…)
In addition using musl would make it impossible to load proc macros compiled for glibc. (which is the default)