Uh oh!
There was an error while loading. Please reload this page.
Check for unexpected cargo/rustc before install - #705
Conversation
meqif
commented
Sep 1, 2016
Hm, I didn't account for I worked around this issue in 3897c2a by filtering any path entry that contains ".multirust", but it feels hacky. |
Looking at Travis' build logs more closely, it seems a couple more entries in I'm not sure what to make of the test failures in Windows. I guess I'll boot up a virtual machine and debug it there. EDIT: I was trying to use |
brson
commented
Sep 3, 2016
Thanks at @meqif, and thanks for writing tests! From the various build failure here it's clear this needs to be considered carefully. Some observations: The windows failure might be because the you are filtering out paths ending with ".cargo/bin" and windows uses backslashes canonically; though I'd be a bit surprised if the For the error message I think we should print out the path to the binary that we found so that users can decide whether what rustup is thinking makes sense. Maybe it can say "of Rust at:", and the next line can print the path. I suspect this will look a bit ugly but it's a rare case so maybe it doesn't have to be beautiful (and rustup already has a lot of ui issues...). By setting The linux failures are interesting. The builders use a Rust not installed by rustup, so the test cases are finding those toolchains that are being used to test rustup and failing! Messy situation. The best idea I have to fix this is to use an environment variable just for the test suite to tell OK, I know that was a lot to digest, and it's kinda messy, but that's sorta the territory of this tool. Let me know if it makes sense. |
brson
commented
Sep 3, 2016
Oh, also I think it's fine to just filter out all paths containing ".multirust". |
meqif
commented
Sep 4, 2016
Thank you so much for the thoughtful feedback, @brson. 👍
That makes sense, you're probably right. I suppose it would have been fine if I used something like
Good idea. I was doing that during the development of the PR, but removed it because it did look a little ugly. Oh well, now it's back.
Ah, thank you. I wasn't aware there was such a significant difference. I ended up doing something similar to what you suggested. I checked where |
meqif
commented
Sep 4, 2016
There seems to be a (spurious?) issue with fetching one of |
meqif
commented
Sep 6, 2016
I tracked down that build issue and opened another pull request that fixes it: #711. |
brson
commented
Sep 6, 2016
Patch looks good to me! I think now that your rustls fixes are merged you'll need to rebase onto master to get travis to test this pr correctly. |
meqif
commented
Sep 6, 2016
Great! Let's hope nothing else goes wrong this time around. 💃 |
meqif
commented
Sep 8, 2016
The tests pass in every Travis target, but not in Windows: I assume I'm missing some special setup, but I'm not sure what it is. Any advice? |
Since only the interactive tests fail, but not the non-interactive one, I've been looking at the tests in So, I added a helper that makes the PATH modification and as |
Oh bother, they still fail on Windows — the installation doesn't abort like it should. Well, at least I learned something. |
I finally noticed that the file checks didn't account for |
bors
commented
Dec 11, 2016
☔ The latest upstream changes (presumably #850) made this pull request unmergeable. Please resolve the merge conflicts. |
bors
commented
Dec 12, 2016
☔ The latest upstream changes (presumably #842) made this pull request unmergeable. Please resolve the merge conflicts. |
brson
commented
Jan 7, 2017
Thanks for the rebase @meqif. The x86_64-pc-windows-gnu error looks legit. I haven't been able to reproduce it though because I don't have a working mingw environment :-/ |
bors
commented
Mar 27, 2017
☔ The latest upstream changes (presumably #1012) made this pull request unmergeable. Please resolve the merge conflicts. |
bors
commented
Mar 28, 2017
☔ The latest upstream changes (presumably #1005) made this pull request unmergeable. Please resolve the merge conflicts. |
Diggsey
commented
May 17, 2017
Hi @meqif, are you still looking into this? Would you like any help debugging the test failures? |
meqif
commented
May 18, 2017
Hi @Diggsey! I've been trying to reproduce the test failure on |
If RUSTUP_INIT_SKIP_PATH_CHECK is set to "yes", ignore the PATH checks for rustc and cargo. The variable is set to "yes" by default in clitools::env, and overriden in the relevant tests. Fixes#681
meqif
commented
Jun 10, 2017
Diggsey
commented
Jun 10, 2017
Looks good to me, but it's slightly worrying that this code will effectively be untested, since we have to disable the path check on CI, and if it goes wrong it will prevent rustup from being installed. @brson thoughts? |
brson
commented
Jun 24, 2017
meqif
commented
Jun 24, 2017
It was a long fight, but it was worth it. 💪 Thanks for merging! |
Hi!
This PR fixes#681, stopping the installation if rustc or cargo are found in any directory listed in
$PATHif rustup wasn't invoked with-y.Besides ignoring rustc and cargo if they exist in
$HOME/.cargo/bin, as described in #681, this PR also ignores them if they're found in$HOME/.multirust, a situation that popped up during testing. What do you think?I was also unsure about the error message, so I ended up copying a large portion from a similar situation in
do_pre_install_sanity_checks(if rustc_exists, to be specific). Better alternatives would be very appreciated.Finally, thank you for your work on rustup, it's a very nice tool. :)