about summary refs log tree commit diff
path: root/src/bootstrap/check.rs
AgeCommit message (Collapse)AuthorLines
2022-10-31Detect unused files in `src/test/mir-opt` and error on them in tidy.Jakob Degen-0/+1
2022-10-26Add cargo miri to x.py checkOli Scherer-0/+1
2022-10-12Enable `x.py check` for miriOli Scherer-4/+2
2022-09-21HACK: Treat miri as if it were a submoduleOli Scherer-1/+3
2022-09-21Remove miri from the submodule list and require it for CI to passOli Scherer-1/+1
2022-08-27Sunset RLSEric Huss-1/+1
2022-08-02Rollup merge of #99293 - jo3bingham:issue-98720-fix, r=jyn514Matthias Krüger-1/+7
only run --all-targets in stage0 for Std Repro'd the issue with `python3 x.py check --stage 1 library/std` and tested the fix with the same command. r? `@jyn514` I tried to implement [this solution](https://github.com/rust-lang/rust/issues/98720#issuecomment-1184435462), but didn't have any luck. I don't think I fully understood what needed to be done. However, I would love to be mentored on it since it would be a more correct solution, and I can learn more about how bootstrap works.
2022-08-01add commentJoseph Bingham-0/+3
2022-07-24Small fixupsJoshua Nelson-1/+1
- 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-24Use compiler.stageAmos Wenger-1/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
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/+59
2022-07-15only run --all-targets in stage0Joseph Bingham-1/+4
2022-07-11Rollup merge of #97210 - Milo123459:clippy-args, r=jyn514Matthias Krüger-2/+16
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-11clippy argument supportMilo-2/+16
2022-07-02Allow building single crates for the compiler and standard libraryJoshua Nelson-2/+2
- Add `Interned<Vec<String>>` and use it for tail args - Refactor `cache.rs` not to need a separate impl for each internable type
2022-04-24Rollup merge of #95504 - jyn514:library-alias, r=Mark-SimulacrumMatthias Krüger-2/+2
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-10Remove duplicate aliases for `codegen_{cranelift,gcc}`Joshua Nelson-6/+1
Bootstrap already allows selecting these in `PathSet::has`, which allows any string that matches the end of a full path. I found these by adding `assert!(path.exists())` in `StepDescription::paths`. I think ideally we wouldn't have any aliases that aren't paths, but I've held off on enforcing that here since it may be controversial, I'll open a separate PR.
2022-03-30Add `x {check,build,doc} {compiler/library}` aliases.Joshua Nelson-2/+2
While working on https://github.com/rust-lang/rust/pull/95503, I realized that this will interfere with existing command lines: Currently people run `x build library/std` expecting it to be added to the sysroot, but after that change, it will *only* build `libstd` without making it available for the toolchain. It's debatable whether that's a breaking change that will be accepted; if so, this PR is absolutely necessary to make sure there's a command for "build the standard library and add it to the sysroot". Even if not, though, I think `x build library` is more clear about what actually happens than the current `x build library/std`. For consistency, also add support for `compiler` and all other command variants. Note that `doc compiler` was already supported, so in a sense this is just fixing an existing inconsistency. I plan to change the dev-guide and various instructions in the README to `build library` once this is merged.
2021-09-28Rollup merge of #87260 - antoyo:libgccjit-codegen, r=Mark-SimulacrumGuillaume Gomez-2/+7
Libgccjit codegen This PR introduces a subtree for a gcc-based codegen backend to the repository, per decision in https://github.com/rust-lang/compiler-team/issues/442. We do not yet expect to ship this backend on nightly or run tests in CI, but we do verify that the backend checks (i.e., `cargo check`) successfully. Work is expected to progress primarily in https://github.com/rust-lang/rustc_codegen_gcc, with semi-regular upstreaming, like with other subtrees.
2021-09-20Adjust to SourceType::InTree in several placesMark Rousskov-1/+1
These were left over in migrations to subtrees, which should generally be treated as-if it was local. Also fixes a warning caused by this change.
2021-08-31x.py clippy: don't run with --all-targets by defaultMatthias Krüger-2/+18
this caused a lot of noise because benchmarks and tests were also checked
2021-08-13Enable `--all-targets` for `x.py check` unconditionallyJoshua Nelson-37/+29
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-12Fix tidyAntoni Boucher-2/+7
2021-07-20Update all submodules that rustbuild doesn't depend on lazilyJoshua Nelson-1/+3
This only updates the submodules the first time they're needed, instead of unconditionally the first time you run x.py. Ideally, this would move *all* submodules and not exclude some tools and backtrace. Unfortunately, cargo requires all `Cargo.toml` files in the whole workspace to be present to build any crate. On my machine, this takes the time for an initial submodule clone (for `x.py --help`) from 55.70 to 15.87 seconds. This uses exactly the same logic as the LLVM update used, modulo some minor cleanups: - Use a local variable for `src.join(relative_path)` - Remove unnecessary arrays for `book!` macro and make the macro simpler to use - Add more comments
2021-05-14Don't copy tool dependencies to the sysrootJoshua Nelson-4/+0
This fixes the following error: ``` error: found crates (`serde_derive` and `serde_derive`) with colliding StableCrateId values. --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cargo_metadata-0.8.2/src/lib.rs:162:1 | 162 | extern crate serde_derive; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` This is a bug in resolve (https://github.com/rust-lang/rust/issues/56935) but it will be difficult to fix in the near future. This works around it in the meantime by not copying serde_derive and other dependencies to the sysroot when they're built for other tools. This rebuilds the dependencies slightly more often than necessary, but avoids the crate conflicts. This can be reverted once #56935 is fixed.
2021-05-14Update bootstrap for in-tree rustfmtJoshua Nelson-1/+2
- 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-07Allow checking miri and RLS with `x.py check src/tools/{miri,rls}`Joshua Nelson-1/+4
2021-05-01Don't check bootstrap artifacts by defaultJoshua Nelson-3/+3
Bootstrap has to build successfully or this won't run, so all it checks are the tests, which are uncommon to change.
2021-04-28Rollup merge of #84585 - jyn514:check-rustdoc, r=Mark-SimulacrumJack Huey-3/+3
Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc` I keep making this typo, it would be nice for it to be supported.
2021-04-28Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc`Joshua Nelson-3/+3
2021-04-27Switch `rustc::internal` from deny to warnJoshua Nelson-1/+1
These should still obey deny-warnings.
2021-04-23Don't rebuild rustdoc after checking bootstrapJoshua Nelson-5/+3
This works by unconditionally passing -Z unstable-options to the compiler. This has no affect in practice since bootstrap doesn't use `deny(rustc::internal)`.
2021-02-24Remove `ENABLE_DOWNLOAD_RUSTC` constantJoshua Nelson-4/+0
This was introduced as part of the MVP for `download-rustc`. Unfortunately, it doesn't work very well: - Steps are ignored by default, which makes it easy to leave out a step that should be built. For example, the MVP forgot to enable any tests, so it was *only* possible to build locally. - It didn't work correctly even when it was enabled: calling `builder.ensure()` would completely ignore the constant and rebuild the step anyway. This has no obvious fix since `ensure()` has to return a `Step::Output`. Instead, this handles `download-rustc` in `impl Step for Rustc` and `impl Step for Std`, which to my knowledge are the only build steps that don't first go through `impl Step for Sysroot` (`Rustc` is used for the `rustc-dev` component). See https://github.com/rust-lang/rust/pull/79540#discussion_r563350075 and https://github.com/rust-lang/rust/issues/81930 for further context. Here are some example runs with these changes and `download-rustc` enabled: ``` $ x.py build src/tools/clippy Building stage1 tool clippy-driver (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 1m 09s Building stage1 tool cargo-clippy (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.11s $ x.py test src/tools/clippy Updating only changed submodules Submodules updated in 0.01 seconds Finished dev [unoptimized + debuginfo] target(s) in 0.09s Building stage1 tool clippy-driver (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.09s Building rustdoc for stage1 (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.28s Finished release [optimized] target(s) in 15.26s Running build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps/clippy_driver-8b407b140e0aa91c test result: ok. 592 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out $ x.py build src/tools/rustdoc Building rustdoc for stage1 (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 41.28s Build completed successfully in 0:00:41 $ x.py test src/test/rustdoc-ui Building stage0 tool compiletest (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.12s Building rustdoc for stage1 (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.10s test result: ok. 105 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 8.15s $ x.py build compiler/rustc Finished dev [unoptimized + debuginfo] target(s) in 0.09s Build completed successfully in 0:00:00 ``` Note a few things: - Clippy depends on stage1 rustc-dev artifacts, but rustc didn't have to be recompiled. Instead, the artifacts were copied automatically. - All steps are always enabled. There is no danger of forgetting a step, since only the entrypoints have to handle `download-rustc`. - Building the compiler (`compiler/rustc`) automatically does no work.
2021-02-08Absolute bare minimum for downloading rustc from CIJoshua Nelson-0/+4
- Use the same compiler for stage0 and stage1. This should be fixed at some point (so bootstrap isn't constantly rebuilt). - Make sure `x.py build` and `x.py check` work. - Use `git merge-base` to determine the most recent commit to download. - Copy stage0 to the various sysroots in `Sysroot`, and delegate to Sysroot in Assemble. Leave all other code unchanged. - Rename date -> key This can also be a commit hash, so 'date' is no longer a good name. - Add the commented-out option to config.toml.example - Disable all steps by default when `download-rustc` is enabled Most steps don't make sense when downloading a compiler, because they'll be pre-built in the sysroot. Only enable the ones that might be useful, in particular Rustdoc and all `check` steps. At some point, this should probably enable other tools, but rustdoc is enough to test out `download-rustc`. - Don't print 'Skipping' twice in a row Bootstrap forcibly enables a dry run if it isn't already set, so previously it would print the message twice: ``` Skipping bootstrap::compile::Std because it is not enabled for `download-rustc` Skipping bootstrap::compile::Std because it is not enabled for `download-rustc` ``` Now it correctly only prints once. ## Future work - Add FIXME about supporting beta commits - Debug logging will never work. This should be fixed.
2021-01-21Deny internal lints for rustdocJoshua Nelson-0/+7
2021-01-16Print which stage is being checked (now that it may not be stage0)Joshua Nelson-7/+14
2021-01-16Support non-stage0 checkMark Rousskov-8/+22
2021-01-04./x.py clippy: allow the most noisy lintsMatthias Krüger-0/+11
This silences the following clippy lints in ./x.py clippy: many_single_char_names (there are a lot of warnings caused by stdarch) collapsible_if (can reduce readability) type_complexity missing_safety_doc (there are almost 3K warnings issued) too_many_arguments needless_lifetimes (people want 'tcx lifetimes etc) wrong_self_convention (warns about from_..(), to_..(), into_..().. fns that do or do not take self by reference.
2020-11-14Print 'checking cranelift artifacts' to easily separate it from other artifactsJoshua Nelson-0/+5
Before: ``` Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Checking rustdoc v0.0.0 (/home/joshua/rustc/src/librustdoc) Checking rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc) Finished release [optimized] target(s) in 2.08s Checking regalloc v0.0.31 Checking gimli v0.22.0 Checking object v0.21.1 Checking cranelift-codegen v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece) Checking cranelift-module v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece) Checking cranelift-native v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece) Checking cranelift-frontend v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece) Checking cranelift-object v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece) Checking cranelift-simplejit v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece) Checking rustc_codegen_cranelift v0.1.0 (/home/joshua/rustc/compiler/rustc_codegen_cranelift) Finished release [optimized] target(s) in 10.55s ``` After: ``` Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Checking rustdoc v0.0.0 (/home/joshua/rustc/src/librustdoc) Checking rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc) Finished release [optimized] target(s) in 2.08s Checking cranelift artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Checking cranelift-codegen v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece) ```
2020-11-11Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-SimulacrumJonas Schievink-2/+2
Support enable/disable sanitizers/profiler per target This PR add options under `[target.*]` of `config.toml` which can enable or disable sanitizers/profiler runtime for corresponding target. If these options are empty, the global options under `[build]` will take effect. Fix #78329
2020-11-05Get `--fix` working for everything except rustdocJoshua Nelson-3/+14
Here's the error for rustdoc: ``` Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) error: no library targets found in package `rustdoc-tool` ```
2020-10-26x.py fmtJoshua Nelson-3/+1
2020-10-26Add --fix support to `x.py clippy`Joshua Nelson-11/+17
2020-10-26Add support for using cg_clif to bootstrap rustcbjorn3-1/+67
2020-10-26Support enable/disable sanitizers/profiler per target12101111-2/+2
2020-10-03Place all-targets checking behind a flagMark Rousskov-30/+39
This matches Cargo behavior and avoids the (somewhat expensive) double checking, as well as the unfortunate duplicate error messages (#76822, rust-lang/cargo#5128).
2020-09-03Check test/example/benchmark on x.py checkMark Rousskov-1/+60
Often when modifying compiler code you'll miss that you've changed an API used by unit tests, since x.py check didn't previously catch that. It's also useful to have this for editing with rust-analyzer and similar tooling where editing tests previously didn't notify you of errors in test files.
2020-09-02Avoid spurious print outs during dryrunMark Rousskov-2/+2
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-9/+9
`rustc` allows passing in predefined target triples as well as JSON target specification files. This change allows bootstrap to have the first inkling about those differences. This allows building a cross-compiler for an out-of-tree architecture (even though that compiler won't work for other reasons). Even if no one ever uses this functionality, I think the newtype around the `Interned<String>` improves the readability of the code.