about summary refs log tree commit diff
path: root/src/bootstrap/builder.rs
AgeCommit message (Collapse)AuthorLines
2022-03-30Spellchecking some commentsYuri Astrakhan-1/+1
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-27[bootstrap] Don't print `Suite not skipped` unless `--verbose` is setJoshua Nelson-2/+2
This was so verbose before that it made it hard to see what effect the flag actually had. Before: ``` Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/ui) because it is excluded Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/mir-opt) because it is excluded Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ... about 100 more lines ... ``` After: ``` Skipping Suite(test::src/test/ui) because it is excluded Skipping Suite(test::src/test/mir-opt) because it is excluded Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ```
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-1/+1
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-15fix typosDylan DPC-1/+1
2022-03-13Auto merge of #94738 - Urgau:rustbuild-check-cfg-values, r=Mark-Simulacrumbors-1/+6
Enable conditional checking of values in the Rust codebase This pull-request enable conditional checking of (well known) values in the Rust codebase. Well known values were added in https://github.com/rust-lang/rust/pull/94362. All the `target_*` values are taken from all the built-in targets which is why some extra values were needed do be added as they are not (yet ?) defined in any built-in targets. r? `@Mark-Simulacrum`
2022-03-11Remove unneeded conversions in bootstrapping codepierwill-8/+4
Fixes warnings from `clippy::useless_conversion` in `src/bootstrap`.
2022-03-09Enable conditional checking of values in the Rust codebaseLoïc BRANSTETT-1/+6
2022-03-07copy over `std::path::absolute` instead of adding `canonicalize` hacksJoshua Nelson-3/+3
this also fixes a bug where bootstrap would try to use the fake `rustc` binary built by bootstrap - cargo puts it in a different directory when using `cargo run` instead of x.py
2022-03-05Merge build_helper into utilbjorn3-2/+1
2022-03-05Remove build_helperbjorn3-2/+1
The majority of the code is only used by either rustbuild or rustc_llvm's build script. Rust_build is compiled once for rustbuild and once for every stage. This means that the majority of the code in this crate is needlessly compiled multiple times. By moving only the code actually used by the respective crates to rustbuild and rustc_llvm's build script, this needless duplicate compilation is avoided.
2022-03-04Enable conditional compilation checking on the Rust codebaseLoïc BRANSTETT-0/+28
2022-03-03bootstrap: correct reading of flags for llvmJon Gjengset-3/+4
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2022-01-30Rollup merge of #92887 - pietroalbini:pa-bootstrap-update, r=Mark-SimulacrumEric Huss-13/+4
Bootstrap compiler update r? ``@Mark-Simulacrum``
2022-01-28update cfg(bootstrap)sPietro Albini-13/+4
2022-01-23Auto merge of #93047 - matthiaskrgr:defer__dist_PlainSourceTarball, ↵bors-1/+5
r=Mark-Simulacrum build: dist: defer PlainSourceTarball Apparently it changes some tool sources and invalidates their fingerprints, forcing us to build them several times (before and after vendoring sources). I have not dug into why vendoring actually invalidates the figreprints, but moving the vendoring lower in the pipeline seems to avoid the issue. I could imagine that we somehow write a .cargo/config somewhere which somehow makes subsequent builds use the vendored deps but I was not able to find anything. I checked the sizes of generated archives pre and post patch and their are the same, so I hope there is no functional change. Fixes #93033
2022-01-21allow excluding paths only from a single modulePietro Albini-31/+117
x.py has support for excluding some steps from the invocation, but unfortunately that's not granular enough: some steps have the same name in different modules, and that prevents excluding only *some* of them. As a practical example, let's say you need to run everything in `./x.py test` except for the standard library tests, as those tests require IPv6 and need to be executed on a separate machine. Before this commit, if you were to just run this: ./x.py test --exclude library/std ...the execution would fail, as that would not only exclude running the tests for the standard library, it would also exclude generating its documentation (breaking linkchecker). This commit adds support for an optional module annotation in --exclude paths, allowing the user to choose which module to exclude from: ./x.py test --exclude test::library/std This maintains backward compatibility, but also allows for more ganular exclusion. More examples on how this works: | `--exclude` | Docs | Tests | | ------------------- | ------- | ------- | | `library/std` | Skipped | Skipped | | `doc::library/std` | Skipped | Run | | `test::library/std` | Run | Skipped | Note that the new behavior only works in the `--exclude` flag, and not in other x.py arguments or flags yet.
2022-01-21replace paths in PathSet with a dedicated TaskPath structPietro Albini-14/+28
2022-01-19build: dist: defer PlainSourceTarballMatthias Krüger-1/+5
Apparently it changes some tool sources and invalidates their fingerprints, forcing us to build them several times (before and after vendoring sources). I have not dug into why vendoring actually invalidates the figreprints, but the moving the vendoring lower in the pipeline seems to avoid the issue. I could imagine that we somehow write a .cargo/config somewhere which somehow makes subsequent builds use the vendored deps but I was not able to find anything. I checked the sizes of generated archives pre and post patch and their are the same, so I hope there is not functional change. Fixes #93033
2022-01-04Do not use deprecated -Zsymbol-mangling-version in bootstrapJakub Beránek-3/+13
2022-01-01Remove some dead codebjorn3-2/+1
2021-12-17pass -Wl,-z,origin to set DF_ORIGIN when using rpathSébastien Marie-0/+1
DF_ORIGIN flag signifies that the object being loaded may make reference to the $ORIGIN substitution string. Some implementations are just ignoring DF_ORIGIN and do substitution for $ORIGIN if present (whatever DF_ORIGIN pr Set the flag inconditionally if rpath is wanted.
2021-12-09Don't print bootstrap caching/ensure info unless `-vv` is passedJoshua Nelson-3/+3
Previously, passing `-v` would emit an overwhelming amount of logging: ``` > Std { stage: 1, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } > Assemble { target_compiler: Compiler { stage: 1, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } < Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > Rustc { target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None }, compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > Std { target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None }, compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > StartupObjects { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } < StartupObjects { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } c Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > 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 } } > Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } < Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } < 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 } } c 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 } } c Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } c Assemble { target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } > StdLink { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } c 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 } } c 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 } } < StdLink { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target_compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } < Std { target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None }, compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } ... continues for another 150 lines ... ``` This info is occasionally useful when debugging bootstrap itself, but not very useful for figuring out why a config option was ignored or command wasn't run. Demote it to `-vv` logging so that `-v` is more useful.
2021-10-28Document clippy on nightly-rustcxFrednet-0/+1
2021-10-19Make new symbol mangling scheme default for compiler itself.Michael Woerister-1/+19
2021-10-16bootstrap: tweak verbosity settingsXimin Luo-1/+1
Currently the verbosity settings are: - 2: RUSTC-SHIM envvars get spammed on every invocation, O(30) lines cargo is passed -v which outputs CLI invocations, O(5) lines - 3: cargo is passed -vv which outputs build script output, O(0-10) lines This commit changes it to: - 1: cargo is passed -v, O(5) lines - 2: cargo is passed -vv, O(10) lines - 3: RUSTC-SHIM envvars get spammed, O(30) lines
2021-10-13Rollup merge of #89759 - jyn514:x-build-assemble, r=Mark-SimulacrumMatthias Krüger-1/+1
Assemble the compiler when running `x.py build` Previously, there was no way to actually get binaries in `build/$TARGET/stage1/bin` without building the standard library. This makes it possible to build just the compiler. This can be useful when the standard library isn't actually necessary for trying out your tests (e.g. a bug that can be reproduced with only a `no_core` crate). Closes https://github.com/rust-lang/rust/issues/73519.
2021-10-13Assemble the compiler when running `x.py build`Joshua Nelson-1/+1
Previously, there was no way to actually get binaries in `build/$TARGET/stage1/bin` without building the standard library. This makes it possible to build just the compiler. This can be useful when the standard library isn't actually necessary for trying out your tests (e.g. a bug that can be reproduced with only a `no_core` crate).
2021-10-11Rollup merge of #89760 - jyn514:remove-incremental-hack, r=Mark-SimulacrumMatthias Krüger-6/+0
Remove hack ignoring unused attributes for stage 0 std This seems to no longer be giving spurious errors when incremental is enabled. Closes https://github.com/rust-lang/rust/issues/58633.
2021-10-11Remove hack ignoring unused attributes for stage 0 stdJoshua Nelson-6/+0
This seems to no longer be giving spurious errors when incremental is enabled.
2021-09-24Simplify explicit request checkGuillaume Gomez-0/+16
2021-08-26switch stage0.txt to stage0.json and add a tool to generate itPietro Albini-1/+1
2021-08-20Auto merge of #88000 - bjorn3:fix_cg_llvm_clif_compile, r=Mark-Simulacrumbors-1/+1
Fix compiling other codegen backends when llvm is enabled Extracted from #81746 Without this change rustbuild will not pass the required linker argument to find libllvm. While other backends likely don't use libllvm, it is necessary to be able to link against rustc_driver as the llvm backend is linked into it.
2021-08-13Enable `--all-targets` for `x.py check` unconditionallyJoshua Nelson-1/+1
Now that Cargo deduplicates diagnostics from different targets, this doesn't flood the console with duplicate errors. Note that this doesn't add `--all-targets` in `Builder::cargo` directly because `impl Step for Std` actually wants to omit `--all-targets` the first time while it's still building libtest. When passed `--all-targets`, this warns that the option isn't needed, but still continues to compile.
2021-08-13Fix compiling other codegen backends when llvm is enabledbjorn3-1/+1
2021-08-06Auto merge of #87822 - JohnTitor:rollup-kxojii0, r=JohnTitorbors-1/+1
Rollup of 7 pull requests Successful merges: - #85807 (bootstrap: Disable initial-exec TLS model on powerpc) - #87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.) - #87775 (Add hint for unresolved associated trait items if the trait has a single item) - #87779 (Remove special case for statement `NodeId` assignment) - #87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`) - #87809 (Fix typo in the ptr documentation) - #87816 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-08-07Rollup merge of #85807 - glaubitz:powerpc-disable-initial-exec-tls, ↵Yuki Okushi-1/+1
r=Mark-Simulacrum bootstrap: Disable initial-exec TLS model on powerpc Fixes #81334.
2021-08-06Add options for enabling overflow checks in rustc and std.Hans Kratz-0/+8
The options are `overflow-checks` and `overflow-checks-std` defaulting to false.
2021-07-23refactor extended tarball generaton to use the new ensure_if_defaultPietro Albini-7/+37
2021-07-01Document rustfmt on nightly-rustcJoshua Nelson-1/+1
The recursion_limit attribute avoids the following error: ``` error[E0275]: overflow evaluating the requirement `std::ptr::Unique<rustc_ast::Pat>: std::marker::Send` | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustfmt_nightly`) ```
2021-06-29Use a macro for documenting rustdocJoshua Nelson-0/+1
2021-06-28Add new tool to check HTML:Guillaume Gomez-0/+1
* Make html-checker run by default on rust compiler docs as well * Ensure html-checker is run on CI * Lazify tidy binary presence check
2021-06-17Lazify is_really_default condition in the RustdocGUI bootstrap stepThe8472-5/+23
The `RustdocGUI::should_run` condition spawns `npm list` several times which adds up to seconds of wall-time. Evaluate the condition lazily to to keep `./x.py test tidy` and similar short-running tasks fast.
2021-06-07build doctests with lld if use-lld = trueThe8472-0/+4
2021-06-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-0/+12
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
2021-06-03fix testing Miri with --stage 0Ralf Jung-1/+9
2021-05-31bootstrap: Disable initial-exec TLS model on powerpcJohn Paul Adrian Glaubitz-1/+1
Fixes #81334.
2021-05-31Build crtbengin.o/crtend.o from source code12101111-1/+2
2021-05-14Update bootstrap for in-tree rustfmtJoshua Nelson-0/+1
- Add rustfmt to `x.py check` - Update Cargo.lock - Remove rustfmt from the toolstate list - Make rustfmt an in-tree tool - Give an error on `x.py test rustfmt` if rustfmt fails to build or if tests fail - Don't call `save_toolstate` when testing rustfmt
2021-05-11Rollup merge of #85051 - jyn514:check-miri, r=Mark-SimulacrumYuki Okushi-0/+2
Allow checking miri and RLS with `x.py check src/tools/{miri,rls}` Helps with https://github.com/rust-lang/rust/issues/80639. `@Xanewok` would you find this useful for RLS too?
2021-05-08Enable `-W semicolon_in_expressions_from_macros` in bootstrapAaron Hill-6/+1
Now that stdarch has been updated, we can do this without breaking the build.