Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

Make it more clear that user need MSVC for MSVC versions #50

Open
bombless opened this issue Mar 17, 2016 · 12 comments
Open

Make it more clear that user need MSVC for MSVC versions #50

bombless opened this issue Mar 17, 2016 · 12 comments

Comments

@bombless
Copy link

cc rust-lang/rust#32283

@bombless
Copy link
Author

I checked the msi folder and I feel that I may need a little help for this.
Do you have any idea how this could be done, @brson ?

@bombless
Copy link
Author

I guess we can add a warning dialog at the very beginning.
Checking how to do this..

@vadimcn
Copy link
Contributor

vadimcn commented Mar 17, 2016

I guess we can add a warning dialog at the very beginning.

I think that modifying the download page on rust-lang.org would be both easier and more useful, as the users would have this info before downloading the package. Also, I am not a fan of unconditionally adding extra UI in the installer.

@bombless
Copy link
Author

@vadimcn But if you get the installer from some where else, which is normal for us, users from mainland China where network is terrible, you will not see notes from website.
Besides, it could be normal that people never check instructions from website if English is not their mother tongue.

@bombless
Copy link
Author

Well I think we can do both way, and make the notice from the installer less annoying than what I considered.

@bombless
Copy link
Author

FYI I'm checking this doc https://msdn.microsoft.com/en-us/library/aa243959

@bombless
Copy link
Author

It might be possible that we can checked the exit code when we call exec on link.exe, and provide some info there. Say, do our best not to surprise new comers.
I might start from there since I'm more familiar with the rustc repo.

@nagisa
Copy link

nagisa commented Mar 17, 2016

I don’t think reporting this during installation is not suitable at all. We only really need MSVC toolchain post translation phase, you can still do a lot without MSVC: generating docs, running all stages up-to-translation, perhaps running miri(nterpretator) and so on and on.

Personally it seems to me like the best thing to do would be to just emit a error message when we reach stages dependent on MSVC:

error: MSVC installation could not be detected
help: where to find the MSVC or how to help rustc find it

@retep998
Copy link

Perhaps I should add a message to rust-lang/rust#31158 in the case where an MSVC installation could not be detected?

@brson
Copy link
Contributor

brson commented Mar 17, 2016

Here's what the website says on the subject.

@retep998 I do think it would be appropriate for rustc to generally handle missing linkers better, without teaching it about how to acquire linkers. For example, rustc could easily know before compilation that it is going to fail because the linker doesn't exist. It could do this detection at startup and display a nice message, perhaps even with simple platform-specific advice.

I also think it would be appropriate for the MSVC msis to somewhere indicate that MSVC is required, with a download link. Like @vadimcn I don't think it merits a new dialog, but if it were added as text as the final success message seems ok. No extra clicks, just an important note that they may have missed.

This sort of native toolchain detection is also intended to be part of rustup. Though rustup is primarily intended to deal with cross-compiling, it will similarly be probing for native linkers.

cc @alexcrichton

@retep998
Copy link

@brson A really tricky issue is when someone is cross compiling from 64 to 32 or 32 to 64 bit on windows, especially when using build scripts. Right now the only way this works is if rustc is responsible for finding the linker, because link.exe is a single target linker. If you use vcvars or equivalent to set it up then either the build script built for the host or the final binary built for the target will be linked with the wrong linker and stuff will fail. If logic is added higher up then it needs to be able to handle passing the correct linker to the correct rustc invocation.

@bombless
Copy link
Author

https://chocolatey.org/packages?q=visualstudio I see that you can install MSVC from Chocolatey. So I think cargo-install can do something similar. Long story short, we can provide a checkbox in the installer to install MSVC automatically.

retep998 added a commit to retep998/rust that referenced this issue Jun 28, 2016
Should fix a few more edge cases

Fixes rust-lang#31151
Fixes rust-lang#32159
Fixes rust-lang#34484
Improves rust-lang-deprecated/rust-packaging#50

Signed-off-by: Peter Atashian <retep998@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants