about summary refs log tree commit diff
path: root/src/bootstrap/tool.rs
AgeCommit message (Collapse)AuthorLines
2022-10-31Auto merge of #102950 - oli-obk:check_miri, r=RalfJungbors-18/+12
Enable `x.py check` for miri Now that the miri subtree is working properly, let's add it to x.py check. cc `@rust-lang/miri`
2022-10-19mark rust-analyzer as a host-only toolPietro Albini-2/+2
All tools meant to be shipped with host toolchains only should be marked as `ONLY_HOSTS = true`, but rust-analyzer was marked as `ONLY_HOSTS = false` incorrectly. This meant that bootstrap attempted to build rust-analyzer for cross-compilation-only targets, causing errors because libstd is not present on some of them. It will still be possible to cross-compile rust-analyzer by passing a different --host flag to ./x, like you can cross-compile other tools.
2022-10-13Remove unused macro argumentOli Scherer-12/+11
2022-10-12Enable `x.py check` for miriOli Scherer-14/+9
2022-10-04Don't build the compiler before building rlsJosh Stone-1/+1
The rls stub is a simple stable tool, which doesn't need compiler libs.
2022-09-21Remove miri from the submodule list and require it for CI to passOli Scherer-2/+2
2022-09-17Rollup merge of #101873 - WaffleLapkin:x-build-proc-macro-srv, r=jyn514Matthias Krüger-10/+22
Allow building `rust-analyzer-proc-macro-srv` as a standalone tool This PR allows building `rust-analyzer-proc-macro-srv` as a standalone tool via `x b proc-macro-srv-cli` (I thought that `x b rust-analyzer-proc-macro-srv` should work, but it doesn't for some reason...). Also this PR adds a copy of `rust-analyzer-proc-macro-srv` binary to `build/{triple}/{stage}/libexec/` when building `rust-analyzer-proc-macro-srv`, so that r-a can pick it up. This is useful to make r-a (and I assume Intellij IDEA) to expand macros when using a custom, build from source toolchain. r? ``@jyn514`` [_zulip thread_](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/How.20to.20fix.20.60UnsupportedABI.60.20for.20custom.20toolchains.3F/near/299040175)
2022-09-16Use `builder.sysroot(...)` instead of a hackMaybe Waffle-6/+2
2022-09-16Allow building `rust-analyzer-proc-macro-srv` as a standalone toolMaybe Waffle-10/+26
2022-09-14jsondoclint: New ToolNixon Enraght-Moony-0/+1
2022-08-27Sunset RLSEric Huss-8/+1
2022-08-27Add replace-version-placeholder toolest31-0/+1
This tool is to be ran at specific points in the release process to replace the version place holder made by stabilizations with the version number.
2022-08-20bootstrap: Remove some unused fields from the tool_extended macro.Eric Huss-11/+8
2022-07-28bootstrap: don't emit warn about duplicated deps with same/different ↵klensy-24/+28
features, if some of lists actually empty
2022-07-27Ship `rust-analyzer-proc-macro-srv` binary with dist::RustcAmos Wenger-0/+44
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-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 top-level path in tool StepAmos Wenger-1/+1
2022-07-24Allow cross-compiling, build all cratesAmos Wenger-3/+3
2022-07-24Convert rust-analyzer to 'in-tree' tool, pass 'in-rust-tree' feature by defaultAmos Wenger-2/+45
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-07Rollup merge of #98994 - kons-9:dont_use_process_exit, r=jyn514Matthias Krüger-2/+2
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-2/+2
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-05Rollup merge of #95503 - jyn514:build-single-crate, r=Mark-SimulacrumGuillaume Gomez-5/+5
bootstrap: Allow building individual crates This aims to be as unintrusive as possible, but did still require adding a new `tail_args` field to all `Rustc` and `Std` steps. New library and compiler crates are added to the sysroot as they are built, since it's useful to have e.g. just alloc and not std. Fixes https://github.com/rust-lang/rust/issues/44293.
2022-07-02Allow building single crates for the compiler and standard libraryJoshua Nelson-5/+5
- Add `Interned<Vec<String>>` and use it for tail args - Refactor `cache.rs` not to need a separate impl for each internable type
2022-06-30Flip RustAnalyzer to stable=trueJosh Stone-1/+1
2022-06-07Don't build the compiler before building rust-demanglerJoshua Nelson-2/+6
This saves a lot of time compiling.
2022-05-29Auto merge of #96687 - jyn514:download-rustc, r=Mark-Simulacrumbors-1/+1
Move download-rustc from python to rustbuild - Remove download-rustc handling from bootstrap.py - Allow a custom `pattern` in `builder.unpack()` - Only download rustc once another part of bootstrap depends on it. This is somewhat necessary since the download functions rely on having a full `Builder`, which isn't available until after config parsing finishes. Helps with https://github.com/rust-lang/rust/issues/94829.
2022-05-28Rollup merge of #97411 - raiyansayeed:print-stderr-consistently, ↵Matthias Krüger-10/+10
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-10/+10
2022-05-25Move download-rustc from bootstrap.py to rustbuildJoshua Nelson-1/+1
- Remove download-rustc handling from bootstrap.py - Allow a custom `pattern` in `builder.unpack()` - Only download rustc once another part of bootstrap depends on it. This is somewhat necessary since the download functions rely on having a full `Builder`, which isn't available until after config parsing finishes.
2022-05-25Simplify implementation of `-Z gcc-ld`Vadim Petrochenkov-2/+1
- The logic is now unified for all targets (wasm targets should also be supported now) - Additional "symlink" files like `ld64` are eliminated - lld-wrapper is used for propagating the correct lld flavor - Cleanup "unwrap or exit" logic in lld-wrapper
2022-05-05Don't constantly rebuild clippy on `x test src/tools/clippy`.Joshua Nelson-0/+4
This happened because the `SYSROOT` variable was set for `x test`, but not `x build`. Set it consistently for both to avoid unnecessary rebuilds.
2022-03-29Fix `x test src/tools/error_index_generator --stage {0,1}`Joshua Nelson-15/+7
There were two fixes needed: 1. Use `top_stage` instead of `top_stage - 1`. There was a long and torturous comment about trying to match rustdoc's version, but it works better without the hard-coding than with. 2. Make sure that `ci-llvm/lib` is added to LD_LIBRARY_PATH. Previously the error index would be unable to load LLVM for stage0 builds. At some point we should probably have a discussion about how rustdoc stages should be numbered; confusion between 0/1/2 has come up several times in bootstrap now. Note that this is still broken when using `download-rustc = true` and `--stage 1`, but that's *really* a corner case and should affect almost no one. `--stage {0,2}` work fine with download-rustc.
2022-03-11Remove unneeded conversions in bootstrapping codepierwill-1/+1
Fixes warnings from `clippy::useless_conversion` in `src/bootstrap`.
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.
2021-11-08x.py: remove fixme by deleting codeJoshua Nelson-7/+1
As far as I can tell, this parameter was never used, so just delete it as unnecessary.
2021-10-07Add wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavorHans Kratz-0/+32
The wrapper is installed as `ld` and `ld64` in the `lib\rustlib\<host_target>\bin\gcc-ld` directory and its sole purpose is to invoke `rust-lld` in the parent directory with the correct flavor.
2021-08-26switch stage0.txt to stage0.json and add a tool to generate itPietro Albini-0/+1
2021-07-20Update all submodules that rustbuild doesn't depend on lazilyJoshua Nelson-3/+7
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-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-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-0/+1
## 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-05-22Fix boostrap using host exe suffix for cargojam1garner-3/+2
2021-05-20Rollup merge of #85326 - infinity0:fix-cross-compile-tools, r=Mark-SimulacrumGuillaume Gomez-1/+4
bootstrap: ensure host std when cross-compiling tools, fixes #85320
2021-05-18Rollup merge of #85297 - infinity0:master, r=Mark-SimulacrumJack Huey-1/+8
bootstrap: build cargo only if requested in tools In Debian we'd like to build rustfmt and clippy alongside rustc, but we're still excluding cargo from the rustc build and doing that separately. This patch makes that possible.
2021-05-15bootstrap: ensure host std when cross-compiling tools, fixes #85320Ximin Luo-1/+4
2021-05-14Update bootstrap for in-tree rustfmtJoshua Nelson-2/+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-14bootstrap: build cargo only if requested in toolsXimin Luo-1/+8
2021-04-23Allow running `x.py test src/test/linkchecker` with `download-llvm = true`Joshua Nelson-1/+4
Previously, the LD_LIBRARY_PATH for the linkchecker looked like `build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib`, because the linkchecker depends on the master copy of the standard library. This is true, but doesn't include the library path for the compiler libraries: ``` /home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools-bin/error_index_generator: error while loading shared libraries: libLLVM-12-rust-1.53.0-nightly.so: cannot open shared object file: No such file or directory ``` That file is in `build/x86_64-unknown-linux-gnu/stage1/lib/libLLVM-12-rust-1.53.0-nightly.so`, which wasn't included in the dynamic path. This adds `build/x86_64-unknown-linux-gnu/stage1/lib` to the dynamic path for the linkchecker.
2021-04-05Auto merge of #83152 - guswynn:jemallocator_part2, r=Mark-Simulacrumbors-1/+6
Use tikv-jemallocator in rustc/rustdoc in addition to jemalloc-sys when enabled. In https://github.com/rust-lang/rust/pull/81782 it was mentioned that one reason rustc may benefit from minimalloc is it doesn't use the `sdallocx` api from jemalloc. Currently, on unix, rust uses jemalloc by importing its symbols to use them with the default, System (libc) global allocator. This PR switches its global alloc to `tikv-jemallocator`, which correctly uses sized deallocation (https://docs.rs/tikv-jemallocator/0.4.1/src/tikv_jemallocator/lib.rs.html#121-126). `tikv-jemallocator`, as far as I can tell, is a more up-to-date set of bindings to jemalloc than `jemallocator` The perf results of this pr are in large part due to the version upgrade of jemalloc, but sized deallocation has a non-trivial improvement, particularly to rustdoc. This pr also includes changes to bootstrap to correctly pass the jemalloc feature through to the rustdoc build