-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Panic when combining -Zbuild-std
with artifact dependencies
#10444
Comments
Thanks for the report! I forgot to open this issue. Handling build-std will likely take a little bit of refactoring, but shouldn't be too hard. An outline of the problem:
cc @Byron |
Oh, I should also link to #9451 which has essentially the same problem. It would be good to fix it for both scenarios at the same time. That also just needs to collect the list of additional targets that need to be built. |
Thanks a lot for the outline, this should help a lot when attempting a fix. Collecting a list of targets reliably is something that is also required for dependency and feature resolution, which I think is related to #10405 as it should mean that all targets to build for would be known as part of the crate metadata from the index.
My feeling is that collecting all targets there (and maybe even once) should be enough instead of having to collect them multiple times. Now, there probably is a reason that isn't the case (yet), but I thought I'd mention it here in case it's a possibility at all to avoid multiple dependency walks and repetition. |
I'm kind of unclear on how build-std should interact with bindeps. If you just wanted to build-std for the bindep, and wanted to use the shipped std for everything else, how would you express that? Alternatively if you wanted to build-std the top-level project but use the shipped std for the bindep, how would you express that? |
@bstrie Yeah, that is something that we still need to figure out. I proposed two possible solutions:
Do you have other ideas? (Maybe it makes sense to discuss this somewhere else to keep this issue thread clean?) |
Great, I just wanted to confirm that this is something that people are thinking about.
Sure, is there a tracking issue for that? WRT this issue, my main question is whether or not this is something that would need to be resolved before the stabilization of artifact dependencies, which I hope in my eternally boundless optimism might be thinkable in the near-ish term (or at least nearer than build-std seems to be). |
I have a project where I have a root package which has a
It seems like whatever resolved the dependencies for the sub package's build deps are being inferred to need |
This is a simplified minimal change, which changes the build-std to iterate over the packages to collect a list of targets std should be built for. Does the iterating over packages part have issues with artifact dependencies? I am not very familiar with artifact deps to know so any help would be appreciated. But it should be fine for now since artifact dependencies don't work with build-std yet. rust-lang#10444
This is a simplified minimal change, which changes the build-std to iterate over the packages to collect a list of targets std should be built for. Does the iterating over packages part have issues with artifact dependencies? I am not very familiar with artifact deps to know so any help would be appreciated. But it should be fine for now since artifact dependencies don't work with build-std yet. rust-lang#10444
This is a simplified minimal change, which changes the build-std to iterate over the packages to collect a list of targets std should be built for. Does the iterating over packages part have issues with artifact dependencies? I am not very familiar with artifact deps to know so any help would be appreciated. But it should be fine for now since artifact dependencies don't work with build-std yet. rust-lang#10444
This is a simplified minimal change, which changes the build-std to iterate over the packages to collect a list of targets std should be built for. Does the iterating over packages part have issues with artifact dependencies? I am not very familiar with artifact deps to know so any help would be appreciated. But it should be fine for now since artifact dependencies don't work with build-std yet. rust-lang#10444
fixes rust-lang#10444 by using the same `CompileKind`s that artifact dependencies produces
Had some time this morning and attempted a fix here #14480 which makes this work at least for usage in |
Since #14183 it now bails with error: And when
I believe the difference is simply that some targets have their target-spec metadata filled in and are thus caught by the new error catch, while the rest do not. |
@elchukc see https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/help.20debugging.20a.20docs.2Ers.20issue.20with.20a.20new.20cargo.20error/near/485698051 for a relevant discussion. |
Problem
The following panic happens when trying to
check
a project with an artifact dependency that usesbuild-std
:Steps
cargo new --lib artifact-dep-test
cd artifact-dep-test
cargo new --bin sub
Cargo.toml
, add the following dependency:x86_64-unknown-linux-gnu
, use your host architecture. (Specifying it explicitly is currently required forbuild-std
.)Possible Solution(s)
No response
Notes
The issue also happens on the latest
master
(commit 5f611af). The backtrace in debug mode is:Version
The text was updated successfully, but these errors were encountered: