-
Notifications
You must be signed in to change notification settings - Fork 858
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
Running multiple cargos simultaneously with linked toolchain under windows #2889
Comments
So I found a workaround to this for custom toolchains We can't use rustup component since this is a custom toolchain, but we can use x.py
Typically the toolchain ends up in build\x86_64-pc-windows-msvc\stage2
(Note x.py install doesn't work too well under windows so it's easier just to do it this way) At this point when linking to the toolchain via rustup it should find the pre-built cargo instead of using the fallback one so avoids problems with rust-analyser under VSCode, also it allows for rustfmt to be used as well |
One workaround I've found is to copy This is pretty much the same as @grbd, but avoids having to compile rust yourself. |
Realistically this stems from https://github.com/rust-lang/rustup/blob/master/src/toolchain.rs#L620-L633 which currently only supports a single fallback path for cargo. If, instead, we created a unique fallback path for this toolchain, and then cleaned up when the proxy exited, we'd stand a better chance of things. To do this, we'd need to:
In order that the fallback is not cleaned up too early, the toolchain would have to be returned from https://github.com/rust-lang/rustup/blob/master/src/config.rs#L922 and then only dropped after the command has run. This ought to be fairly straightforward (though not trivial) to implement and test. |
Is there a workaround for this I'm not understanding until it gets fixed? |
Unfortunately I don't have a good suggestion. Perhaps someone else who does a lot of work with linked toolchains on Windows might be able to suggest something. |
Copy cargo into the tool chain as mentioned above.
|
To elaborate, you can find the directory it's searching for the cargo tool using If it says "not a file", then you can copy cargo into that directory from nightly. |
Hi,
I've recently been developing an embedded project under windows for the ESP32
As part of this I need to use a custom toolchain and link it in
https://github.com/esp-rs/rust
This all seems to work fine but some tools try to run cargo multiple times at the same time
and under windows if this happens and the toolchain is linked it seems to result in
This might be related / the same thing I'm not sure
#1137
rust-analyser
In the case of rust-analyser I believe it runs "cargo check" and "cargo metadata"
at the same time while it's scanning the source
rust-lang/rust-analyzer#10674
cargo make
With cargo make if I set RUSTUP_TOOLCHAIN="esp" as part of the cargo make script it works fine
If i try and use a rust-toolchain.toml file it seems to fail
The same for directory overrides
rustup details
rustup --version
rustup show
The text was updated successfully, but these errors were encountered: