Environment:
Hi there, I've been using rust-analyzer for a long time and it suddenly crashed on me after pressing update on vscode. The first thing I did was clean-reinstalling the extension which didn't work. Then, I clean installed vscode itself. Rust-analyzer still wouldn't activate.
After some searching, I found out how to enable logging in settings.json, and here's a picture on what the developer console showed me

I tried running /home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux --version
in my terminal and this was the output: -bash: /home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux: cannot execute binary file: Exec format error
What can I do to fix this issue? Thanks in advance for your help
Can you try running file /home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux?
@lnicola here's the output
/home/kingbri/.vscode-server/data/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux: data
Sounds like it's corrupted. Can you remove that file and try again?
Vscode prompted me to download the binary again. Same error still pops up and same output from the file command
Can you upload that file somewhere?
CC @Veetaha.
Here's the file
Same problem happen to me.
If I execute the command /home/kyasbal/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux --version directly, I could get an interesting log.
/home/kyasbal/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux: 1: Syntax error: ")" unexpected
I think this is just a --version for rust-analyzer, so I guess this command won't check syntax error of my code. I suspect this error happened inside of the command.
@bdashore3 weird, you file is indeed not executable. Can you download it manually from here and put it in the same location? https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-06-22
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโ
โ00000000โ f7 e1 81 45 79 ab 43 9f โ 90 91 bb ce c3 3d 4c ed โรรรEyรCรโรรรรร=Lรโ
โ00000010โ 9e 36 a4 cc 2f ca 65 19 โ d0 ce ec 27 c0 03 44 ac โร6รร/รeโขโรรร'รโขDรโ
โ00000020โ 4b 51 74 ab 14 47 64 c2 โ 2d 17 ed df ca ce ee 81 โKQtรโขGdรโ-โขรรรรรรโ
โ00000030โ a2 3b 46 83 a8 0d d6 3d โ ee 29 9f c7 43 63 16 5e โร;Fรร_ร=โร)รรCcโข^โ
โ00000040โ 84 4e 66 ca 91 62 8f 19 โ 92 e8 18 52 33 3a b0 93 โรNfรรbรโขโรรโขR3:รรโ
โ00000050โ b1 b6 88 85 22 08 28 d0 โ 98 65 38 03 ec 8c e9 43 โรรรร"โข(รโรe8โขรรรCโ
โ00000060โ 7e 9d 10 4e 22 05 f1 1a โ 28 f1 22 01 a4 f3 72 b1 โ~รโขN"โขรโขโ(ร"โขรรrรโ
โ00000070โ fb 52 93 39 32 91 e3 ed โ 35 19 7d 00 81 5b 45 5f โรRร92รรรโ5โข}0ร[E_โ
โ00000080โ a1 d9 0f 9e f5 47 56 3e โ d3 67 16 6a a2 3d c6 1b โรรโขรรGV>โรgโขjร=รโขโ
โ00000090โ dd 3d 3e 44 26 bf 57 2e โ 4b 30 90 75 2d 46 a0 ed โร=>D&รW.โK0รu-Fรรโ
โ000000a0โ 73 82 c0 a1 4c e4 b0 8c โ 0e ab 51 28 81 d6 60 0d โsรรรLรรรโโขรQ(รร`_โ
โ000000b0โ 95 b1 01 c6 ac 24 42 0c โ bd 42 2a dc 40 8f 93 d6 โรรโขรร$B_โรB*ร@รรรโ
โ000000c0โ 82 23 ea bf c7 9a 43 d9 โ 6b 18 85 1f 33 9a 1c 56 โร#รรรรCรโkโขรโข3รโขVโ
โ000000d0โ 2f bb 84 71 0e 19 1c 30 โ 27 89 7d 8d f2 9f 96 07 โ/รรqโขโขโข0โ'ร}รรรรโขโ
โ000000e0โ 93 ed 26 be 06 75 66 98 โ 58 0e 0f de 14 69 80 95 โรร&รโขufรโXโขโขรโขiรรโ
โ000000f0โ 8a d1 b8 b7 05 85 31 79 โ f2 2f 70 24 f1 9c 80 b4 โรรรรโขร1yโร/p$รรรรโ
โ00000100โ a6 db 10 32 8a d8 88 ee โ d8 f2 f1 b3 3a a4 62 60 โรรโข2รรรรโรรรร:รb`โ
โ00000110โ 74 8e 7a 22 57 2a 82 68 โ 67 4f 73 53 46 47 33 ac โtรz"W*รhโgOsSFG3รโ
โ00000120โ eb 06 8c 9b 98 09 0c f4 โ 56 83 0c 3a c6 3a 1d 36 โรโขรรร__รโVร_:ร:โข6โ
โ00000130โ a4 4a 34 a5 f7 61 cc 72 โ 68 43 d4 bf f5 08 bc 50 โรJ4รรaรrโhCรรรโขรPโ
โ00000140โ 41 61 c4 11 7c 72 0d c4 โ 7e fa 76 2a 54 6a d6 d8 โAaรโข|r_รโ~รv*Tjรรโ
โ00000150โ 48 f7 7e 28 29 fe de 4e โ 00 fd 1f 52 91 8c ce 38 โHร~()รรNโ0รโขRรรร8โ
โ00000160โ 13 7c 4e 28 9b 4c 6e ca โ 96 a1 37 39 c2 57 c8 0d โโข|N(รLnรโรร79รWร_โ
โ00000170โ 52 88 80 35 fe b0 11 1d โ dd 16 31 b2 cb d4 32 54 โRรร5รรโขโขโรโข1รรร2Tโ
โ00000180โ 12 c9 6a 30 74 9a 72 d2 โ 6f f2 a2 bf 82 09 a3 2e โโขรj0tรrรโoรรรร_ร.โ
โ00000190โ 1c ff 62 81 d3 f6 e2 19 โ 65 b8 da a5 23 b7 4b 2e โโขรbรรรรโขโeรรร#รK.โ
โ000001a0โ 7b 9b 45 92 95 76 35 b9 โ b3 fe 56 3d 14 aa 36 b0 โ{รEรรv5รโรรV=โขร6รโ
โ000001b0โ 61 4b 0e 08 63 f8 c6 dd โ e3 4c f7 ad e8 10 8e e6 โaKโขโขcรรรโรLรรรโขรรโ
โ000001c0โ 8f da 5e c9 7e 51 df 6c โ 0a b2 c0 22 ee 96 19 56 โรร^ร~Qรlโ_รร"รรโขVโ
It's also 27 949 394 instead of 27 966 344 bytes.
The vsix package or linux executable?
The linux exe
@kyasbal-1994 can you run file and ls -l on /home/kyasbal/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-linux and possibly upload it somewhere if it doesn't show up as rust-analyzer-linux: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=df68b161b4040e76f637e26e634244c2e2b073d6, stripped?
@bdashore3 the Linux executable. Make sure to run chmod +x on it, though.
Will do, I'll show the results once I get them
@lnicola Sure I will do that and report.
Anyway rust-analyzer works well if I downgraded to 0.2.207 which is the last version available on visual studio code extension menu. If there are someone just want to run rust-analyzer, you can use following link to downgrade the extension.
https://stackoverflow.com/questions/42626065/vs-code-rollback-extension-install-specific-extension-version
This might be related to #4963. I am not sure how tmp dir might affect the binary on WSL
@Inicola rust-analyzer --version works perfectly on the linux executable
@Veetaha Same issue happens on windows as well
Okay, thanks, I'll need to check this
This is weird. I downgrade rust-analyzer to previous version and updated again. Then it works with the latest version and rust-analyzer-linux seems to be valid Linux ELF binary.
@kyasbal-1994 should have tried that before :-).
It still errors out for me when downgrading/upgrading with the same error
It still errors out for me when downgrading/upgrading with the same error
Did you download rust-analyzer server after downgrading extension?
Yes, I did. The downgrade works perfectly, it's only version 0.2.215 that errors out
The file @bdashore3 uploaded is missing the first 16 950 bytes.
Downgrading worked for me as well.
I tried to remove rust-analyzer-mac but reinstalling the extension didn't trigger an installation of the binary.
I found the problem, we need a hotfix. We do skip the first chunks of the file....
This is very wierd beause on my machine (Ubuntu) it works even now, only in Windows Virtualbox this happens...
Running VSCode 1.46.1 on PopOs 20.04 which is based on Ubuntu 20.04.
Upgrading to 0.2.215 has basically disabled(?) rust-analyzer. No type hinting, no formatting. This is not only a windows problem.
Some specs here
OS: Pop!_OS 20.04 LTS x86_64
Kernel: 5.4.0-7634-generic
VSCode: 1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64
Please let me know any other ways I can help or other info you need from my machine.
This has been fixed in #4989. The fix will be published next week.
@jsj1027 this was just fixed. A new release will be available soon(ish) in the Marketplace.
This won't take a week, we will publish a patch today-or-tomorrow https://github.com/rust-analyzer/rust-analyzer/pull/4989#issuecomment-647668226
Most helpful comment
This won't take a week, we will publish a patch today-or-tomorrow https://github.com/rust-analyzer/rust-analyzer/pull/4989#issuecomment-647668226