about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2022-05-02Auto merge of #96310 - bertptrs:remove-debugger-bootstrap, r=Mark-Simulacrumbors-11/+1
Remove DebbugerScripts from bootstrap CLI This PR implements #95992 and removes the debugger scripts from the bootstrap CLI. I could not find a lot of documentation on the bootstrap binary so perhaps there's still some documentation to be updated.
2022-05-02Remove DebbugerScripts from bootstrap CLIBert Peters-11/+1
2022-05-02openbsd: unbreak build on native platformSébastien Marie-1/+2
after #95612, only linux and windows target are build with -Zunstable-options, but others platforms might use -Csplit-debuginfo add "openbsd" target in the list of platforms using it.
2022-05-01Use curl by defaultThomas Applencourt-50/+98
2022-05-02Rollup merge of #96499 - jyn514:bootstrap-doctests, r=Mark-SimulacrumYuki Okushi-0/+11
Make it possible to write doctests for bootstrap This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
2022-05-01Initialize rust-analyzer submodule on bootstrapyungkneez-2/+11
2022-04-27Make it possible to write doctests for bootstrapJoshua Nelson-0/+11
This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
2022-04-27Auto merge of #95170 - jyn514:ci-llvm, r=Mark-Simulacrumbors-184/+367
Move `download-ci-llvm` out of bootstrap.py This is ready for review. It has been tested on Windows, Linux, and NixOS. The second commit ports the changes from https://github.com/rust-lang/rust/pull/95234 to Rust; I can remove it if desired. Helps with https://github.com/rust-lang/rust/issues/94829. As a follow-up, this makes it possible to avoid downloading llvm until it's needed for building `rustc_llvm`; it would be nice to do that, but it shouldn't go in the first draft. It might also be possible to avoid requiring python until tests run (currently there's a check in `sanity.rs`), but I haven't looked too much into that. `@rustbot` label +A-rustbuild
2022-04-25Auto merge of #96106 - jihiggins:issue-96060, r=Mark-Simulacrumbors-2/+11
Add type_name info to [TIMING] log output Adds type_name to the [TIMING] log output: ``` [TIMING] (bootstrap::compile::Sysroot) Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } -- 0.020 [TIMING] (bootstrap::builder::Builder::sysroot_libdir::Libdir) Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } -- 0.007 ``` Not sure if that's the best way to format it. Thought about replacing the struct's name with the type_name output, but that feels kind of hacky? Closes #96060
2022-04-24Use `build/tmp` instead of adding a dependency on `tempfile`.Joshua Nelson-32/+19
2022-04-24Allow quotes around `nixos` in /etc/os-releaseJoshua Nelson-1/+2
2022-04-24Move download-ci-llvm to rustbuildJoshua Nelson-177/+372
This attempts to keep the logic as close to the original python as possible. `probably_large` has been removed, since it was always `True`, and UTF-8 paths are no longer supported when patching files for NixOS. I can readd UTF-8 support if desired. Note that this required making `llvm_link_shared` computed on-demand, since we don't know whether it will be static or dynamic until we download LLVM from CI.
2022-04-25Rollup merge of #96366 - jyn514:remove-dead-code, r=Mark-SimulacrumMatthias Krüger-9/+2
bootstrap: Remove dead code in rustdoc shim The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.
2022-04-24Remove dead code in rustdoc shimJoshua Nelson-9/+2
The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.
2022-04-24Rollup merge of #96303 - jyn514:improved-bootstrap-tests, r=Mark-SimulacrumMatthias Krüger-119/+129
Improve bootstrap tests - Don't checkout submodules in bootstrap tests This doesn't cause any tests to fail, and can greatly speed them up. - Add a test for --exclude test::XXX I didn't know that the `test::` syntax was valid before, and it doesn't seem to be documented anywhere. Add a test so it doesn't regress accidentally, and as executable documentation. This also moves the `exclude` tests out of `dist`, to avoid assertion errors when the `cmd` passed to configure didn't match the `subcommand` used. - Use run_build helper consistently across most bootstrap tests This is not super important to do, but the consistency is nice. I didn't change any tests that call `configure("dist")` and then override the subcommand - doing that at all is pretty sketchy, but I don't want to mess with it while already doing a refactor. Found while working on the "one call to Step for all paths" change mentioned in https://github.com/rust-lang/rust/pull/95503#issuecomment-1105914384, but independent of that work. cc `@pietroalbini` for the `--exclude` test, git blame says you added support for it originally.
2022-04-24Rollup merge of #96237 - AlecGoncharow:issue-96011-fix, r=Mark-SimulacrumMatthias Krüger-3/+1
compiletest: combine `--*-python` args Since these arguments are now always the same, combine them into a singular `--python` argument. Fixes #96011
2022-04-24Rollup merge of #95504 - jyn514:library-alias, r=Mark-SimulacrumMatthias Krüger-6/+9
Add `x {check,build,doc} {compiler,library}` aliases. While working on https://github.com/rust-lang/rust/pull/95503, I realized that it will interfere with existing command lines: Currently people run `x build library/std` expecting it to "add all library crates to the sysroot", but after that change, it will *only* build `libstd` and its dependencies (and add them to the sysroot), not libtest or libproc_macro. That will work for local testing in most cases, but could be confusing. Even if not, though, I think `x build library` is more clear about what actually happens than the current `x build library/std`. The intended end goal is something like: - For check/build/doc, we have library + compiler aliases, which correspond to basically "most possible" for that piece. This is the intended path of entry (rather than library/test or similar as today) for when you just want the thing to work -- for example, getting a compiler that is "crates.io-compatible" would be roughly `x.py build library`). #95504 - Specific crate invocations build up to that crate, which means that if you don't care about tests you probably want x.py build library/proc_macro or library/std for faster build times. #95503 Note that this is already implemented today for the `doc` command and seems to work pretty well in practice. I plan to change the dev-guide and various instructions in the README to `build library` once this is merged. `@rustbot` label +A-rustbuild
2022-04-24Add type_name info to [TIMING] log outputJames Higgins-2/+11
2022-04-22Auto merge of #96207 - nikic:distcheck-dir, r=Mark-Simulacrumbors-1/+3
Ensure existance of dist directory when creating tarball I'm not sure why this works in CI, but this is necessary to make distcheck (including the `x86_64-linux-distcheck` image) run on Fedora 35.
2022-04-21Use `run_build` helper consistently across most bootstrap testsJoshua Nelson-96/+69
This is not super important to do, but the consistency is nice. I didn't change any tests that call `configure("dist")` and then override the subcommand - doing that at all is pretty sketchy, but I don't want to mess with it while already doing a refactor.
2022-04-21Add a test for `--exclude test::XXX`Joshua Nelson-29/+65
I didn't know that the `test::` syntax was valid before, and it doesn't seem to be documented anywhere. Add a test so it doesn't regress accidentally, and as executable documentation.
2022-04-21Don't checkout submodules in bootstrap testsJoshua Nelson-0/+1
This doesn't cause any tests to fail, and can greatly speed them up.
2022-04-21Auto merge of #96003 - aswild:pr/bootstrap-subcommands-cleanup, r=jyn514bors-103/+85
bootstrap: consolidate subcommand parsing and matching There's several places where the x.py command names are matched as strings, leading to some inconsistencies and opportunities for cleanup. * Add Format, Clean, and Setup variants to builder::Kind. * Use Kind to parse the x.py subcommand name (including aliases) * Match on the subcommand Kind rather than strings when handling options and help text. * Several subcommands don't display any paths when run with `-h -v` even though the help text indicates that they should. Fix this and refactor so that manually keeping matches in sync isn't necessary. Fixes #95937
2022-04-21Auto merge of #95612 - davidtwco:split-debuginfo-in-bootstrap, r=Mark-Simulacrumbors-13/+59
bootstrap: add split-debuginfo config Replace `run-dysutil` option with more general `split-debuginfo` option that works on all platforms. r? `@Mark-Simulacrum`
2022-04-21Rollup merge of #96196 - jyn514:no-assertion, r=Mark-SimulacrumDylan DPC-5/+7
Remove assertion that all paths in `ShouldRun` exist This breaks on submodules (see #96188). Disable the assertion for now until I can think of a proper fix. This doesn't revert any of the changes in `Step`s themselves, only what `ShouldRun::paths` does.
2022-04-20bootstrap: non-bootstrap windows split debuginfoDavid Wood-7/+11
Temporarily, only enable split debuginfo on Windows if not building with the boostrap compiler as there is a bug that isn't fixed in the bootstrap compiler which would result in `thorin` being run on Windows. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-19compiletest: combine `--*-python` argsAlec Goncharow-3/+1
Since these arguments are now always the same, combine them into a singular `--python` argument.
2022-04-19Rollup merge of #95809 - ytmimi:llvm_stamp_typo, r=Mark-SimulacrumDylan DPC-1/+1
Fix typo in bootstrap.py
2022-04-19Ensure existance of dist directory when creating tarballNikita Popov-1/+3
2022-04-18Remove assertion that all paths in `ShouldRun` existJoshua Nelson-5/+7
This breaks on submodules (see #96188). Disable the assertion for now until I can think of a proper fix. This doesn't revert any of the changes in `Step`s themselves, only what `ShouldRun::paths` does.
2022-04-18Auto merge of #95906 - jyn514:enforce-valid-paths, r=Mark-Simulacrumbors-42/+66
Require all paths passed to `ShouldRun::paths` to exist on disk This has two benefits: 1. There is a clearer mental model of how bootstrap works. Steps correspond to paths on disk unless it's strictly impossible for them to do so (e.g. dist components). 2. Bootstrap has better checks for internal consistency. This caught several issues: - `src/sanitizers` doesn't exist; I changed it to just be a `sanitizers` alias. - `src/tools/lld` doesn't exist; I removed it, since `lld` alone already works. - `src/llvm` doesn't exist; removed it since `llvm` and `src/llvm-project` both work. - `src/lldb_batchmode.py` doesn't exist, it was moved to `src/etc`. - `install` was still using `src/librustc` instead of `compiler/rustc`. - None of the tools in `dist` / `install` allowed using `src/tools/X` to build them. This might be intentional - I can change them to aliases if you like. Builds on https://github.com/rust-lang/rust/pull/95901 and should not be merged before.
2022-04-18Auto merge of #96080 - nikic:ranlib, r=Mark-Simulacrumbors-0/+4
Respect ranlib specified for target during LLVM build The ranlib specified for the target was never actually transferred into the builder configuration. In the dist-x86_64-linux build we ended up using ranlib instead of llvm-ranlib. Found this investigating a build failure in #94214.
2022-04-18Auto merge of #96000 - jyn514:faster-doctests, r=Mark-Simulacrumbors-2/+4
Make `x test --stage 2 compiler/rustc_XXX` faster to run Previously, bootstrap unconditionally rebuilt the stage 2 compiler, even if it had previously built stage 1. This changes it to reuse stage 1 if possible. In particular, it no longer runs the following step: ``` Building stage1 compiler artifacts (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) -> x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu)) ```
2022-04-18bootstrap: disable split dwarf by defaultDavid Wood-1/+1
Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-18bootstrap: add split-debuginfo configDavid Wood-14/+56
Replace `run-dysutil` option with more general `split-debuginfo` option that works on all platforms. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-17Rollup merge of #96105 - jyn514:less-verbose-logging, r=Mark-SimulacrumDylan DPC-1/+7
Make the debug output for `TargetSelection` less verbose In particular, this makes the output of `x build -vv` easier to read. Before: ``` c Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } ``` After: ``` c Sysroot { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu } } ```
2022-04-16bootstrap: consolidate subcommand parsing and matchingAllen Wild-103/+85
There's several places where the x.py command names are matched as strings, leading to some inconsistencies and opportunities for cleanup. * Add Format, Clean, and Setup variants to builder::Kind. * Use Kind to parse the x.py subcommand name (including aliases) * Match on the subcommand Kind rather than strings when handling options and help text. * Several subcommands don't display any paths when run with `-h -v` even though the help text indicates that they should. Fix this and refactor so that manually keeping matches in sync isn't necessary. Fixes #95937
2022-04-16Require all paths passed to `ShouldRun::paths` to exist on diskJoshua Nelson-42/+66
This has two benefits: 1. There is a clearer mental model of how bootstrap works. Steps correspond to paths on disk unless it's strictly impossible for them to do so (e.g. dist components). 2. Bootstrap has better checks for internal consistency. This caught several issues: - `src/sanitizers` doesn't exist; I changed it to just be a `sanitizers` alias. - `src/tools/lld` doesn't exist; I removed it, since `lld` alone already works. - `src/llvm` doesn't exist; removed it since `llvm` and `src/llvm-project` both work. - `src/lldb_batchmode.py` doesn't exist, it was moved to `src/etc`. - `install` was still using `src/librustc` instead of `compiler/rustc`. - None of the tools in `dist` / `install` allowed using `src/tools/X` to build them. This might be intentional - I can change them to aliases if you like.
2022-04-16Auto merge of #95993 - jyn514:fix-stage0-doctests, r=Mark-Simulacrumbors-1/+3
Fix `x test --doc --stage 0 library/std` I managed to break this in https://github.com/rust-lang/rust/pull/95449. I am not quite sure why this is the correct fix, but it doesn't break `doc --stage 0` and is strictly closer to the previous behavior. Previously, rustdoc would error with strange issues because of the mismatched sysroot: ``` error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5 | 14 | use rustc_span::{sym, symbol::Ident, Span, Symbol}; | ^^^^^^^^^^ | = note: perhaps that crate needs to be recompiled? = note: the following crate versions were found: crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib ```
2022-04-15Make the debug output for `TargetSelection` less verboseJoshua Nelson-1/+7
In particular, this makes the output of `x build -vv` easier to read. Before: ``` c Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } ``` After: ``` c Sysroot { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu } } ```
2022-04-16Auto merge of #95450 - jyn514:faster-doc, r=Mark-Simulacrumbors-16/+20
Only check the compiler and standard library before documenting them (take 2) Trying https://github.com/rust-lang/rust/pull/88675 again.
2022-04-15Respect ranlib specified for target during LLVM buildNikita Popov-0/+4
The ranlib specified for the target was never actually transferred into the builder configuration. In the dist-x86_64-linux build we ended up using ranlib instead of llvm-ranlib.
2022-04-14Don't build the library and standard library before documenting themJoshua Nelson-16/+20
Rustdoc doesn't require the build artifacts to generate the docs, and especially in the case of rustc, it greatly increases the time needed to run the build. - Statically ensure that only the top_stage of a tool is documented If another part of rustbuild tried to document a different stage, it would run into errors because `check::Rustc` unconditionally uses the top stage. - Try building rustc instead of checking to avoid duplicate artifacts Tries to workaround the following error: ``` error[E0464]: multiple matching crates for `rustc_ast` --> src/librustdoc/lib.rs:40:1 | 40 | extern crate rustc_ast; | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: candidates: crate `rustc_ast`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_ast-6d7c193782263d89.rlib crate `rustc_ast`: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_ast-e5d09eda5beb759c.rmeta ```
2022-04-13Rollup merge of #95885 - gimbles:patch-1, r=Mark-SimulacrumDylan DPC-1/+5
Improve error message in case of missing checksum # Fixes #94217
2022-04-13Improve error message when there's no checksumgimbles-1/+5
2022-04-12Make `x test --stage 2 compiler/rustc_XXX` faster to runJoshua Nelson-2/+4
Previously, bootstrap unconditionally rebuilt the stage 2 compiler, even if it had previously built stage 1. This changes it to reuse stage 1 if possible.
2022-04-13Rollup merge of #95441 - AlecGoncharow:issue-95204-fix, r=Mark-SimulacrumDylan DPC-10/+15
Always use system `python3` on MacOS This PR includes 2 changes: 1. Always use the system Python found at `/usr/bin/python3` on MacOS 2. Removes the hard requirement on having `python` in your system path if you didn't specify alternatives. The proposed change will instead attempt to find and use in order: `python` -> `python3` -> `python2`. This change isn't strictly necessary but without any change to this check, the original issue inspiring this change will still exist. Fixes #95204 r? ```@jyn514```
2022-04-12Fix `x test --doc --stage 0 library/std`Joshua Nelson-1/+3
I managed to break this in https://github.com/rust-lang/rust/pull/95449. I am not quite sure why this is the correct fix, but it doesn't break `doc --stage 0` and is strictly closer to the previous behavior. Previously, rustdoc would error with strange issues because of the mismatched sysroot: ``` error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5 | 14 | use rustc_span::{sym, symbol::Ident, Span, Symbol}; | ^^^^^^^^^^ | = note: perhaps that crate needs to be recompiled? = note: the following crate versions were found: crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib ```
2022-04-12Rollup merge of #95963 - luqmana:llvm-dist-cross-filecheck, r=Mark-SimulacrumMara Bos-2/+2
[bootstrap] Grab the right FileCheck binary for dist when cross-compiling. Fixes #95862 We were using the target dir for all the other LLVM tools (`llvm-config`, `llvm-ar`, etc) but the build target dir for `FileCheck`. This meant for targets which are cross-compiled, we were copying the wrong binary.
2022-04-12Rollup merge of #95671 - gimbles:master, r=Mark-Simulacrumfee1-dead-2/+2
feat: Allow usage of sudo [while not accessing root] in x.py # Fixes This PR should fix #93344 # Info Allows usage of sudo (while not accessing root) in x.py