Skip to content

Commit 20a6f3a

Browse files
committed
Auto merge of #97513 - jyn514:submodule-handling, r=Mark-Simulacrum
Fully remove submodule handling from bootstrap.py These submodules were previously updated in python because Cargo gives a hard error if toml files are missing from the workspace: ``` error: failed to load manifest for workspace member `/home/jnelson/rust-lang/rust/src/tools/rls` Caused by: failed to read `/home/jnelson/rust-lang/rust/src/tools/rls/Cargo.toml` Caused by: No such file or directory (os error 2) failed to run: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /home/jnelson/rust-lang/rust/src/bootstrap/Cargo.toml ``` However, bootstrap doesn't actually need to be part of the workspace. Remove it so we can move submodule handling fully to Rust, avoiding duplicate code between Rust and Python. Note that this does break `cargo run`; it has to be `cd src/bootstrap && cargo run` now. Given that we're planning to make the main entrypoint a shell script (or rust binary), I think this is a good tradeoff for reduced complexity in bootstrap.py. To get this working, I also had to remove support for vendoring when using the git sources, because `cargo vendor` requires all submodules to be checked out. I think this is ok; people who care about this are likely already using the pre-vendored `rustc-src` tarball. Fixes #90764. Helps with #94829
2 parents 9cf699d + 81482e6 commit 20a6f3a

File tree

9 files changed

+757
-228
lines changed

9 files changed

+757
-228
lines changed

Cargo.lock

+5-67
Original file line numberDiff line numberDiff line change
@@ -215,32 +215,6 @@ dependencies = [
215215
"byte-tools",
216216
]
217217

218-
[[package]]
219-
name = "bootstrap"
220-
version = "0.0.0"
221-
dependencies = [
222-
"cc",
223-
"cmake",
224-
"filetime",
225-
"getopts",
226-
"hex 0.4.2",
227-
"ignore",
228-
"libc",
229-
"num_cpus",
230-
"once_cell",
231-
"opener",
232-
"pretty_assertions 0.7.2",
233-
"serde",
234-
"serde_json",
235-
"sha2",
236-
"sysinfo",
237-
"tar",
238-
"toml",
239-
"walkdir",
240-
"winapi",
241-
"xz2",
242-
]
243-
244218
[[package]]
245219
name = "bstr"
246220
version = "0.2.13"
@@ -735,15 +709,6 @@ dependencies = [
735709
"rustc-semver",
736710
]
737711

738-
[[package]]
739-
name = "cmake"
740-
version = "0.1.44"
741-
source = "registry+https://github.com/rust-lang/crates.io-index"
742-
checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb"
743-
dependencies = [
744-
"cc",
745-
]
746-
747712
[[package]]
748713
name = "colored"
749714
version = "2.0.0"
@@ -1023,9 +988,9 @@ dependencies = [
1023988

1024989
[[package]]
1025990
name = "ctor"
1026-
version = "0.1.15"
991+
version = "0.1.22"
1027992
source = "registry+https://github.com/rust-lang/crates.io-index"
1028-
checksum = "39858aa5bac06462d4dd4b9164848eb81ffc4aa5c479746393598fd193afa227"
993+
checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c"
1029994
dependencies = [
1030995
"quote",
1031996
"syn",
@@ -2683,9 +2648,9 @@ checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
26832648

26842649
[[package]]
26852650
name = "output_vt100"
2686-
version = "0.1.2"
2651+
version = "0.1.3"
26872652
source = "registry+https://github.com/rust-lang/crates.io-index"
2688-
checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
2653+
checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66"
26892654
dependencies = [
26902655
"winapi",
26912656
]
@@ -2944,18 +2909,6 @@ version = "0.1.1"
29442909
source = "registry+https://github.com/rust-lang/crates.io-index"
29452910
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
29462911

2947-
[[package]]
2948-
name = "pretty_assertions"
2949-
version = "0.7.2"
2950-
source = "registry+https://github.com/rust-lang/crates.io-index"
2951-
checksum = "1cab0e7c02cf376875e9335e0ba1da535775beb5450d21e1dffca068818ed98b"
2952-
dependencies = [
2953-
"ansi_term",
2954-
"ctor",
2955-
"diff",
2956-
"output_vt100",
2957-
]
2958-
29592912
[[package]]
29602913
name = "pretty_assertions"
29612914
version = "1.2.1"
@@ -5162,21 +5115,6 @@ dependencies = [
51625115
"unicode-xid",
51635116
]
51645117

5165-
[[package]]
5166-
name = "sysinfo"
5167-
version = "0.24.1"
5168-
source = "registry+https://github.com/rust-lang/crates.io-index"
5169-
checksum = "a6a8e71535da31837213ac114531d31def75d7aebd133264e420a3451fa7f703"
5170-
dependencies = [
5171-
"cfg-if 1.0.0",
5172-
"core-foundation-sys",
5173-
"libc",
5174-
"ntapi",
5175-
"once_cell",
5176-
"rayon",
5177-
"winapi",
5178-
]
5179-
51805118
[[package]]
51815119
name = "tar"
51825120
version = "0.4.38"
@@ -5553,7 +5491,7 @@ dependencies = [
55535491
"colored",
55545492
"crossbeam",
55555493
"lazy_static",
5556-
"pretty_assertions 1.2.1",
5494+
"pretty_assertions",
55575495
"regex",
55585496
"rustc_version",
55595497
"serde",

Cargo.toml

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[workspace]
2-
default-members = ["src/bootstrap"]
32
members = [
4-
"src/bootstrap",
53
"compiler/rustc",
64
"library/std",
75
"library/test",
@@ -44,6 +42,7 @@ exclude = [
4442
"build",
4543
"compiler/rustc_codegen_cranelift",
4644
"compiler/rustc_codegen_gcc",
45+
"src/bootstrap",
4746
"src/test/rustdoc-gui",
4847
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
4948
"obj",
@@ -97,15 +96,6 @@ gimli.debug = 0
9796
miniz_oxide.debug = 0
9897
object.debug = 0
9998

100-
# The only package that ever uses debug builds is bootstrap.
101-
# We care a lot about bootstrap's compile times, so don't include debug info for
102-
# dependencies, only bootstrap itself.
103-
[profile.dev]
104-
debug = 0
105-
[profile.dev.package]
106-
# Only use debuginfo=1 to further reduce compile times.
107-
bootstrap.debug = 1
108-
10999
# We want the RLS to use the version of Cargo that we've got vendored in this
110100
# repository to ensure that the same exact version of Cargo is used by both the
111101
# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository

src/bootstrap/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77

88
## [Changes since the last major version]
99

10+
- Vendoring is no longer done automatically when building from git sources. To use vendoring, run `cargo vendor` manually, or use the pre-vendored `rustc-src` tarball.
1011
- `llvm-libunwind` now accepts `in-tree` (formerly true), `system` or `no` (formerly false) [#77703](https://github.com/rust-lang/rust/pull/77703)
1112
- The options `infodir`, `localstatedir`, and `gpg-password-file` are no longer allowed in config.toml. Previously, they were ignored without warning. Note that `infodir` and `localstatedir` are still accepted by `./configure`, with a warning. [#82451](https://github.com/rust-lang/rust/pull/82451)
12-
- Add options for enabling overflow checks, one for std (`overflow-checks-std`) and one for everything else (`overflow-checks`). Both default to false.
1313
- Change the names for `dist` commands to match the component they generate. [#90684](https://github.com/rust-lang/rust/pull/90684)
1414
- The `build.fast-submodules` option has been removed. Fast submodule checkouts are enabled unconditionally. Automatic submodule handling can still be disabled with `build.submodules = false`.
1515

@@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1919
- The default bootstrap profiles are now located at `bootstrap/defaults/config.$PROFILE.toml` (previously they were located at `bootstrap/defaults/config.toml.$PROFILE`) [#77558](https://github.com/rust-lang/rust/pull/77558)
2020
- If you have Rust already installed, `x.py` will now infer the host target
2121
from the default rust toolchain. [#78513](https://github.com/rust-lang/rust/pull/78513)
22+
- Add options for enabling overflow checks, one for std (`overflow-checks-std`) and one for everything else (`overflow-checks`). Both default to false.
2223

2324

2425
## [Version 2] - 2020-09-25

0 commit comments

Comments
 (0)