about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2023-05-20Rollup merge of #111606 - jyn514:nightly-diagnostics, r=lcnrDylan DPC-1/+0
very minor cleanups - add `must_use` to `early_error_no_abort` this was already being used at its only callsite, but this ensures that new code remembers to use it if it's called in the future. found this while investigating https://github.com/rust-lang/rust/issues/110090. - remove outdated and incorrect comment in `builder.rs`. `doc_rust_lang_org_channel` doesn't exist in rustdoc, it gets it from an env var instead: https://github.com/rust-lang/rust/blob/b275d2c30b6e88cc48747f349f7137076d450658/src/librustdoc/clean/utils.rs#L569-L573
2023-05-19Set the timestamp of downloaded stage0 files ...Ximin Luo-2/+2
... using server-reported timestamp. This allows us to track changes to the downloaded artifact more easily and in a more reproducible manner. Co-authored-by: Zixing Liu <zixing.liu@canonical.com>
2023-05-19Override config.toml options from command lineclubby789-32/+198
2023-05-18very minor cleanupsjyn-1/+0
- add `must_use` to `early_error_no_abort` this was already being used at its only callsite, but this ensures that new code remembers to use it if it's called in the future. - remove outdated and incorrect comment in `builder.rs`. `doc_rust_lang_org_channel` doesn't exist in rustdoc, it gets it from an env var instead.
2023-05-18Rollup merge of #111685 - Kobzol:bootstrap-typo, r=clubby789Dylan DPC-1/+1
Fix typo in bootstrap command description Unless `duild` is some clever name for `dist build`, this is probably a typo.
2023-05-18Rollup merge of #111160 - chbaker0:update-serde, r=Mark-SimulacrumDylan DPC-8/+8
Update serde in workspace and non-synced dependencies The main workspace, bootstrap, cargo, miri, and rust-analyzer all lock serde to different versions. It's preferable to share the same version where possible, so update it. Rustfmt is synced from another repository and has its own Cargo.lock, but since it's added to the overall workspace it should respect the version here. Cargo is already at the latest version. Miri and rust-analyzer would require upstream updates.
2023-05-17Fix typo in bootstrap command descriptionJakub Beránek-1/+1
2023-05-14comment feedbackyukang-1/+2
2023-05-14fixyukang-2/+2
2023-05-14skip rustc version check in dry_runyukang-0/+4
2023-05-14Make sure the build.rustc version is either the same or 1 apartyukang-0/+42
2023-05-14Auto merge of #111388 - clubby789:clap-complete, r=jyn514bors-15/+101
Generate shell completions for bootstrap with Clap Now that #110693 has been merged, we can look at generating shell completions for x.py with `clap_complete`. Leaving this as draft for now as I'm not sure of the best way to integration the completion generator. Additionally, the generated completions for zsh are completely broken (will need to be resolved upstream, it doesn't seem to handle subcommands + global arguments well). I don't have Fish installed and would be interested to know how well completions work there. Alternative to #107827
2023-05-12run miri tests with MIR opts in rustc CIRalf Jung-2/+19
2023-05-10Bump object and thorin-dwpJubilee Young-3/+3
object -> 0.31.1 thorin-dwp -> 0.6.0 Required to fix watchOS breakage.
2023-05-10Generate shell completions for bootstrap with Clapclubby789-15/+101
2023-05-09Rollup merge of #111242 - wangkirin:support_rpath_independent_config, ↵Matthias Krüger-1/+9
r=albertlarsan68 support set `rpath` option for each target independently Currently the `rpath` option is a global config and it's effect on all targets. But sometimes when developers edit the rustc code and try to release rust toolchains themselves, they may not want to add `rpath` in all targets to avoid dynamically linked shared object library privilege escalation attack. This PR supports set `rpath` option for each target independently . Common developers are not aware of the existence of this configuration option and do not affect the existing development process. This configuration option takes effect only after developers explicitly sets . r? ``@albertlarsan68``
2023-05-09Auto merge of #110152 - ChrisDenton:windows-sys, r=thomccbors-0/+24
Start using `windows sys` for Windows FFI bindings in std Switch to using windows-sys for FFI. In order to avoid some currently contentious issues, this uses windows-bindgen to generate a smaller set of bindings instead of using the full crate. Unlike the windows-sys crate, the generated bindings uses `*mut c_void` for handle types instead of `isize`. This to sidestep opsem concerns about mixing pointer types and integers between languages. Note that `SOCKET` remains defined as an integer but instead of being a usize, it's changed to fit the [standard library definition](https://github.com/rust-lang/rust/blob/a41fc00eaf352541008965fec0dee811e44373b3/library/std/src/os/windows/raw.rs#L12-L16): ```rust #[cfg(target_pointer_width = "32")] pub type SOCKET = u32; #[cfg(target_pointer_width = "64")] pub type SOCKET = u64; ``` The generated bindings also customizes the `#[link]` imports. I hope to switch to using raw-dylib but I don't want to tie that too closely with the switch to windows-sys. --- Changes outside of the bindings are, for the most part, fairly minimal (e.g. some differences in `*mut` vs. `*const` or a few types differ). One issue is that our own bindings sometimes mix in higher level types, like `BorrowedHandle`. This is pretty adhoc though.
2023-05-08Auto merge of #111342 - Dylan-DPC:rollup-b5p6wzy, r=Dylan-DPCbors-4/+14
Rollup of 7 pull requests Successful merges: - #110297 (Make `(try_)subst_and_normalize_erasing_regions` take `EarlyBinder`) - #110827 (Fix lifetime suggestion for type aliases with objects in them) - #111022 (Use smaller ints for bitflags) - #111056 (Fix some suggestions where a `Box<T>` is expected.) - #111262 (Further normalize msvc-non-utf8-ouput) - #111265 (Make generics_of has_self on RPITITs delegate to the opaque) - #111323 (Give a more helpful error when running the rustc shim directly) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-08Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, ↵bors-0/+9
r=Mark-Simulacrum enable `rust_2018_idioms` lint group for doctests With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests. Resolves #106086 Resolves #99144 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-08supplement CHANGELOG for add rpath in target sectionWang Qilin-0/+1
2023-05-07Update serde in workspace and non-synced dependenciesCollin Baker-8/+8
The main workspace, bootstrap, cargo, miri, and rust-analyzer all lock serde to different versions. It's preferable to share the same version where possible, so update it. Rustfmt is synced from another repository and has its own Cargo.lock, but since it's added to the overall workspace it should respect the version here. Cargo is already at the latest version. Miri and rust-analyzer would require upstream updates.
2023-05-07Add support for NetBSD/aarch64-be (big-endian arm64).Havard Eidnes-0/+1
2023-05-07Give a more helpful error when running the rustc shim directlyjyn-4/+14
cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Building.20.60coretests.60.20by.20hand
2023-05-07Auto merge of #110693 - clubby789:x-clap-take-2, r=Mark-Simulacrumbors-730/+481
Migrate bootstrap to Clap-based argument parsing Supercedes #108083 I chose to re-do the work rather than rebase the onto the large changes since the original PR. If it's preferred I can instead force-push the original PR to this version. cc `@jyn514` `@albertlarsan68`
2023-05-06Migrate bootstrap to Clap-based argumentsclubby789-730/+481
2023-05-07enable `rust_2018_idioms` for doctestsozkanonur-0/+9
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-05Generate windows-sys bindingsChris Denton-0/+24
2023-05-05support enable rpath in each target independentlyWang Qilin-1/+8
2023-05-05Rollup merge of #111223 - jyn514:free-args, r=clubby789Yuki Okushi-28/+30
Use `free-args` consistently in bootstrap Previously, this was only passed to miri and compiletest. Extended it to all other tests and binaries as well. cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Running.20a.20single.20doctest r? `@clubby789`
2023-05-05Rollup merge of #111187 - krasimirgg:llvm-runtimes, r=jyn514Yuki Okushi-0/+2
bootstrap: add llvm-project/runtimes to the sources This is needed to build libunwind for LLVM 16: https://discourse.llvm.org/t/runtimes-removed-support-for-llvm-enable-projects-in-libcxx-libcxxabi-and-libunwind/65707 Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/missing.20llvm-project.2Fruntimes.20in.20beta.20srcs Checked by running `x.py dist` and verifying the produced source archive (build/dist/rustc-1.71.0-dev-src.tar.gz) contains the new directory.
2023-05-04Use `free-args` consistently in bootstrapjyn-28/+30
Previously, this was only passed to miri and compiletest. Extended it to all other tests and binaries as well.
2023-05-04Rollup merge of #111201 - krasimirgg:add_gitmodules, r=jyn514Matthias Krüger-0/+1
bootstrap: add .gitmodules to the sources The bootstrap builder now expects this file to exist: https://github.com/rust-lang/rust/blob/6f8c0557e0b73c73a8a7163a15f4a5a3feca7d5c/src/bootstrap/builder.rs#L494 Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/missing.20llvm-project.2Fruntimes.20in.20beta.20srcs
2023-05-04Rollup merge of #108865 - Zoxc:library-dummy-crate, r=jyn514Matthias Krüger-6/+6
Add a `sysroot` crate to represent the standard library crates This adds a dummy crate named `sysroot` to represent the standard library target instead of using the `test` crate. This allows the removal of `proc_macro` as a dependency of `test` allowing these 2 crates to build in parallel saving around 9 seconds locally.
2023-05-04bootstrap: add .gitmodules to the sourcesKrasimir Georgiev-0/+1
The bootstrap builder now expects this file to exist: https://github.com/rust-lang/rust/blob/6f8c0557e0b73c73a8a7163a15f4a5a3feca7d5c/src/bootstrap/builder.rs#L494
2023-05-04bootstrap: add llvm-project/runtimes to the sourcesKrasimir Georgiev-0/+2
This is needed to build libunwind for LLVM 16: https://discourse.llvm.org/t/runtimes-removed-support-for-llvm-enable-projects-in-libcxx-libcxxabi-and-libunwind/65707 Doesn't work: with this, running `python3 x.py dist` produces a tar archive that still doesn't contain the runtimes subdirectory?
2023-05-04Rollup merge of #111069 - ozkanonur:remove-pointless-fixme, r=albertlarsan68Dylan DPC-1/+0
remove pointless `FIXME` in `bootstrap::download` The suggestion given by `FIXME` to use `CompilerMetadata` for `download_toolchain` in `bootstrap::download` can result in more confusion. This is because `stamp_key` is not always a date; it can also be a commit hash. Additionally, unlike in `download_beta_toolchain`, in the `download_ci_rustc` function, `version` and `commit` values are calculated separately.
2023-05-01Make x.py work again in most (all?) casesAlbert Larsan-1/+19
Wrap all of x.py in `if __name__ == '__main__':` to avoid problems with `multiprocessing` Make the pool sizing better
2023-05-01remove pointless `FIXME` in `bootstrap::download`ozkanonur-1/+0
The suggestion given by `FIXME` to use `CompilerMetadata` for `download_toolchain` in `bootstrap::download` can result in more confusion. This is because `stamp_key` is not always a date; it can also be a commit hash. Additionally, unlike in `download_beta_toolchain`, in the `download_ci_rustc` function, `version` and `commit` values are calculated separately. Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-30Auto merge of #110427 - Nilstrieb:parallel-bootstrap-startup, r=albertlarsan68bors-15/+86
Parallelize initial Rust download in bootstrap Parallelize the initial download of Rust in `bootstrap.py` `time ./x.py --help` after `rm -r build` Before: 33s After: 27s
2023-04-30Parallelize initial rust extractionNilstrieb-2/+68
This is quite slow and embarassingly parallel, even in python. This speeds up the initial bootstrap build by about 5-10s.
2023-04-30Rollup merge of #110999 - clubby789:bootstrap-stderr, r=Mark-SimulacrumMatthias Krüger-37/+47
Output some bootstrap messages on stderr Fixes #110995
2023-04-30Rollup merge of #110996 - loongarch-rs:fix-bootstrap, r=ozkanonurMatthias Krüger-1/+1
bootstrap: Fix compile error: unused-mut Compile errors: ``` Compiling bootstrap v0.0.0 (/home/hev/rust/rust/src/bootstrap) error: variable does not need to be mutable --> config.rs:1312:17 | 1312 | let mut build_target = config | ----^^^^^^^^^^^^ | | | help: remove this `mut` | = note: `-D unused-mut` implied by `-D warnings` error: could not compile `bootstrap` (lib) due to previous error ```
2023-04-30Rollup merge of #110118 - jyn514:download-error, r=Mark-SimulacrumMatthias Krüger-1/+12
download-rustc: Give a better error message if artifacts can't be dowloaded It should be very rare in practice to happen; people would need to both have `download-ci-llvm` disabled and `download-rustc` enabled. I think it may be more common if we start turning this on by default, though. Helps with https://github.com/rust-lang/rust/issues/81930. Before: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/bf5cad8e775fb326465e5c1b98693e5d259da156/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz curl: (22) The requested URL returned error: 404 ``` After: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/bf5cad8e775fb326465e5c1b98693e5d259da156/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz curl: (22) The requested URL returned error: 404 error: failed to download pre-built rustc from CI note: old builds get deleted after a certain time help: if trying to compile an old commit of rustc, disable `download-rustc` in config.toml: [rust] download-rustc = false ```
2023-04-29Output some bootstrap messages on stderrclubby789-37/+47
2023-04-29Auto merge of #110576 - jyn514:unify-test-args, r=ozkanonurbors-349/+215
bootstrap: Unify test argument handling Fixes #104198. Does *not* help with https://github.com/rust-lang/rust/issues/80124 because I couldn't figure out a reasonable way to omit `--lib` only for `panic_abort` and not other `std` dependencies. - Remove unnecessary `test_kind` field and `TestKind` struct. These are just subsets of the existing `builder.kind` / `Kind` struct. - Add a new `run_cargo_test` function which handles passing arguments to cargo based on `builder.config` - Switch all Steps in `mod test` to `run_cargo_test` where possible - Combine several steps into one `CrateBootstrap` step. These tests all do the same thing, just with different crate names. - Fix `x test --no-doc`. This is much simpler after the refactors mentioned earlier, but I'm happy to split it into a separate PR if desired. Before, this would panic a lot because steps forgot to pass `--lib`.
2023-04-30bootstrap: Fix compile error: unused-mutWANG Rui-1/+1
2023-04-29Fix `x test --no-deps`jyn-34/+58
- Use `cargo metadata` to determine whether a crate has a library package or not - Collect metadata for all workspaces, not just the root workspace and cargo - Don't pass `--lib` for crates without a library - Use `run_cargo_test` for rust-installer - Don't build documentation in `lint-docs` if `--no-doc` is passed
2023-04-29Combine several `Step`s into a single step with multiple pathsjyn-115/+22
2023-04-29Convert the rest of the `test` Steps to run_cargo_testjyn-85/+79
2023-04-29windows: kill rust-analyzer-proc-macro-srv before deleting stage0 directoryjyn-6/+29
This fixes the following recurring error on windows: ``` Traceback (most recent call last): File "C:\Users\jyn\src\rust\x.py", line 29, in <module> bootstrap.main() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 963, in main bootstrap(args) File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 927, in bootstrap build.download_toolchain() File "C:\Users\jyn\src\rust\src\bootstrap\bootstrap.py", line 437, in download_toolchain shutil.rmtree(bin_root) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree return _rmtree_unsafe(path, onerror) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Users\jyn\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\jyn\\src\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\rust-analyzer-proc-macro-srv.exe' ```