-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add suggestion to the "missing native library" error #103000
Conversation
r? @eholk (rust-highfive has picked a reviewer for you, use r? to override) |
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
@@ -0,0 +1,6 @@ | |||
error: could not find native static library `libfoo.a`, perhaps an -L flag is missing? | |||
| | |||
= help: only provide the library name `foo`, not the full filename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a shame we don't have span information here to point out the link
attr or ideally the "libfoo.a"
.
@@ -164,6 +164,7 @@ metadata_failed_write_error = | |||
|
|||
metadata_missing_native_library = | |||
could not find native static library `{$libname}`, perhaps an -L flag is missing? | |||
.help = only provide the library name `{$suggestedname}`, not the full filename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.help = only provide the library name `{$suggestedname}`, not the full filename | |
.help = only provide the library name `{$suggestedname}`, without the extension |
Is this better or worse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that it's more explicit about what is wrong, but unix platforms also have a "lib" prefix applied to the filename that the user also needs to remove and saying "without the prefix and extension" seems pretty wordy to me.
If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`. In this situation, we now detect that case and suggest the user only provide the library name itself.
3ce9c1c
to
097b6d3
Compare
Wonderful, thanks! @bors r+ rollup |
…piler-errors Add suggestion to the "missing native library" error If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`. In this situation, we now detect that case and suggest the user only provide the library name itself.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#103000 (Add suggestion to the "missing native library" error) - rust-lang#103006 (rustdoc: don't ICE on `TyKind::Typeof`) - rust-lang#103008 (replace ReErased with fresh region vars in opaque types) - rust-lang#103011 (Improve rustdoc `unsafe-fn` GUI test) - rust-lang#103013 (Add new bootstrap entrypoints to triagebot) - rust-lang#103016 (Ensure enum cast moves) - rust-lang#103021 (Add links to relevant pages to find constraint information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like
foo.lib
orlibfoo.a
when we expect them to simply providefoo
.In this situation, we now detect that case and suggest the user only provide the library name itself.