rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

New versions not available on OpenVSX (platform-specific VSIXes)

Open romainreignier opened this issue 2 years ago • 44 comments

EDIT: see https://github.com/rust-analyzer/rust-analyzer/issues/11080#issuecomment-1010840901


rust-analyzer version: "Rust Analyzer: Show RA Version" command does nor exist, extension install dir: matklad.rust-analyzer-0.2.867

rustc version: rustc 1.56.0 (09c42c458 2021-10-18)

OS Version: Ubuntu 18.04.6

VS Code version: I use VSCodium 1.63.2

Today, rust-analyzer updated itself and stop working with the error:

INFO [12/21/2021, 11:18:12 AM]: Using server binary at /home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer
ERROR [12/21/2021, 11:18:12 AM]: Bootstrap error [Error: Failed to execute /home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer --version
	at j0 (/home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:109:4032)
	at processTicksAndRejections (internal/process/task_queues.js:93:5)
	at async N0 (/home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:109:1881)
	at async I0 (/home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:108:3977)
	at async lC (/home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/out/main.js:108:3808)
	at async Promise.all (index 0)
	at async v.$activate (/usr/share/codium/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:100:20806)]

The file /home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer but cannot be executed, even manually:

$ /home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer --version
bash: /home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer: No such file or directory

While the file exists.

But ldd on it shows the missing musl lib:

ldd /home/user/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer
        linux-vdso.so.1 (0x00007ffce3bfa000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5dc6a52000)
        libc.musl-x86_64.so.1 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5dc6661000)
        /lib/ld-musl-x86_64.so.1 => /lib64/ld-linux-x86-64.so.2 (0x00007f5dc8490000)

I had a VSCodium update yesterday so it might be related.

I have tried to uninstall the extension but it installs the same version.

romainreignier avatar Dec 21 '21 10:12 romainreignier

A similar problem exists on ArchLinux.

samueltardieu avatar Dec 21 '21 10:12 samueltardieu

Reverting to 0.2.853 works. So this seems specific to latest 0.2.867 version.

romainreignier avatar Dec 21 '21 10:12 romainreignier

@romainreignier what if you download https://github.com/rust-analyzer/rust-analyzer/releases/download/2021-12-20/rust-analyzer-linux-x64.vsix and install it using the Install from VSIX command?

lnicola avatar Dec 21 '21 10:12 lnicola

@lnicola It works!

romainreignier avatar Dec 21 '21 10:12 romainreignier

Works for me too using the package provided by @lnicola which links ~musl statically~ the glibc.

samueltardieu avatar Dec 21 '21 10:12 samueltardieu

@samueltardieu are you sure it links to musl and not glibc?

lnicola avatar Dec 21 '21 10:12 lnicola

I think it links to glibc:

 ldd ~/.vscode-oss/extensions/matklad.rust-analyzer-0.2.867/server/rust-analyzer
        linux-vdso.so.1 (0x00007ffd81e25000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fec466cf000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fec464b7000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fec46298000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fec45efa000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fec45b09000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fec480ce000)

romainreignier avatar Dec 21 '21 10:12 romainreignier

Yes, indeed, it links to glibc.

samueltardieu avatar Dec 21 '21 10:12 samueltardieu

I think what happens is that:

  • VS Code 1.61 added support for platform-specific dependencies
  • downloading the server binaries from GitHub is a bit of a pain for us (sometimes the releases don't get published and updates fail, some users with proxies have problems, coordinating between the nightly and stable builds is a bit of a pain, it's a large surface for supply chain attacks and so on)
  • we implemented https://github.com/rust-analyzer/rust-analyzer/issues/10483 in https://github.com/rust-analyzer/rust-analyzer/pull/11053
  • VSCodium uses Open VSX
  • rust-analyzer gets published to Open VSX somehow (there's an open issue, but we don't have an account there and I don't know how it gets there)
  • either Open VSX or the publishing process there doesn't support platform-specific extensions
  • VSCodium users get a random version

I don't think we want to give up on this change, but I don't know any easy fix either.

lnicola avatar Dec 21 '21 10:12 lnicola

vscode on ArchLinux is also using open-vsx:

$ jq .extensionsGallery < product.json
{
  "serviceUrl": "https://open-vsx.org/vscode/gallery",
  "itemUrl": "https://open-vsx.org/vscode/item"
}

samueltardieu avatar Dec 21 '21 10:12 samueltardieu

The vscode package registry is only allowed to be used by the vscode builds microsoft creates. These also contain a drm to make certain microsoft extensions work like the remote ssh, remote wsl and liveshare extensions. Any build from the source code in https://github.com/microsoft/vscode has to use an alternative package registry and isn't allowed to use these extensions.

bjorn3 avatar Dec 21 '21 10:12 bjorn3

I think we need to finally make an account on OVSX, and find someone to ping about the ovsx tool and backend.

lnicola avatar Dec 21 '21 10:12 lnicola

https://github.com/eclipse/openvsx/issues/336

lnicola avatar Dec 21 '21 11:12 lnicola

As a work-around, you can do one of these:

  • disable updates and update manually from a GitHub release every once in a while
  • use the non-free version of Code (on Arch, there's an AUR package for it, Ubuntu must have a snap)
  • install the language server separately (on Arch there's a community package) and set rust-analyzer.server.path

I wouldn't recommend using the third solution, because the old Code extension might not work very well with a newer server binary.

lnicola avatar Dec 21 '21 11:12 lnicola

thanks for these helpful comments! just wanted to add that v0.2.880 is also broken

najtin avatar Dec 28 '21 12:12 najtin

@najtin besides reverting https://github.com/rust-analyzer/rust-analyzer/issues/10483, there's not much we can do here. We could make a version with binaries for every platform, but currently we have no control over how things get published there.

I think this should be fixed on the Open VSX side. The maintainers there are aware of it.

lnicola avatar Dec 28 '21 12:12 lnicola

Quickest way to "fix" it for me was installing an older version from within VSCodium (also, disable auto updates) (rightclick extension > Install Another Version... > 0.2.853 worked for me)

mrchip2k avatar Jan 01 '22 11:01 mrchip2k

(deleted, this information was completely redundant as I got confused and forgot the last half of the initial issue description)

lukasjuhrich avatar Jan 04 '22 14:01 lukasjuhrich

For a quick status update: over at OpenVSX we are trying to remove the non-working versions to make the extension work at least, but are running into some issues on our end (see https://github.com/EclipseFdn/open-vsx.org/issues/814 & https://github.com/EclipseFdn/open-vsx.org/issues/816). I removed this extension from auto-publishing to OpenVSX (because of https://github.com/open-vsx/publish-extensions/issues/527) and hope to get the extension directly to OpenVSX back soon 🤞.

filiptronicek avatar Jan 10 '22 11:01 filiptronicek

Update: OpenVSX has now removed the newer versions. Now if you install it from there you will get an older, working version. I'll update the issue title accordingly.

lnicola avatar Jan 12 '22 09:01 lnicola

A corresponding PR for OpenVSX: https://github.com/eclipse/openvsx/pull/406

akosyakov avatar Jan 26 '22 09:01 akosyakov

There is a "no-server" vsix on the assets in releases. Would that version work for all platforms for the time being?

xsrvmy avatar Mar 01 '22 14:03 xsrvmy

@xsrvmy that one has no server and no download support for it. The idea is to use it if you're on an unsupported platform like 32-bit or some BSD. For the time being, you can download the VSIX for your platform, but you won't get automatic updates.

lnicola avatar Mar 01 '22 14:03 lnicola

Had the same issue. The fix worked for me.

huguesBouvier avatar Mar 01 '22 18:03 huguesBouvier

A corresponding PR for OpenVSX: eclipse/openvsx#406

Hello again everyone! I am pleased to announce that the blocking PR was merged about a half an hour ago.

What's next?

The steps neccesary for publishing are as follows:

  1. Create a claim ownership request in the https://github.com/EclipseFdn/open-vsx.org repo [1]
  2. Sign up for OpenVSX and get the required access token by following https://github.com/eclipse/openvsx/wiki/Publishing-Extensions (steps 1-3)
  3. Change the release workflow to allow publishing via ovsx - add the following two steps again, just replacing npx vsce with npx ovsx (also requires to change the name of the secret token, for example OPENVSX_TOKEN and adding it to your repository secrets).

https://github.com/rust-analyzer/rust-analyzer/blob/46d7ee68f26285db26b2640f2c07d6332380c756/.github/workflows/release.yaml#L249-L258

filiptronicek avatar Apr 04 '22 08:04 filiptronicek

Thank you @filiptronicek. I filed a claim in https://github.com/EclipseFdn/open-vsx.org/issues/952.

lnicola avatar Apr 09 '22 06:04 lnicola

@filiptronicek question: do we need a more recent version of ovsx for the new platform arguments? The last published one is from January.

lnicola avatar Apr 11 '22 19:04 lnicola

@lnicola thanks for noting the absent publish to NPM. It is indeed needed and I have let the team know, hopefully we'll see a release in the next few days.

filiptronicek avatar Apr 11 '22 19:04 filiptronicek

@filiptronicek has a new release been published? I just want to make sure this isn't forgotten.

Aloso avatar May 09 '22 22:05 Aloso

@Aloso it for sure hasn't. There's some other issues we are tackling at the moment, but it's still something we are aware about and working towards.

filiptronicek avatar May 10 '22 06:05 filiptronicek