-
Notifications
You must be signed in to change notification settings - Fork 894
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
Replace Windows custom toolchain hack #1499
Conversation
Does this fix #1197? |
Fallback Cargo is working for me on Windows both with and without this change. |
We need this over at https://github.com/rust-lang-nursery/rust-clippy to get Appveyor green again. It would be great if someone could review this! r? @Diggsey |
Disable dogfood under windows until rust-lang/rustup#1499 is merged
Hi @mikerite Are you interested in persuing this PR? If so, it needs rebasing as the codebase has been run through rustfmt since you created the change. Thanks, D. |
☔ The latest upstream changes (presumably #1576) made this pull request unmergeable. Please resolve the merge conflicts. |
When using a custom toolchain on Windows, Rustup ensures that the fallback Cargo calls the correct rustc executable by hardlinking cargo into an empty directory and executing it there. The problem with this method is that if cargo is invoked twice at the same time, the second invocation fails because it can't replace the hardlink which it is in use by the first. This occurs when an integration test itself invokes cargo. This commit replaces the hack by specifying the correct version of rustc by setting the RUSTC environment variable when cargo is invoked. This is set to the absolute path of rustc in the correct toolchain rather than the rustup wrapper. This is consistent with the way rustc is invoked on a normal toolchain on Windows.
@kinnison, I would still like this to be merged. I've rebased the changes. |
This looks sane to me, though I'm unsure about the exact semantics of dealing with this under Windows. Is there anyone with Windows experience able to 👍 this? |
I wonder if it would be possible to address the possible race here that's happening instead of setting RUSTC? I'd be a little worried that more tools other than Cargo expect I'll admit though that I don't know a ton about the underlying issue here, so it may not have an easy solution or one at all! |
This is only an issue for tools containing a For the tools managed by Existing fallback code only targets Cargo right now. |
I may be misunderstanding the issue, but isn't the point here that you're using a custom toolchain which only has |
That's right. |
I don't think I understand then what you mean by "tools containing a Also when you say "tools managed by |
By "tools containing By "tools managed by This PR only about |
Ok, well going back to my original point I don't think this is the right solution because I was trying to make sense of your response, but I think my original thoughts still stand. |
OK, let's close this. Thanks for taking the time to review. |
When using a custom toolchain on Windows, Rustup ensures that the
fallback Cargo calls the correct rustc executable by hardlinking cargo
into an empty directory and executing it there. The problem with this
method is that if cargo is invoked twice at the same time, the second
invocation fails because it can't replace the hardlink which it is in use
by the first. This occurs when an integration test itself invokes cargo.
This commit replaces the hack by specifying the correct version of rustc
by setting the RUSTC environment variable when cargo is invoked. This is
set to the absolute path of rustc in the correct toolchain rather than
the rustup wrapper. This is consistent with the way rustc is invoked on
a normal toolchain on Windows.