-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
bootstrap: Merge the libtest build step with libstd #63637
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
290ef7f
to
ec71d80
Compare
r=me with the dependencies published (instead of git deps). |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #63470) made this pull request unmergeable. Please resolve the merge conflicts. |
This commit updates the support necessary for this crate to be built as a dependency of `getopts` which is a dependency of the `test` crate which is built in rust-lang/rust. This change will be required to land rust-lang/rust#63637 where Rust's build system is being tweaked slightly. This is intended to not have any impact on other users of this crate and the `Cargo.toml` features here should only be used by Rust's own build system.
This commit updates the support necessary for this crate to be built as a dependency of `getopts` which is a dependency of the `test` crate which is built in rust-lang/rust. This change will be required to land rust-lang/rust#63637 where Rust's build system is being tweaked slightly. This is intended to not have any impact on other users of this crate and the `Cargo.toml` features here should only be used by Rust's own build system.
404933c
to
92bec03
Compare
@crlf0710 I contacted you on discord as well, but mind transferring https://crates.io/crates/rustc-std-workspace-std to me? |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
92bec03
to
9534886
Compare
@alexcrichton i don't mind. is there any instructions on what do i need to do? |
📌 Commit 9534886ce8448c705680eb647d458dd706d8313e has been approved by |
7a4fdb6
to
150a977
Compare
@bors: r=Mark-Simulacrum |
📌 Commit 150a977629da0b00c29bf05d1bac858983a7e255 has been approved by |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Since its inception rustbuild has always worked in three stages: one for libstd, one for libtest, and one for rustc. These three stages were architected around crates.io dependencies, where rustc wants to depend on crates.io crates but said crates don't explicitly depend on libstd, requiring a sysroot assembly step in the middle. This same logic was applied for libtest where libtest wants to depend on crates.io crates (`getopts`) but `getopts` didn't say that it depended on std, so it needed `std` built ahead of time. Lots of time has passed since the inception of rustbuild, however, and we've since gotten to the point where even `std` itself is depending on crates.io crates (albeit with some wonky configuration). This commit applies the same logic to the two dependencies that the `test` crate pulls in from crates.io, `getopts` and `unicode-width`. Over the many years since rustbuild's inception `unicode-width` was the only dependency picked up by the `test` crate, so the extra configuration necessary to get crates building in this crate graph is unlikely to be too much of a burden on developers. After this patch it means that there are now only two build phasese of rustbuild, one for libstd and one for rustc. The libtest/libproc_macro build phase is all lumped into one now with `std`. This was originally motivated by rust-lang/cargo#7216 where Cargo was having to deal with synthesizing dependency edges but this commit makes them explicit in this repository.
150a977
to
b47c969
Compare
@bors: r=Mark-Simulacrum |
📌 Commit b47c969 has been approved by |
…acrum bootstrap: Merge the libtest build step with libstd Since its inception rustbuild has always worked in three stages: one for libstd, one for libtest, and one for rustc. These three stages were architected around crates.io dependencies, where rustc wants to depend on crates.io crates but said crates don't explicitly depend on libstd, requiring a sysroot assembly step in the middle. This same logic was applied for libtest where libtest wants to depend on crates.io crates (`getopts`) but `getopts` didn't say that it depended on std, so it needed `std` built ahead of time. Lots of time has passed since the inception of rustbuild, however, and we've since gotten to the point where even `std` itself is depending on crates.io crates (albeit with some wonky configuration). This commit applies the same logic to the two dependencies that the `test` crate pulls in from crates.io, `getopts` and `unicode-width`. Over the many years since rustbuild's inception `unicode-width` was the only dependency picked up by the `test` crate, so the extra configuration necessary to get crates building in this crate graph is unlikely to be too much of a burden on developers. After this patch it means that there are now only two build phasese of rustbuild, one for libstd and one for rustc. The libtest/libproc_macro build phase is all lumped into one now with `std`. This was originally motivated by rust-lang/cargo#7216 where Cargo was having to deal with synthesizing dependency edges but this commit makes them explicit in this repository.
☀️ Test successful - checks-azure |
Tested on commit rust-lang/rust@4784645. Direct link to PR: <rust-lang/rust#63637> 💔 miri on windows: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra). 💔 miri on linux: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
@@ -10,8 +10,22 @@ path = "lib.rs" | |||
crate-type = ["dylib", "rlib"] | |||
|
|||
[dependencies] | |||
getopts = "0.2.19" | |||
getopts = { version = "0.2.21", features = ['rustc-dep-of-std'] } |
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.
So this should allow libtest to easily depend on dependencies from crates.io as long as they have a:
#[dependencies]
std = { version = "1.0", package = "rustc-std-workspace-std", optional = true }
core = { version = "1.0", package = "rustc-std-workspace-core", optional = true }
#[feature]
rustc-dep-of-std = ['std', 'core']
in their Cargo.toml ?
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.
Mostly, i think everything in their dependency tree needs to have this.
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.
see also #63725.
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.
250: fix for latest rustc r=jethrogb a=RalfJung Fixes xargo for rust-lang/rust#63637 251: cargo update r=jethrogb a=RalfJung Co-authored-by: Ralf Jung <[email protected]>
Update from rust-lang/rust#63637.
Since its inception rustbuild has always worked in three stages: one for
libstd, one for libtest, and one for rustc. These three stages were
architected around crates.io dependencies, where rustc wants to depend
on crates.io crates but said crates don't explicitly depend on libstd,
requiring a sysroot assembly step in the middle. This same logic was
applied for libtest where libtest wants to depend on crates.io crates
(
getopts
) butgetopts
didn't say that it depended on std, so itneeded
std
built ahead of time.Lots of time has passed since the inception of rustbuild, however,
and we've since gotten to the point where even
std
itself is dependingon crates.io crates (albeit with some wonky configuration). This
commit applies the same logic to the two dependencies that the
test
crate pulls in from crates.io,
getopts
andunicode-width
. Over themany years since rustbuild's inception
unicode-width
was the onlydependency picked up by the
test
crate, so the extra configurationnecessary to get crates building in this crate graph is unlikely to be
too much of a burden on developers.
After this patch it means that there are now only two build phasese of
rustbuild, one for libstd and one for rustc. The libtest/libproc_macro
build phase is all lumped into one now with
std
.This was originally motivated by rust-lang/cargo#7216 where Cargo was
having to deal with synthesizing dependency edges but this commit makes
them explicit in this repository.