-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Build std with panic = "abort" errors with a bunch of duplicated lang items #15347
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
Comments
Probably makes sense to have a specialized error message when loading |
Triage: Since for this particular issue it is needed to parse Cargo.toml, I think this should be moved to the cargo repo, right? Cargo knows what is in Cargo.toml and what is passed to -Z build-std=..., so it knows when to report a nice error. |
I think it would make sense for cargo to not allow this, if it does have all the necessary knowledge. But it would also be nice for rustc to detect cases like this better (I've also encountered this in other cursed cases). |
I'm sure there are ways to improve the error message (although personally I think it is quite informative already), but as the original issue was written, I think it needs to be moved to the cargo project. Keeping the issue in this issue track makes the cargo people not see it. If it was easy to file a corresponding high-quality issue intended for the rust repo I would do it, but unfortunately it's not clear to me how to write such an issue and make it high quality. For example: I lack awareness of a concrete example for easy reproduction without using cargo. |
I'm just curious that why we don't have panic related things rebuilt when using -Zbuild-std? |
@rustbot transfer cargo |
I'm going to close as this is generally a known problem tracked in rust-lang/wg-cargo-std-aware#29 and rust-lang/wg-cargo-std-aware#31. |
And also #7359, which is exactly the same issue. |
Uh oh!
There was an error while loading. Please reload this page.
Code
The nightly version is not important, it's only what I was testing on.
Current output
A bunch of these:
Desired output
A nice message that said
panic_abort
must be included inbuild-std
if compiled withpanic = "abort"
.Rationale and extra context
From @Nilstrieb:
rustc can't find a
panic_abort
in your self-built standard library, so it falls back to loadingpanic_abort
from the sysroot. But that sysrootpanic_abort
then also brings in the rest of the sysroot, includingcore
, so now you have two cores, one from your target dir and one from your sysroot. This is bad.Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: