-
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
Move build-std to Cargo.toml #10308
Move build-std to Cargo.toml #10308
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. Please see the contribution instructions for more information. |
5e45453
to
e6ebca1
Compare
b740bc7
to
9f812ae
Compare
a0e8bf3
to
51aa551
Compare
Thanks for the PR, but that internals discussion was generally meant as we're interested in moving some things rather than an enumerated list of "please move everything to Can you describe a bit more about why you don't think it's appropriate to configure this in |
I can think of one major reason:
|
@alexcrichton I’ve looked at @fee1-dead’s changes more closely and they also reveal one other important change that backs up his claim as far as fixing #9451 is concerned: using a |
This PR, if merged, would take 3 items off the phil-opp/blog_os#1063 checklist in one fell swoop, which is a dramatic step closer to getting the third edition published. See in particular this comment which basically echoes the whole point of this PR. |
I've now tested @fee1-dead's changes using the following project file layout and can confirm that I they do indeed fix #9451: build-std-test/Cargo.toml
build-std-test/custom.json
build-std-test/src/main.rs
Command line output
If this isn't proof that this PR fixes the problem, I don't know what is. |
I do kind of agree that moving everything to Cargo.toml wouldn’t be a good idea. Only those features which are critical to
This PR proves that exposing these mission-critical features to Cargo.toml is indeed possible. |
Can you please show me the previous discussion or why you personally think it shouldn't be moved to
Of course it was more complicated than "just move it to Cargo.toml". Before this PR, build-std simply resolved the standard library for the entire build, and then attached the dependency for all transitive dependencies including the root package. After this PR, we will first scan the relevant packages and see if build-std was set. We need to build a
|
Three days and a lot of tinkering later, it turns out there is an issue with the Cargo.toml approach to getting the build-std option enabled: dependencies don’t honor it. Added a couple of dependencies to my workspace that in turn managed to pull the
which generated a series of “unused manifest key” warnings despite compiling successfully. Perhaps this is why it why @alexcrichton wants it to remain on the CLI. With this in mind, however, this PR does introduce other changes that fix #9451 even if the changes that put |
Another problem I encountered: these changes, interestingly enough, actually break the bootloader crate, which was published by the reporter of #9451 (@phil-opp): when an attempt to run the |
@fee1-dead afaik there aren't discussions to point to, it's mostly been discussion in meetings from long ago. That being said my impression was the deletion of support of
Can you split those changes out of this PR? The changes to support the targets/etc in To be clear, you posted this PR with one major commit, little-to-no description, and referenced an internals discussion which didn't actually specifically talk about this setting but rather a general sense of it's ok to move some things on a case-by-case basis. Without reading and understanding your entire PR these sorts of details get lost very quickly. It's extremely helpful to have descriptive messages for commits, descriptive PR text, etc. It makes conveying what your PR does to reviewers much more efficient and effective. I would have to dig in more to understand the problems that @kennystrawnmusic is seeing, but I think it would be best to split this PR into two parts. One part would add |
Looking at the changes makes me inclined to think that would be a very tricky move because many of the #9451-fixing changes have a dependency on the very |
☔ The latest upstream changes (presumably #10245) made this pull request unmergeable. Please resolve the merge conflicts. |
A viable alternative to this (and one that would definitely satisfy @phil-opp's use case in particular) would be to allow developers to add something like this to .cargo/config.toml:
This is because the problem with the current implementation is that any overrides (e.g. custom targets, |
Update: nope, this panics. |
Thanks for the PR, but I'm going to be stepping down from the Cargo team so I'm going to un-assign myself from this. The Cargo team will help review this when they get a chance. |
r? @ehuss |
I'm going to close as this is likely not the approach we want to go with for now. Supporting As for getting build-std to specifically work with per-package-target, it looks like there is #10330 as a start to work on that alone. However, I suspect there is more work to get it fully supported. I think there is overlap with artifact-dependencies, and #10405 contains an outline of some of the work that needs to be done. |
This PR was exactly what I needed for my current project, too bad it wasn't accepted and I won't be able to use just one repository anymore :( |
Resolves #9451. Moves the unstable feature
build-std
toCargo.toml
per the Rust Internals discussion