willcrichton / flowistry

Flowistry is an IDE plugin for Rust that helps you focus on relevant code.
https://marketplace.visualstudio.com/items?itemName=wcrichton.flowistry
MIT License
1.91k stars 45 forks source link

`Error: spawn cargo ENOENT` after applying the fix when installing in vscode #72

Open cidit opened 1 year ago

cidit commented 1 year ago

Problem

when i install the extension in vscode, i get the error prompt telling me to apply as expected. however, after applying the fix and clicking continue on the popup, i get the following error, and the extension doesnt start.

Logs

OS: linux (6.2.10-200.fc37.x86_64) VSCode: 1.77.3 Error message

Error: spawn cargo ENOENT

Full log: https://paste.rs/IoQ

cidit commented 1 year ago

oh, actually, after peeking at the logs, i think i see what the problem is. im using an alternative shell.

cidit commented 1 year ago

nope, rustc -Vv works in my sh environment and produces the following output:

sh-5.2$ rustc -Vv
rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: x86_64-unknown-linux-gnu
release: 1.68.2
LLVM version: 15.0.6

im not sure what's going wrong.

willcrichton commented 1 year ago

Thanks for the report. What is the output of this command?

$(rustup which --toolchain nightly-2023-04-12 rustc) -vV
cidit commented 1 year ago

that would be the following when called in sh

sh-5.2$ $(rustup which --toolchain nightly-2023-04-12 rustc) -vV
rustc 1.70.0-nightly (9df3a39fb 2023-04-11)
binary: rustc
commit-hash: 9df3a39fb30575d808e70800f9fad5362aac57a2
commit-date: 2023-04-11
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.2
willcrichton commented 1 year ago

I'm guessing this is an issue where the PATH used by VSCode is not the same as the PATH used by your normal shell. Not sure off-hand why this is happening, but I will take a look into it.

echochamber commented 1 year ago

I got the same issue. Not urgent, just sharing in case more info is helpful. I love what you've made here!

Looks like the above command outputs the same for me as it did for cidit:

rustc 1.70.0-nightly (9df3a39fb 2023-04-11)
binary: rustc
commit-hash: 9df3a39fb30575d808e70800f9fad5362aac57a2
commit-date: 2023-04-11
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.2
cidit commented 1 year ago

Speaking of, @willcrichton did you get the chance to look into it?

willcrichton commented 1 year ago

Not yet, I will keep y'all posted in this thread once I've located the issue.

hpux735 commented 1 year ago

For me, following the "build from source" installation process worked. I have an M1 mac. @cidit are you on an M1 mac?

cidit commented 1 year ago

afraid not @hpux735 . im on a framework

cidit commented 1 year ago

i'll try to build from source tho, seemed like too much trouble at the time but i'll give it another shot.

hpux735 commented 1 year ago

It was very straightforward. I think it took 5 minutes, max.