about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2020-07-22Revert "include backtrace folder in rust-src component"Mark Rousskov-1/+0
This reverts commit d7a36d8964c927863faef5d3b42da08f37e5896c.
2020-07-20Fix rust-src component.Eric Huss-1/+1
2020-07-20Auto merge of #74543 - Manishearth:rollup-m5w6hyg, r=Manishearthbors-6/+12
Rollup of 9 pull requests Successful merges: - #73618 (Documentation for the false keyword) - #74486 (Improve Read::read_exact documentation) - #74514 (Do not clobber RUSTDOCFLAGS) - #74516 (do not try fetching the ancestors of errored trait impls) - #74520 (include backtrace folder in rust-src component) - #74523 (Improve documentation for `core::fmt` internals) - #74527 (Add myself to toolstate change notifications for rustfmt) - #74534 (Only skip impls of foreign unstable traits) - #74536 (fix documentation surrounding the `in` and `for` keywords) Failed merges: r? @ghost
2020-07-19Rollup merge of #74520 - RalfJung:backtrace-src, r=Mark-SimulacrumManish Goregaokar-0/+1
include backtrace folder in rust-src component libstd has a [mandatory dependency on this code](https://github.com/rust-lang/rust/pull/73441/files#diff-242481015141f373dcb178e93cffa850), ergo we need to include it in rust-src. r? @oli-obk Fixes https://github.com/rust-lang/rust/issues/74506
2020-07-19Auto merge of #74495 - shepmaster:bootstrap-dist-target-files, r=Mark-Simulacrumbors-51/+55
Teach bootstrap install and dist commands about TargetSelection With this, we can now use a target JSON file to build a cross-compiler: ``` x.py install --host ../aarch64-apple-darwin.json --target aarch64-apple-darwin ``` r? @Mark-Simulacrum
2020-07-19Teach bootstrap install and dist commands about TargetSelectionJake Goulding-51/+55
With this, we can now use a target JSON file to build a cross-compiler: ``` x.py install --host ../aarch64-apple-darwin.json --target aarch64-apple-darwin ```
2020-07-19include backtrace folder in rust-src componentRalf Jung-0/+1
2020-07-19Do not clobber RUSTDOCFLAGSMark Rousskov-6/+11
We were setting these in both Builder::cargo and here, which ended up only setting the first of the two.
2020-07-19Auto merge of #74091 - richkadel:llvm-coverage-map-gen-4, r=tmandrybors-0/+6
Generating the coverage map @tmandry @wesleywiser rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example commands to generate a coverage report: ```shell $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main ``` ![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png) r? @wesleywiser Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-07-17Rollup merge of #74457 - Keruspe:install, r=Mark-SimulacrumManish Goregaokar-24/+5
rustbuild: drop tool::should_install Always install when the build succeeds Fixes #74431
2020-07-17Rollup merge of #74441 - eddyb:zlib-on-nixos, r=nagisaManish Goregaokar-38/+66
bootstrap.py: patch RPATH on NixOS to handle the new zlib dependency. This is a stop-gap until #74420 is resolved (assuming we'll patch beta to statically link zlib). However, I've been meaning to rewrite the NixOS support we have in `bootstrap.py` for a while now, and had to in order to cleanly add zlib as a dependency (the second commit is a relatively small delta in functionality, compared to the first). Previously, we would extract the `ld-linux.so` path from the output of `ldd /run/current-system/sw/bin/sh`, which assumes a lot. On top of that we didn't use any symlinks, which meant if the user ran GC (`nix-collect-garbage`), e.g. after updating their system, their `stage0` binaries would suddenly be broken (i.e. referring to files that no longer exist). We were also using `patchelf` directly, assuming it can be found in `$PATH` (which is not necessarily true). My new approach relies on using `nix-build` to get the following "derivations" (packages, more or less): * `stdenv.cc.bintools`, which has a `nix-support/dynamic-linker` file containing the path to `ld-linux.so` * reading this file is [the canonical way to run `patchelf --set-interpreter`](https://github.com/NixOS/nixpkgs/search?l=Nix&q=%22--set-interpreter+%24%28cat+%24NIX_CC%2Fnix-support%2Fdynamic-linker%29%22) * `patchelf` (so that the user doesn't need to have it installed) * `zlib`, for the `libz.so` dependency of `libLLVM-*.so` (until #74420 is resolved, presumably) This is closer to how software is built on Nix, but I've tried to keep it as simple as possible (and not add e.g. a `stage0.nix` file). Symlinks to each of those dependencies are kept in `stage0/.nix-deps`, which prevents GC from invalidating `stage0` binaries. r? @nagisa cc @Mark-Simulacrum @oli-obk @davidtwco
2020-07-17Rollup merge of #74251 - shepmaster:bootstrap-target-files, r=Mark-SimulacrumManish Goregaokar-316/+390
Teach bootstrap about target files vs target triples `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.
2020-07-17Rollup merge of #71670 - GuillaumeGomez:enforce-codeblocks-attribute-check, ↵Manish Goregaokar-2/+9
r=Mark-Simulacrum Enforce even more the code blocks attributes check through rustdoc `rustdoc` now has a lint which allows it to warn if a code block attribute is malformated (which can end up in bad situations, even more in case of testing examples!). Now it'll fail if such a situation is encountered when testing markdown code blocks examples. r? @Mark-Simulacrum
2020-07-17rustbuild: drop tool::should_installMarc-Antoine Perennou-24/+5
Always install when the build succeeds Fixes #74431 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-07-17Generating the coverage mapRich Kadel-0/+6
rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example: $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main 1| 1|pub fn will_be_called() { 2| 1| println!("called"); 3| 1|} 4| | 5| 0|pub fn will_not_be_called() { 6| 0| println!("should not have been called"); 7| 0|} 8| | 9| 1|fn main() { 10| 1| let less = 1; 11| 1| let more = 100; 12| 1| 13| 1| if less < more { 14| 1| will_be_called(); 15| 1| } else { 16| 1| will_not_be_called(); 17| 1| } 18| 1|}
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-316/+390
`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.
2020-07-17bootstrap.py: patch RPATH on NixOS to handle the new zlib dependency.Eduard-Mihai Burtescu-13/+30
2020-07-17bootstrap.py: guard against GC in NixOS patching support.Eduard-Mihai Burtescu-31/+42
2020-07-16apply bootstrap cfgsMark Rousskov-7/+1
2020-07-16Bump to 1.47Mark Rousskov-1/+1
2020-07-16Set "invalid_codeblock_attributes" lint to warning level by defaultGuillaume Gomez-2/+3
2020-07-16Update code to new invalid_codeblock_attributes lint nameGuillaume Gomez-2/+2
2020-07-16Apply review commentsGuillaume Gomez-3/+6
2020-07-16Enforce even more the code blocks attributes check through rustdocGuillaume Gomez-2/+5
2020-07-16Rollup merge of #74352 - ehuss:fix-alloc-links, r=Mark-SimulacrumManish Goregaokar-32/+17
Use local links in the alloc docs. Links to other crates (like core) from the alloc crate were incorrectly using the `https://doc.rust-lang.org/nightly/` absolute (remote) links, instead of relative (local) links. For example, the link to `Result` at https://doc.rust-lang.org/1.44.1/alloc/vec/struct.Vec.html#method.try_reserve goes to /nightly/. This is because alloc was being documented before core, and rustdoc relies on the existence of the local directory to know if it should use a local or remote link. There was code that tried to compensate for this (`create_dir_all`), but in #54543 it was broken because instead of running `cargo doc` once for all the crates, it was changed to run `cargo rustdoc` for each crate individually. This means that `create_dir_all` was no longer doing what it was supposed to be doing (creating all the directories before starting). The solution here is to just build in the correct order (from the dependency leaves towards the root). An alternate solution would be to switch back to running `cargo doc` once (and use RUSTDOCFLAGS for passing in flags). Another alternate solution would be to iterate over the list twice, creating the directories during the first pass. I also did a little cleanup to remove the "crate-docs" directory. This was added in the past because different crates were built in different directories. Over time, things have been unified (and rustc docs no longer include std), so it is no longer necessary.
2020-07-15Rollup merge of #72973 - msizanoen1:riscv-host, r=pietroalbiniManish Goregaokar-2/+22
RISC-V GNU/Linux as host platform This PR add a new builder named `dist-riscv64-linux` that builds the compiler toolchain for RISC-V 64-bit GNU/Linux. r? @alexcrichton
2020-07-14Use local links in the alloc docs.Eric Huss-32/+17
2020-07-14Rollup merge of #74252 - shepmaster:bootstrap-rust-destdir, r=Mark-SimulacrumManish Goregaokar-0/+5
Don't allow `DESTDIR` to influence LLVM builds When running a command like `DESTDIR=foo x.py install` in a completely clean build directory, this will cause LLVM to be installed into `DESTDIR`, which then causes the build to fail later when it attempts to *use* those LLVM files.
2020-07-14Stabilize control-flow-guard codegen optionAndrew Paverd-1/+1
2020-07-13Rollup merge of #74046 - ehuss:deny-warnings-caching, r=Mark-SimulacrumManish Goregaokar-4/+18
Fix caching issue when building tools. This fixes a problem with tool builds not being cached properly. #73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings". Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built. The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before #64316. Alternate solutions: * Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before #73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo. * Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc #52336): * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad. Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`). * Teach Cargo to add flags to the workspace members, but not dependencies. * Teach Cargo to add flags without fingerprinting them? * Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](https://github.com/rust-lang/cargo/pull/7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing. * Teach Cargo about lint settings. Closes #74016
2020-07-12Don't allow `DESTDIR` to influence LLVM buildsJake Goulding-0/+5
When running a command like `DESTDIR=foo x.py install` in a completely clean build directory, this will cause LLVM to be installed into `DESTDIR`, which then causes the build to fail later when it attempts to *use* those LLVM files.
2020-07-11Rollup merge of #74116 - arlosi:aarch64build, r=pietroalbiniManish Goregaokar-8/+23
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: #72881 Requires LLVM change: rust-lang/llvm-project#67
2020-07-11RISC-V GNU/Linux as host platformmsizanoen1-2/+22
2020-07-10Rollup merge of #74127 - tamird:allowlist, r=oli-obkManish Goregaokar-2/+4
Avoid "whitelist" Other terms are more inclusive and precise.
2020-07-10Avoid "whitelist"Tamir Duberstein-2/+4
Other terms are more inclusive and precise.
2020-07-10Use str::strip* in bootstrapLzu Tao-10/+10
This commit replaces the use of `trim_start_matches` because in `rustc -Vv` output there are no lines starting with multiple "release:".
2020-07-08Fix x.py test for librustc crates.Eric Huss-2/+2
2020-07-08Fix cross-compilation of LLVM to aarch64 Windows targetsArlo Siemsen-8/+23
When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, this change also adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for cross-compilation.
2020-07-07Fix occasional bootstrap panic in docs.Eric Huss-1/+1
2020-07-06Rollup merge of #74090 - tmiasko:rustc-debug-assertions, r=RalfJungManish Goregaokar-2/+0
Remove unused RUSTC_DEBUG_ASSERTIONS Since #73374 the rustc wrapper no longer configures debug assertions based on RUSTC_DEBUG_ASSERTIONS environment variable. r? @RalfJung
2020-07-06Rollup merge of #70563 - GuillaumeGomez:page-hash-handling, r=ollie27,kinnisonManish Goregaokar-15/+1
[rustdoc] Page hash handling Fixes https://github.com/rust-lang/rust/issues/70476 A good example to see the change is to use this URL: https://doc.rust-lang.org/nightly/std/string/struct.String.html#from_iter.v-3 After the change, it actually goes to the target element (and change the page hash to something more clear for the users). r? @kinnison cc @ollie27
2020-07-06Remove unused RUSTC_DEBUG_ASSERTIONSTomasz Miąsko-2/+0
Since #73374 the rustc wrapper no longer configures debug assertions based on RUSTC_DEBUG_ASSERTIONS environment variable.
2020-07-04Fix caching issue when building tools.Eric Huss-4/+18
2020-07-03Add rust-analyzer submoduleAleksey Kladov-3/+149
The current plan is that submodule tracks the `release` branch of rust-analyzer, which is updated once a week. rust-analyzer is a workspace (with a virtual manifest), the actual binary is provide by `crates/rust-analyzer` package. Note that we intentionally don't add rust-analyzer to `Kind::Test`, for two reasons. *First*, at the moment rust-analyzer's test suite does a couple of things which might not work in the context of rust repository. For example, it shells out directly to `rustup` and `rustfmt`. So, making this work requires non-trivial efforts. *Second*, it seems unlikely that running tests in rust-lang/rust repo would provide any additional guarantees. rust-analyzer builds with stable and does not depend on the specifics of the compiler, so changes to compiler can't break ra, unless they break stability guarantee. Additionally, rust-analyzer itself is gated on bors, so we are pretty confident that test suite passes.
2020-07-02Auto merge of #73954 - Manishearth:rollup-8qvh170, r=Manishearthbors-34/+165
Rollup of 10 pull requests Successful merges: - #73414 (Implement `slice_strip` feature) - #73564 (linker: Create GNU_EH_FRAME header by default when producing ELFs) - #73622 (Deny unsafe ops in unsafe fns in libcore) - #73684 (add spans to injected coverage counters, extract with CoverageData query) - #73812 (ast_pretty: Pass some token streams and trees by reference) - #73853 (Add newline to rustc MultiSpan docs) - #73883 (Compile rustdoc less often.) - #73885 (Fix wasm32 being broken due to a NodeJS version bump) - #73903 (Changes required for rustc/cargo to build for iOS targets) - #73938 (Optimise fast path of checked_ops with `unlikely`) Failed merges: r? @ghost
2020-07-02Remove render-redirect-pages option in rustdocGuillaume Gomez-15/+1
2020-07-02Rollup merge of #73903 - luxxxxy:ios-rustc, r=nikomatsakisManish Goregaokar-0/+19
Changes required for rustc/cargo to build for iOS targets cargo, rustc, clippy, rust-src, and rust-analysis successfully build for `aarch64-apple-ios` with these changes. NOTE: cargo required arm64-ios openssl/libcurl to be linked. ![image](https://user-images.githubusercontent.com/65794972/86178510-75d78080-baf6-11ea-9c17-b74bd6c85272.png) ![image](https://user-images.githubusercontent.com/65794972/86178525-7bcd6180-baf6-11ea-9974-f99980cbdb24.png)
2020-07-02Rollup merge of #73883 - ehuss:rustdoc-stage-previous, r=Mark-SimulacrumManish Goregaokar-34/+146
Compile rustdoc less often. Previously rustdoc was built 3 times with `x.py test`: 1. stage2 (using stage1 compiler) for compiletest tests (stage1-tools copied to stage2). 2. stage1 (using stage0 compiler) for std crate tests (stage0-tools copied to stage1). 3. stage2 test (using stage2 compiler) for rustdoc crate tests and error_index_generator (stage2-tools). This PR removes the majority of number 3, where it will instead use the stage1 compiler, which will share the artifacts from number 1. This matches the behavior of the libstd crate tests. I don't think it is entirely necessary to run the tests using stage2. At `-j2`, the last build step goes from about 300s to 70s on my machine. It's not a huge win, but shaving 4 minutes isn't bad. The other two builds would be pretty difficult (or undesired or impossible) to unify. It looks like std tests use stage1 very intentionally (see `force_use_stage1` and its history), and compiletests use the top stage very intentionally. Unfortunately the linkchecker builds all docs at stage2 (stage2-tools), which means a few build script artifacts are not shared. It's not really clear to me how to fix that (because it uses `default_doc`, there doesn't seem to be any control over the stages). --- For `x.py doc`, rustdoc was previously built three times (with compiler-docs): 1. stage2 (using stage1 compiler) for normal documentation output (stage1-tools copied to stage2). 2. stage1 (using stage0 compiler) for compiler-docs 3. stage2 (using stage2 compiler) for error_index_generator (stage2-tools) This PR combines these so that they consistently use the "top stage" rustdoc. I don't know why the compiler-docs was written to use stage minus one, but it seems better to be consistent across the doc steps. --- I've tried to test this with a variety of commands (`x.py doc`, `x.py test`, different `--stage` flags, `full-bootstrap`, setting `--target`, etc.) to try to make sure there aren't significant regressions here. It's tricky since there are so many variables, and this stuff is difficult for me to fully understand. Closes #70799 (I think)
2020-07-01Rollup merge of #73929 - kraai:fix-comment-typo, r=jonas-schievinkManish Goregaokar-1/+1
Fix comment typo
2020-07-01Rollup merge of #72569 - ChrisDenton:remove-innosetup, r=nikomatsakisManish Goregaokar-21/+0
Remove legacy InnoSetup GUI installer On Windows the InnoSetup `.exe` installer was superseded by the MSI installer long ago. It's no longer needed. The `.exe` installer hasn't been linked from the [other installation methods](https://forge.rust-lang.org/infra/other-installation-methods.html#standalone) page in many years. As far as I can tell the intent was always to remove this installer once the MSI proved itself. Though admittedly both installers feel very "legacy" at this point. Removing this would mean we only maintain one Windows GUI installer and would speed up the distribution phase. As a result of removing InnoSetup, this closes #24397