about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2022-07-28Build rust demangler before running run-make testsTomasz Miąsko-2/+6
2022-07-28Auto merge of #99756 - fasterthanlime:ra-sync-and-pms-component, ↵bors-0/+57
r=Mark-Simulacrum Sync `rust-analyzer`, add `rust-analyzer-proc-macro-srv` binary to Rustc component As discussed earlier with `@jyn514` and `@pietroalbini,` I'm also going to use this PR to have `dist::Rustc` build the `rust-analyzer-proc-macro-srv` binary introduced in: * https://github.com/rust-lang/rust-analyzer/pull/12871
2022-07-27Ship `rust-analyzer-proc-macro-srv` binary with dist::RustcAmos Wenger-0/+57
This builds `src/tools/rust-analyzer/crates/proc-macro-srv-cli` and ships it as part of Rustc's dist component. This allows rust-analyzer's proc macro support to work on all rustc versions (stable, beta and nightly) starting now.
2022-07-27Rollup merge of #99765 - nicholasbishop:bishop-disable-uefi-std-build, r=jyn514Yuki Okushi-1/+5
Don't build std for *-uefi targets https://github.com/rust-lang/rust/issues/97322
2022-07-26Don't build std for *-uefi targetsNicholas Bishop-1/+5
https://github.com/rust-lang/rust/issues/97322
2022-07-26Auto merge of #99680 - workingjubilee:revert-revert-icf, r=Mark-Simulacrumbors-0/+6
Revert "Revert "Use ICF (identical code folding) for building rustc"" This reverts commit rust-lang/rust@45575d23f316af7476ccd0a895234ac59c47a6be, thereby enabling identical code folding again. Closes #99440 (again).
2022-07-24Only run proc-macro-srv tests for now (after discussion with @Veykril, ↵Amos Wenger-4/+7
@jyn514, and @lnicola)
2022-07-24Revert "Revert "Use ICF (identical code folding) for building rustc""Jubilee Young-0/+6
This reverts commit rust-lang/rust@45575d23f316af7476ccd0a895234ac59c47a6be, thereby enabling identical code folding again.
2022-07-24Small fixupsJoshua Nelson-2/+2
- use `path` instead of `paths` - don't mark rust-analyzer as an optional tool - print the cargo command that's run in the proc-macro-test build script this originally was part of a change to fix `test --stage 0 rust-analyzer`, but I'm going to leave that for a separate PR so it's easier to review.
2022-07-24Don't run slow tests in Rust CI, only RA CIAmos Wenger-0/+4
2022-07-24Add comment about CARGO_WORKSPACE_DIRAmos Wenger-0/+2
2022-07-24Use top-level path in tool StepAmos Wenger-1/+1
2022-07-24Allow cross-compiling, build all cratesAmos Wenger-3/+3
2022-07-24Use compiler.stageAmos Wenger-1/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2022-07-24Add test step for rust-analyzer, run it by defaultAmos Wenger-0/+50
2022-07-24Check only tests and benches, not examplesAmos Wenger-2/+5
2022-07-24Add check step, stuck on 'no output generated for libgoto_def-hash rmeta'Amos Wenger-0/+60
2022-07-24Convert rust-analyzer to 'in-tree' tool, pass 'in-rust-tree' feature by defaultAmos Wenger-4/+47
2022-07-22miri: make --stage 0 testing workRalf Jung-0/+8
2022-07-20Auto merge of #98843 - Urgau:check-cfg-stage0, r=Mark-Simulacrumbors-38/+32
Enable check-cfg in stage0 Now that the bootstrap cargo supports `rustc-check-cfg` we can now enable it with `-Zcheck-cfg=output` and use it in `rustc_llvm` to unblock `--check-cfg` support in stage0. r? `@Mark-Simulacrum`
2022-07-18Revert "Use ICF (identical code folding) for building rustc"Jakub Beránek-6/+0
2022-07-17Use LLD linker for compiling rustc on Linux x64 and use ICF for binary size ↵Jakub Beránek-0/+6
optimization
2022-07-15only run --all-targets in stage0Joseph Bingham-1/+4
2022-07-14Don't build std for switchleo60228-1/+1
2022-07-14Don't use host linker for switchleo60228-1/+2
2022-07-14Rollup merge of #99236 - psumbera:Issue99208, r=Mark-SimulacrumDylan DPC-0/+1
solaris: unbreak build on native platform Fixes: #99208
2022-07-14solaris: unbreak build on native platformPetr Sumbera-0/+1
Fixes: #99208
2022-07-14Rollup merge of #99139 - jyn514:dist-tool-help, r=Mark-SimulacrumDylan DPC-1/+5
Give a better error when `x dist` fails for an optional tool Before: ``` thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9 ``` After: ``` thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure) note: not all tools are available on all nightlies help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9 ``` Closes https://github.com/rust-lang/rust/issues/85683 by explaining better why the error is expected.
2022-07-13Rollup merge of #98848 - flip1995:clippy-book, r=jyn514Guillaume Gomez-0/+2
Build the Clippy book as part of x.py doc r? ``@ehuss`` since you said you would be interested in helping moving this forward. cc ``@jyn514`` as part of the bootstrap team.
2022-07-13Auto merge of #99149 - ferrocene:pa-nightly-branch, r=Mark-Simulacrumbors-8/+6
Configure nightly branch name in `stage0.json` The beta version number detection code relies on git to know how many merge commits were made since we branched off, and in doing so hardcodes `master` as the default branch name. This works for rust-lang/rust, but is problematic for forks that use a different default branch name (in Ferrocene we use `main` instead). This PR changes the code to instead load the default branch name from `src/stage0.json`. `bump-stage0` has also been updated to remove the need to update it every time a new field is added to `stage0.json`.
2022-07-12Auto merge of #99165 - matthiaskrgr:rollup-rqpelfa, r=matthiaskrgrbors-3/+32
Rollup of 8 pull requests Successful merges: - #97210 (Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`) - #99055 (Fix rustdoc help options) - #99075 (Fix duplicated type annotation suggestion) - #99124 (Fix sized check ICE in asm check) - #99142 (fix(doctest): treat fatal parse errors as incomplete attributes) - #99145 (Don't rerun the build script for the compiler each time on non-windows platforms) - #99146 (Do not error during method probe on `Sized` predicates for types that aren't the method receiver) - #99161 (compiletest: trim edition before passing as flag) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-11Rollup merge of #97210 - Milo123459:clippy-args, r=jyn514Matthias Krüger-3/+32
Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy` Resolves #97059 This PR adds support for `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`.
2022-07-11Auto merge of #96978 - lqd:win_pgo2, r=Mark-Simulacrumbors-3/+72
Utilize PGO for windows x64 rustc dist builds This PR adds PGO support for the CI x64 windows dist builds. These are the results from running the rustc-perf benchmarks: ![image](https://user-images.githubusercontent.com/247183/177662869-683a8034-7c95-42bf-9900-9ffd66677fcf.png) Thanks to `@Kobzol,` `@michaelwoerister,` `@wesleywiser,` `@Mark-Simulacrum` for their precious help.
2022-07-11extend bootstrap for PGO on windowsRémy Rakic-3/+72
When building LLVM/LLD as part of a build that asks LLVM to generate profiles, e.g. when doing PGO, cmake or clang-cl don't automatically link clang's profiler runtime in, causing undefined reference errors at link-time. We do that manually, by adding clang's resource library folder to the library search path: - for LLVM itself, by extending the linker args that `rustc_llvm`'s build script uses, to avoid the linker errors when linking `rustc_driver`. - for LLD, by extending cmake's linker flags during the LLD build step.
2022-07-11 configure nightly branch name in stage0.jsonPietro Albini-8/+6
2022-07-11clippy argument supportMilo-3/+32
2022-07-11Auto merge of #98369 - jyn514:configure.py, r=Mark-Simulacrumbors-5/+3
Remove unsupported options in configure.py I've seen people using `optimize = false` and `full-bootstrap = true` in the past, without knowing that they're not recommended. Remove `optimize` and a few other options that are always a bad idea, and document that full-bootstrap is only for testing reproducible builds.
2022-07-11Auto merge of #99130 - jyn514:std-cache-invalidation, r=Mark-Simulacrumbors-22/+38
Fix `x build library/std compiler/rustc` Previously, this was broken because of improper caching: 1. `StepDescription::maybe_run` builds `Compile::Std`, which only built `std` and not `proc_macro` 1. `Std` calls `builder.ensure(StdLink)` 1. `Rustc` calls `ensure(Std)`, which builds all crates, including `proc_macro` 1. `Rustc` calls `ensure(StdLink)`. `ensure` would see that it had already been run and do nothing. <-- bug is here 1. Cargo gives an error that `proc_macro` doesn't exist. This fixes the caching by adding `crates` to `StdLink`, so it will get rerun if the crates that are built change. Fixes https://github.com/rust-lang/rust/issues/99129.
2022-07-10Give a better error when `x dist` fails for an optional toolJoshua Nelson-1/+5
Before: ``` thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9 ``` After: ``` thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure) note: not all tools are available on all nightlies help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9 ```
2022-07-11Auto merge of #98526 - jyn514:download-llvm-outside-checkout, r=Mark-Simulacrumbors-29/+34
Allow using `download-ci-llvm = true` outside the git checkout `@bjorn3` noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled: ``` $ ./rust2/x.py build fatal: not a git repository (or any of the parent directories): .git thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version" expected success, got: exit status: 128', src/bootstrap/native.rs:134:20 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Support it too for consistency. It's unclear to me when anyone would need to use this, but `@bjorn3` feels we should support it, and it's not much additional effort to get it working.
2022-07-10Fix `x build library/std compiler/rustc`Joshua Nelson-22/+38
Previously, this was broken because of improper caching: 1. `StepDescription::maybe_run` builds `Compile::Std`, which only built `std` and not `proc_macro` 1. `Std` calls `builder.ensure(StdLink)` 1. `Rustc` calls `ensure(Std)`, which builds all crates, including `proc_macro` 1. `Rustc` calls `ensure(StdLink)`. `ensure` would see that it had already been run and do nothing. <-- bug is here 1. Cargo gives an error that `proc_macro` doesn't exist. This fixes the caching by adding `crates` to `StdLink`, so it will get rerun if the crates that are built change. This also does the same for `RustcLink`; it doesn't matter in practice currently because nothing uses it except `impl Step for Rustc`, but it will avoid bugs if we start using it in the future (e.g. to build individual crates for rustfmt).
2022-07-11Fix `download-ci-llvm` NixOS patching for binariesoxalica-2/+2
LLVM tools should also be patched, since they are used in some tests, specially, - src/test/run-make-fulldeps/cross-lang-lto (llvm-ar) - src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs (llvm-ar) - src/test/run-make-fulldeps/issue-64153 (llvm-objdump) To be more future proof, we should patch all binaries in `bin`.
2022-07-10Allow using `download-ci-llvm = true` outside the git checkoutJoshua Nelson-29/+34
@bjorn3 noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled: ``` $ ./rust2/x.py build fatal: not a git repository (or any of the parent directories): .git thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version" expected success, got: exit status: 128', src/bootstrap/native.rs:134:20 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Support it too for consistency. It's unclear to me when anyone would need to use this, but @bjorn3 feels we should support it, and it's not much additional effort to get it working. This also updates a bunch of other git commands that were similarly depending on the current directory.
2022-07-10Remove unsupported options in configure.pyJoshua Nelson-5/+3
I've seen people using `optimize = false` and `full-bootstrap = true` in the past, without knowing that they're not recommended. Remove `optimize` and a few other options that are always a bad idea, and document that full-bootstrap is only for testing reproducible builds.
2022-07-09Update submodule rust-installerMichael Howell-1/+1
This includes the following pull requests: * https://github.com/rust-lang/rust-installer/pull/114 * https://github.com/rust-lang/rust-installer/pull/113
2022-07-09Auto merge of #98328 - topjohnwu:fix_cross, r=jyn514bors-1/+22
Fix several issues during cross compiling - When cross compiling LLVM on an arm64 macOS machine to x86_64, CMake will produce universal binaries by default, causing link errors. Explicitly set `CMAKE_OSX_ARCHITECTURES` to the one single target architecture so that the executables and libraries will be single architecture. - When cross compiling rustc with `llvm.clang = true`, `CLANG_TABLEGEN` has to be set to the host `clang-tblgen` executable to build clang.
2022-07-08Rollup merge of #98798 - jyn514:download-rustc-cached, r=Mark-SimulacrumMatthias Krüger-1/+3
Fix caching bug in `download-rustc = true` When moving this to rustbuild, I introduced a bug: if you had the file already downloaded, but deleted the sysroot for whatever reason, rustbuil would fail to unpack the cached tarball. This only affects people if they have a cached tarball, which is probably why we haven't seen an issue yet - wiping `build/cache` would work around the issue, or just not deleting `build/$TARGET/stage2`. Fixes the following error: ``` thread 'main' panicked at 'fs::read_dir(&lib_dir) failed with No such file or directory (os error 2) ("/home/jnelson/rust-lang/rust2/build/x86_64-unknown-linux-gnu/ci-rustc/lib")', config.rs:1563:20 ``` r? ``@Mark-Simulacrum``
2022-07-07Rollup merge of #98994 - kons-9:dont_use_process_exit, r=jyn514Matthias Krüger-41/+48
replace process exit with more detailed exit in src/bootstrap/*.rs Fixes [#98830](https://github.com/rust-lang/rust/issues/98830) I implemeted "detail_exit.rs" in lib.rs, and replace all of std::process::exit. So, error code should panic in test code. ``` // lib.rs pub fn detail_exit(code: i32) -> ! { // Successful exit if code == 0 { std::process::exit(0); } if cfg!(test) { panic!("status code: {}", code); } else { std::panic::resume_unwind(Box::new(code)); } } ``` <details> <summary>% rg "exit\(" src/bootstrap/*.rs</summary> ``` builder.rs 351: crate::detail_exit(1); 1000: crate::detail_exit(1); 1429: crate::detail_exit(1); compile.rs 1331: crate::detail_exit(1); config.rs 818: crate::detail_exit(2); 1488: crate::detail_exit(1); flags.rs 263: crate::detail_exit(exit_code); 349: crate::detail_exit(exit_code); 381: crate::detail_exit(1); 602: crate::detail_exit(1); 616: crate::detail_exit(1); 807: crate::detail_exit(1); format.rs 35: crate::detail_exit(1); 117: crate::detail_exit(1); lib.rs 714: detail_exit(1); 1620: detail_exit(1); 1651:pub fn detail_exit(code: i32) -> ! { 1654: std::process::exit(0); sanity.rs 107: crate::detail_exit(1); setup.rs 97: crate::detail_exit(1); 290: crate::detail_exit(1); test.rs 676: crate::detail_exit(1); 1024: crate::detail_exit(1); 1254: crate::detail_exit(1); tool.rs 207: crate::detail_exit(1); toolstate.rs 96: crate::detail_exit(3); 111: crate::detail_exit(1); 182: crate::detail_exit(1); 228: crate::detail_exit(1); util.rs 339: crate::detail_exit(1); 378: crate::detail_exit(1); 468: crate::detail_exit(1); ``` </details>
2022-07-07squash the commitstoshiki goto-41/+48
implement detail_exit but I'm not sure it is right. not create new file and write detail exit in lib.rs replace std::process::exit to detail_exit that is not related to code runnning. remove pub
2022-07-06Build the Clippy book as part of x.py docflip1995-0/+2