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

Provide a better error message when the target sysroot is not installed #37131

Closed
brson opened this issue Oct 12, 2016 · 2 comments · Fixed by #37424
Closed

Provide a better error message when the target sysroot is not installed #37131

brson opened this issue Oct 12, 2016 · 2 comments · Fixed by #37424
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Oct 12, 2016

Today when you compile for a target that does not exist rustc gives the standard message for failing to find a crate, for std. We can and should be more explicit about what this means. Actually what is almost certainly happening is that you don't have that target installed:

$ rustc --target=asmjs-unknown-emscripten hello.rs
error[E0463]: can't find crate for `std`

error: aborting due to previous error 

It could instead say:

$ rustc --target=asmjs-unknown-emscripten hello.rs
error[E0463]: can't find crate for `std`
note: the `asmjs-unknown-emscripten` target is not installed

error: aborting due to previous error 

A reasonable heuristic for printing this might be if the crate is named std or core and the sysroot is not overridden.

@brson brson added A-diagnostics Area: Messages for errors, warnings, and lints I-papercut E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Oct 12, 2016
@omern1
Copy link
Contributor

omern1 commented Oct 14, 2016

@brson When I run rustc --target=asmjs-unknown-emscripten hello.rs on rustc 1.14.0-nightly (ad19c32a5 2016-10-06) I get the error: error: Could not create LLVM TargetMachine for triple: asmjs-unknown-emscripten: No available targets are compatible with this triple.

@shiver
Copy link
Contributor

shiver commented Oct 27, 2016

I would like to try my hand at this if no one else has picked it up already.

I am fairly new to rust, so I might need some assistance getting the pull request into a something resembling a reasonable state.

bors added a commit that referenced this issue Nov 17, 2016
Improved error reporting when target sysroot is missing.

Attempts to resolve #37131.
This is my first pull request on rust, so I would greatly appreciate any feedback you have on this.

Thanks!
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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants