about summary refs log tree commit diff
path: root/src/bootstrap/flags.rs
AgeCommit message (Collapse)AuthorLines
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-4/+4
2022-12-31Fix panic on `x build --help`Joshua Nelson-22/+22
2022-12-27Auto merge of #106168 - jyn514:clean-crates, r=Mark-Simulacrumbors-8/+2
Allow cleaning individual crates As a bonus, this stops special casing `clean` in `Builder`. ## Motivation Cleaning artifacts isn't strictly necessary to get cargo to rebuild; `touch compiler/rustc_driver/src/lib.rs` (for example) will also work. There's two reasons I thought making this part of bootstrap proper was a better approach: 1. `touch` does not *remove* artifacts, it just causes a rebuild. This is unhelpful for when you want to measure how long the compiler itself takes to build (e.g. for https://github.com/rust-lang/rust/issues/65031). 2. It seems a little more discoverable; and I want to extend it in the future to things like `x clean --stage 1 rustc`, which makes it easier to work around https://github.com/rust-lang/rust/issues/76720 without having to completely wipe all the stage 0 artifacts, or having to be intimately familiar with which directories to remove.
2022-12-26Allow cleaning individual cratesJoshua Nelson-8/+2
As a bonus, this stops special casing `clean` in `Builder`.
2022-12-26Fix panic on `x build --help --verbose`Joshua Nelson-1/+11
This also makes the panic message a little more informative in case it happens again.
2022-12-17Remove special cases for setup subcommandBenjamin Tong-3/+3
- Remove setup special-casing in Flags::parse
2022-11-26Don't update submodules for `x setup`Joshua Nelson-4/+5
Before, the submodule handling was very jank and would update *between two interactive prompts*: ``` ; x setup Building rustbuild Finished dev [unoptimized] target(s) in 0.05s Welcome to the Rust project! What do you want to do with x.py? a) library: Contribute to the standard library Please choose one (a/b/c/d/e): a Updating submodule library/backtrace Submodule 'library/backtrace' (https://github.com/rust-lang/backtrace-rs.git) registered for path 'library/backtrace' error: you asked `x.py` to setup a new config file, but one already exists at `config.toml` Build completed unsuccessfully in 0:00:02 ``` That's not a great user experience because you need to wait a long time between prompts. It would be possible to move the submodule handling either before or after the prompt, but it seems better to just not require submodules to be checked out at all, to minimize the time spend waiting just to create a new configuration.
2022-11-06bootstrap: add support for running Miri on a fileRalf Jung-8/+17
2022-10-09Use BOLT in x64 dist CI to optimize LLVMJakub Beránek-0/+6
2022-09-17Add a new component, `rust-json-docs`, to distribute the JSON-formatted ↵Luca Palmieri-1/+19
documentation for std crates in nightly toolchains. We also add a new flag to `x doc`, `--json`, to render the JSON-formatted version alongside the HTML-formatted one.
2022-08-15Revert "Revert "Remove num_cpus dependency from bootstrap, build-manifest ↵The 8472-1/+1
and rustc_session"" This reverts commit 1ae4b258267462da0b1aae1badcf83578153c799.
2022-08-14Impl Debug for some structs of rustbuildohno418-0/+1
2022-07-31Move `x test --skip` to be part of `--exclude`Joshua Nelson-12/+0
`--skip` is inconsistent with the rest of the interface and redundant with `--exclude`. Fix --exclude to work properly for files and directories rather than having a separate flag. If someone needs to use --skip for something other than compiletest, they can use `--test-args --skip` instead.
2022-07-29Don't give a hard error for `x check --keep-stage 0`Joshua Nelson-9/+0
Stage 1 check has been supported since https://github.com/rust-lang/rust/pull/81064. #81064 changed the error message for this, but I don't think there's any reason we should prevent using it. I tested locally and `keep-stage` works fine. Don't give a hard error when trying to use it.
2022-07-11Rollup merge of #97210 - Milo123459:clippy-args, r=jyn514Matthias Krüger-1/+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-1/+16
2022-07-07squash the commitstoshiki goto-7/+6
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-06-30Add a `--build-dir` flag to rustbuildThom Chiovoloni-0/+8
2022-06-09Revert "Remove num_cpus dependency from bootstrap, build-manifest and ↵David Tolnay-1/+1
rustc_session" This reverts commit 2d854f9c340df887e30896f49270ae81feb3e227.
2022-06-03Fully stabilize NLLJack Huey-1/+1
2022-05-28Rollup merge of #97411 - raiyansayeed:print-stderr-consistently, ↵Matthias Krüger-4/+4
r=Mark-Simulacrum Print stderr consistently Solves https://github.com/rust-lang/rust/issues/96712 I tried to follow what I perceived as the general consensus for error messages in boostrap i.e messages that were .. * resulting from an Err(...) => * literally called as "Error: ...." * by the end of the block scope forced to run a panic! or process::exit with a guaranteed non-zero error code.
2022-05-25feat: refactored bootstrap files to use stderr consistentlyRaiyan-4/+4
2022-05-10Add test skip supportCollin Baker-2/+19
libtest already supports a "--skip SUBSTRING" arg which excludes any test names matching SUBSTRING. This adds a "--skip" argument to compiletest and bootstrap which is forwarded to libtest.
2022-04-21Add a test for `--exclude test::XXX`Joshua Nelson-0/+20
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-16bootstrap: consolidate subcommand parsing and matchingAllen Wild-76/+50
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-03-07copy over `std::path::absolute` instead of adding `canonicalize` hacksJoshua Nelson-1/+1
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-07fix weird bug when `out` would get overridden by unit testsJoshua Nelson-1/+1
2022-03-07Don't depend on python for RUST_BOOTSTRAP_CONFIGJoshua Nelson-3/+1
2022-03-05Merge build_helper into utilbjorn3-1/+1
2022-03-05Remove build_helperbjorn3-1/+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-02Remove num_cpus dependency from bootstrap, build-manifest and rustc_sessionbjorn3-1/+1
2022-01-04Tweak the usage messages for `x.py build` and `x.py check`.Nicholas Nethercote-23/+11
They're a bit out of date, and overly complicated.
2021-08-24PGO for LLVM builds on x86_64-unknown-linux-gnu in CIMark Rousskov-2/+18
This shows up to 5% less instruction counts on multiple benchmarks, and up to 19% wins on the -j1 wall times for rustc self-compilation. We can afford to spend the extra cycles building LLVM essentially once more for the x86_64-unknown-linux-gnu CI build today. The builder finishes in around 50 minutes on average, and this adds just 10 more minutes. Given the sizeable improvements in compiler performance, this is definitely worth it.
2021-08-13Enable `--all-targets` for `x.py check` unconditionallyJoshua Nelson-4/+6
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-03Add x.py option to --force-rerun compiletest testsSmitty-0/+10
2021-07-21Make `x.py d` an alias for `x.py doc`inquisitivecrystal-4/+5
2021-05-11Rollup merge of #84783 - jyn514:fmt-one, r=Mark-SimulacrumYuki Okushi-1/+2
Allow formatting specific subdirectories Fixes https://github.com/rust-lang/rust/issues/71094.
2021-05-01Allow formatting specific subdirectoriesJoshua Nelson-1/+2
2021-04-30Fix help for profile flagsTyler Mandry-2/+2
2021-04-30Add support for --run for non-ui testsTyler Mandry-6/+1
2021-04-30Add run flag to bootstrap testTyler Mandry-0/+15
2021-02-16avoid full-slicing slicesMatthias Krüger-1/+1
If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
2021-01-16Support non-stage0 checkMark Rousskov-5/+1
2020-12-22Utilize PGO for rustc linux dist buildsMark Rousskov-0/+7
This implements support for applying PGO to the rustc compilation step (not standard library or any tooling, including rustdoc). Expanding PGO to more tools is not terribly difficult but will involve more work and greater CI time commitment. For the same reason of avoiding greater time commitment, this currently avoids implementing for platforms outside of x86_64-unknown-linux-gnu, though in practice it should be quite simple to extend over time to more platforms. The initial implementation is intentionally minimal here to avoid too much work investment before we start seeing wins for a subset of Rust users. The choice of workloads to profile here is somewhat arbitrary, but the general rationale was to aim for a small set that largely avoided time regressions on perf.rust-lang.org's full suite of crates. The set chosen is libcore, cargo (and its dependencies), and a few ad-hoc stress tests from perf.rlo. The stress tests are arguably the most controversial, but they benefit those cases (avoiding regressions) and do not really remove wins from other benchmarks. The primary next step after this PR lands is to implement support for PGO in LLVM. It is unclear whether we can afford a full LLVM rebuild in CI, though, so the approach taken there may need to be more staggered. rustc-only PGO seems well affordable on linux at least, giving us up to 20% wall time wins on some crates for 15 minutes of extra CI time (1 hour up from 45 minutes). The PGO data is uploaded to allow others to reuse it if attempting to reproduce the CI build or potentially, in the future, on other platforms where an off-by-one strategy is used for dist builds at minimal performance cost.
2020-11-12Add `--color` support to bootstrapJoshua Nelson-0/+30
This allows using bootstrap with https://github.com/Canop/bacon.
2020-10-26Add --fix support to `x.py clippy`Joshua Nelson-1/+5
2020-10-23x.py test --test-args flag description enhancementNelson J Morais-1/+7
2020-10-14x.py: setup: Provide a description of what it doesIan Jackson-3/+10
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-14x.py: setup: Refactor to centralise list of profilesIan Jackson-3/+1
Put all()'s otuput in the order we want to print things in, and add a comment about why they are in this order. Provide purpose() and all_for_help(). Use these things everywhere. Move all the abbrev character ("a", "b", etc.) processing into interactive_path. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-12bootstrap: add --include-default-paths to ./x.pyPietro Albini-0/+7