Skip to content

Commit

Permalink
Fully remove submodule handling from bootstrap.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jyn514 committed Jun 22, 2022
1 parent a09c668 commit 9cde0f7
Show file tree
Hide file tree
Showing 6 changed files with 705 additions and 183 deletions.
72 changes: 5 additions & 67 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -215,32 +215,6 @@ dependencies = [
"byte-tools",
]

[[package]]
name = "bootstrap"
version = "0.0.0"
dependencies = [
"cc",
"cmake",
"filetime",
"getopts",
"hex 0.4.2",
"ignore",
"libc",
"num_cpus",
"once_cell",
"opener",
"pretty_assertions 0.7.2",
"serde",
"serde_json",
"sha2",
"sysinfo",
"tar",
"toml",
"walkdir",
"winapi",
"xz2",
]

[[package]]
name = "bstr"
version = "0.2.13"
Expand Down Expand Up @@ -735,15 +709,6 @@ dependencies = [
"rustc-semver",
]

[[package]]
name = "cmake"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb"
dependencies = [
"cc",
]

[[package]]
name = "colored"
version = "2.0.0"
Expand Down Expand Up @@ -1023,9 +988,9 @@ dependencies = [

[[package]]
name = "ctor"
version = "0.1.15"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39858aa5bac06462d4dd4b9164848eb81ffc4aa5c479746393598fd193afa227"
checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c"
dependencies = [
"quote",
"syn",
Expand Down Expand Up @@ -2670,9 +2635,9 @@ checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"

[[package]]
name = "output_vt100"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66"
dependencies = [
"winapi",
]
Expand Down Expand Up @@ -2931,18 +2896,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"

[[package]]
name = "pretty_assertions"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cab0e7c02cf376875e9335e0ba1da535775beb5450d21e1dffca068818ed98b"
dependencies = [
"ansi_term",
"ctor",
"diff",
"output_vt100",
]

[[package]]
name = "pretty_assertions"
version = "1.2.1"
Expand Down Expand Up @@ -5147,21 +5100,6 @@ dependencies = [
"unicode-xid",
]

[[package]]
name = "sysinfo"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6a8e71535da31837213ac114531d31def75d7aebd133264e420a3451fa7f703"
dependencies = [
"cfg-if 1.0.0",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
"rayon",
"winapi",
]

[[package]]
name = "tar"
version = "0.4.38"
Expand Down Expand Up @@ -5538,7 +5476,7 @@ dependencies = [
"colored",
"crossbeam",
"lazy_static",
"pretty_assertions 1.2.1",
"pretty_assertions",
"regex",
"rustc_version",
"serde",
Expand Down
12 changes: 1 addition & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[workspace]
default-members = ["src/bootstrap"]
members = [
"src/bootstrap",
"compiler/rustc",
"library/std",
"library/test",
Expand Down Expand Up @@ -44,6 +42,7 @@ exclude = [
"build",
"compiler/rustc_codegen_cranelift",
"compiler/rustc_codegen_gcc",
"src/bootstrap",
"src/test/rustdoc-gui",
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
"obj",
Expand Down Expand Up @@ -97,15 +96,6 @@ gimli.debug = 0
miniz_oxide.debug = 0
object.debug = 0

# The only package that ever uses debug builds is bootstrap.
# We care a lot about bootstrap's compile times, so don't include debug info for
# dependencies, only bootstrap itself.
[profile.dev]
debug = 0
[profile.dev.package]
# Only use debuginfo=1 to further reduce compile times.
bootstrap.debug = 1

# We want the RLS to use the version of Cargo that we've got vendored in this
# repository to ensure that the same exact version of Cargo is used by both the
# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository
Expand Down
Loading

0 comments on commit 9cde0f7

Please sign in to comment.