Skip to content
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

Error message for missing linker on MSVC is not actionable #39044

Closed
K900 opened this issue Jan 13, 2017 · 3 comments
Closed

Error message for missing linker on MSVC is not actionable #39044

K900 opened this issue Jan 13, 2017 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. E-help-wanted Call for participation: Help is requested to fix this issue. O-windows Operating system: Windows O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@K900
Copy link

K900 commented Jan 13, 2017

Inspired by this Reddit comment.

Right now, when rustc can't find the linker, it produces a pretty generic error message that explains what went wrong, but doesn't explain how to fix it. A solution might be to extend the error message with something like "Do you have Visual C Build Tools installed? Check http://doc.rust-lang.org/some/place for more info." and provide a page explaining what exactly is missing and how to get it somewhere in the docs.

@steveklabnik steveklabnik added A-diagnostics Area: Messages for errors, warnings, and lints I-papercut labels Jan 13, 2017
@brson
Copy link
Contributor

brson commented Jan 13, 2017

Rust can be better about this generally, not just with MSVC, but yes, somewhere in the stack, some tool should be giving a better hint about what to do here. This is one of the most common failure modes for new installs.

Same situation applies for all targets and plattforms. In the MSVC case it's pretty easy to imagine what sort of direction to give, but if we start thinking about other configs it gets more difficult since it's not clear which part of the toolchain is responsible for these external deps, and the exact procedure for getting the deps depends on the platform and cross scenario.

As a starting point I would suggest that rustc, before it executes any external tools, should check that it exists, and if not, punt to some more helpful error routine, which can be expanded over time for more scenarios. We can start with the common MSVC link.exe failure.

@brson brson added E-help-wanted Call for participation: Help is requested to fix this issue. O-windows Operating system: Windows A-linkage Area: linking into static, shared libraries and binaries labels Jan 13, 2017
@retep998 retep998 added the O-windows-msvc Toolchain: MSVC, Operating system: Windows label Jan 13, 2017
@steveklabnik steveklabnik added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 9, 2017
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed I-papercut labels Jul 26, 2017
@ChrisDenton
Copy link
Contributor

Is this still an issue? I note that Rust now has some helpful messages for when the MSVC linker isn't found or returns unexpected output. E.g. here and here.

@K900
Copy link
Author

K900 commented Jul 2, 2021

Looks like we can close this then.

@K900 K900 closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. E-help-wanted Call for participation: Help is requested to fix this issue. O-windows Operating system: Windows O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants