-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improved error messages for linking failure #47052
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Oh I see, I can't use TODO comments. I'll take them out for now. |
@fschutt you'll need to modify r=me after the test is fixed. |
It's rebased now and test should be fixed. I would say that the other things (like printing library paths, extra help, etc.) can be done in a seperate PR. r? @estebank |
@bors r+ rollup |
📌 Commit f78dd66 has been approved by |
⌛ Testing commit f78dd66c77db34b92cba5499f30a699cdf6332fa with merge b889e175a36bf1d4bf371769bd3a0d1c5bfdd709... |
💔 Test failed - status-travis |
This is a problem in cargo, not rustc. Basically, in
... so the change in the error message breaks the build. Will do a seperate PR to cargo, because I think this is the only way to fix this. |
Update cargo tests for rust-lang/rust#47052 This test message currently breaks the build. The old error message was: ``` error: could not exec the linker `cc`: No such file or directory (os error 2) | = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "hello.hello0.rcgu.o" "hello.hello1.rcgu.o" "-o" "hello" "hello.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d3700976135c3f09.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-8a207564cfc9f224.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-4712d699ce2d50e5.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-7224935811a361fe.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-3343c92f30e63266.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-6e8aafa8bd1a67de.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-a8b7c0565b6366c3.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-512049fc390dec2e.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-ba1f12eb6cef9a1a.rlib" "/home/felix/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-53aab67ab6317c59.rlib" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util" error: aborting due to previous error ``` The new error message is: ``` error: linker `cc` not found | = note: No such file or directory (os error 2) error: aborting due to previous error ``` This currently breaks rust-lang/rust#47052. **NOTE:** I don't know if I handled the "ticks" around the linker name correctly (if cargo test is smart enough to see that the ticks are part of the omitted part). My reasoning was that in the rustc code the ticks are in the source and not part of the linkers name - so if rustc changes, this will probably break again. EDIT: fixed error message
@bors r+ |
@fschutt: 🔑 Insufficient privileges: Not in reviewers |
Sorry. The fix is merged in cargo now, I just wanted to retry. |
@bors r=estebank |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit f78dd66 has been approved by |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit f78dd66 has been approved by |
⌛ Testing commit f78dd66c77db34b92cba5499f30a699cdf6332fa with merge 7025aea940b8ac199e35a0ea197914848e5b81b9... |
💔 Test failed - status-appveyor |
@fschutt the cargo dependency in this repo doesn't track master in the cargo repo, it has to be manually updated with a PR (like #47051). There was a file |
@estebank The new instructions for rls, rustfmt, miri and clippy are in https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#breaking-tools-built-with-the-compiler. Basically, the PR author doesn't need to care about these tools anymore. If they are broken after merging the PR, somebody else (the tool maintainers) can clean up the mess afterwards. Cargo is unaffected by toolstate.toml though, before or now. It can never be broken. @fschutt Since the "cargo fix" (rust-lang/cargo#4871) has already been merged on the cargo side, you just need to update the cargo submodule, and then create a separate PR or push a commit here. cd src/tools/cargo
git checkout master
git pull origin master --ff-only
cd ../..
cargo update -p cargo
git add Cargo.lock tools/cargo
git ci -m 'Update cargo' |
@kennytm Done - should I squash this with the previous commit or rather leave it seperate? I'd personally leave it seperate so that it's clear when cargo was updated. |
@fschutt Keep it separate, thanks. |
@bors r=estebank rollup- |
📌 Commit aae8c29 has been approved by |
@bors r+ |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit aae8c29 has been approved by |
🔒 Merge conflict |
I'm not really sure where the merge conflict was ... |
@fschutt Maybe # assume origin = https://github.com/rust-lang/rust.git
# and fschutt = git@github.com:fschutt/rust.git
git pull origin master --rebase
git push fschutt master -f |
…lled It's unnecessary to print the linker options if there is no linker installed. Currently, for libraries, the output is still printed, see #46998 for discussion
Git said that there was a merge conflict in I rebased and pushed as you said - Git did not complain about anything here, no merge conflict during the rebase. Hope this fixes it. |
@bors r+ |
📌 Commit 7c13fa3 has been approved by |
happy new year, by the way |
Improved error messages for linking failure Partial fix for #46998 It's unnecessary to print the linker options if there is no linker installed in the first place. Currently, for libraries, the output is still printed, but that should be cleaned up in the future. If you don't have gcc or g++ installed, so that no linker is installed on the system, the output is now this: ``` $ ./rustc hello.rs error: linker `cc` not found | = note: No such file or directory (os error 2) error: aborting due to previous error ``` For libraries, the linker arguments are still printed, but they should be cleaned up in further commits.
☀️ Test successful - status-appveyor, status-travis |
Add compiler docs testing to CI. Fixes #47025. I don't know if `x86_64-gnu` is the right builder for this, but there seems to be time left on [Travis](https://travis-ci.org/rust-lang/rust/jobs/307488864). Remaining problems blocking this PR: - [x] broken links caused by rustdoc issues: - [x] `pub use self::Enum::...`: #46766 and #46767 (fixed by #47050, thanks @ollie27!) - [x] `impl Deref for DerefToStdType`: #32129 (ignored in linkchecker) - [x] `#[feature(decl_macro)]` and `use std::vec`: #47038 (ignored in linkchecker) - [x] `rustc_data_structures::sync::{Lrc, RwLock}` aliases `std` types: #32130 (ignored in linkchecker) - [x] markdown differences, in rust repository and in external crates, now failing the build with #46880 merged (all fixed) - [x] multiple crate updates needed: `rand`, `log`, `parking_lot_core`, `flate2` - [x] submodule updates needed to deduplicate dependencies: `rust-installer`, ~`cargo`~ (done by #47052) - [x] #44953 test broken by `log` update (removed, this can be controversial) - [x] Waiting `x86_64-gnu` build results ([done](https://travis-ci.org/rust-lang/rust/builds/323451069)) See individual commits for more details.
Partial fix for #46998
It's unnecessary to print the linker options if there is no linker installed in the first place. Currently, for libraries, the output is still printed, but that should be cleaned up in the future. If you don't have gcc or g++ installed, so that no linker is installed on the system, the output is now this:
For libraries, the linker arguments are still printed, but they should be cleaned up in further commits.