about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2021-07-21Rollup merge of #87301 - chinmaydd:chinmaydd-patch-1-1, r=jyn514Guillaume Gomez-1/+1
Fix typo in compile.rs
2021-07-21Rollup merge of #87187 - oxalica:fix-nixos-detect, r=nagisaGuillaume Gomez-1/+7
Fix NixOS detection Use `/etc/os-release` instead of `/etc/NIXOS` for detection. The latter one does not exist on NixOS when using tmpfs as root.
2021-07-21Auto merge of #82653 - jyn514:submodules-on-demand, r=Mark-Simulacrumbors-113/+173
Update all submodules that rustbuild doesn't depend on lazily 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 to rustbuild 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. Helps with https://github.com/rust-lang/rust/issues/76653. Builds on https://github.com/rust-lang/rust/pull/86015 and should not be merged before (only the last commit is relevant).
2021-07-20Update all submodules that rustbuild doesn't depend on lazilyJoshua Nelson-113/+173
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-07-21Fix NixOS detectionoxalica-1/+7
Use `/etc/os-release` instead of `/etc/NIXOS`. The latter one does not exist on NixOS when using tmpfs as root.
2021-07-19Fix typo in compile.rsChinmay Deshpande-1/+1
2021-07-13Upgrade `cc` crate to 1.0.69Yuki Okushi-1/+1
2021-07-13Rollup merge of #87035 - GuillaumeGomez:fix-implementors-display, r=notriddleYuki Okushi-14/+12
Fix implementors display Part of https://github.com/rust-lang/rust/issues/86632. This PR does a few things: * It fixes of the JS rendered implementors. * It generates anchors for JS rendered implementors to make it coherent with the others. * It adds a test to ensure that we won't have the same issue again. * It changes the way we render the rustdoc-gui crates to simplify it a bit and also to allow to have dependencies without going through compiletest. Before: ![Screenshot from 2021-07-10 13-30-13](https://user-images.githubusercontent.com/3050060/125174172-b4048700-e1c3-11eb-8f0e-c46081371d4f.png) After: ![Screenshot from 2021-07-10 21-11-15](https://user-images.githubusercontent.com/3050060/125174173-b49d1d80-e1c3-11eb-8740-1dbbff70c2eb.png) I plan to add the `[src]` links in another PR because this one is already big enough. cc `@Mark-Simulacrum` (for the bootstrap changes) r? `@Nemo157`
2021-07-13Rollup merge of #87007 - ehuss:fix-rust-analyzer-install, r=Mark-SimulacrumYuki Okushi-6/+19
Fix rust-analyzer install when not available. This changes it so that `x.py install` won't fail if rust-analyzer isn't available. This was changed in #86568 to handle the case where installing on stable/beta, and `extended=true`, to skip rust-analyzer. But I neglected to update the install part to also ignore it. Fixes #86999
2021-07-12Provide a better error when `x.py install src/doc` doesn't work.Eric Huss-4/+6
2021-07-12Simplify build system for rustdoc-gui test cratesGuillaume Gomez-14/+12
2021-07-11Add comments why install steps should never fail.Eric Huss-0/+6
2021-07-10Account for `submodules = false` in config.toml when updating LLVM submoduleJoshua Nelson-0/+4
2021-07-09Fix rust-analyzer install when not available.Eric Huss-4/+9
2021-07-08Rollup merge of #86913 - Stupremee:document-rustdoc-private-items, r=jyn514Guillaume Gomez-4/+10
Document rustdoc with `--document-private-items` The `tool_doc` macro introduced in #86737 did not use `false` as the default value for `binary` when it is not provided, so the `if` is not even expanded and thus the argument is never provided if the `binary` argument isn't. Resolves #86900 r? ```@Mark-Simulacrum```
2021-07-07Clean up rustdoc static filesGuillaume Gomez-1/+1
2021-07-07Document rustdoc with `--document-private-items`Justus K-4/+10
2021-07-05Auto merge of #86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomezbors-2/+8
Use rustdoc.css for error index Closes #86512.
2021-07-03Make x.py less verbose on failuresJoshua Nelson-4/+11
- Don't print the exact command run by rustbuild unless `--verbose` is set. This is almost always unhelpful, since it's just cargo with a lot of arguments. - Don't print "Build completed unsuccessfully" unless --verbose is set. You can already tell the build failed by the errors above, and the time isn't particularly helpful. - Don't print the full path to bootstrap. This is useless to everyone, even including when working on x.py itself. You can still opt-in to this being shown with `--verbose`, since it will throw an exception. Before: ``` error[E0432]: unresolved import `x` --> library/std/src/lib.rs:343:5 | 343 | use x; | ^ no external crate `x` error: aborting due to previous error For more information about this error, try `rustc --explain E0432`. error: could not compile `std` To learn more, run the command again with --verbose. command did not execute successfully: "/home/joshua/rustc4/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--features" "panic-unwind backtrace" "--manifest-path" "/home/joshua/rustc4/library/test/Cargo.toml" "--message-format" "json-render-diagnostics" expected success, got: exit status: 101 failed to run: /home/joshua/rustc4/build/bootstrap/debug/bootstrap check Build completed unsuccessfully in 0:00:13 ``` After: ``` error[E0432]: unresolved import `x` --> library/std/src/lib.rs:343:5 | 343 | use x; | ^ no external crate `x` error: aborting due to previous error For more information about this error, try `rustc --explain E0432`. error: could not compile `std` To learn more, run the command again with --verbose. ```
2021-07-02Rollup merge of #86737 - jyn514:doc-tools, r=Mark-SimulacrumGuillaume Gomez-67/+81
Document rustfmt on nightly-rustc - Refactor the doc step for Rustdoc into a macro - Call the macro for both rustdoc and rustfmt - Add a `recursion_limit` macro to avoid overflow errors This does not currently pass --document-private-items for rustfmt due to https://github.com/rust-lang/cargo/pull/8422#issuecomment-871082935. r? `@Mark-Simulacrum` cc `@calebcartwright`
2021-07-01Document rustfmt on nightly-rustcJoshua Nelson-6/+12
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-30copy rust-lld as ld in dist1000teslas-3/+3
2021-06-29Use a macro for documenting rustdocJoshua Nelson-67/+75
2021-06-29Rollup merge of #86059 - GuillaumeGomez:html-checker2, r=Mark-SimulacrumYuki Okushi-3/+48
Add new tool to check HTML Re-opening of https://github.com/rust-lang/rust/pull/84480. r? `@Mark-Simulacrum`
2021-06-28Add new tool to check HTML:Guillaume Gomez-3/+48
* 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-29Rollup merge of #86568 - ehuss:dist-miri-stable, r=Mark-SimulacrumYuki Okushi-0/+12
Don't dist miri or rust-analyzer on stable or beta. This prevents miri and rust-analyzer from being built for "dist" or "install" on the stable/beta channels. It is a nightly-only tool and should not be included. Closes #86286
2021-06-28Make every standalone doc use rustdoc.cssDeadbeef-2/+8
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-4/+4
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-25Auto merge of #86015 - jyn514:revert-revert, r=Mark-Simulacrumbors-13/+90
Move LLVM submodule updates back to native.rs Time to find more bugs! The first commit is a straight revert of https://github.com/rust-lang/rust/pull/85647, the second is a fix for https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/x.2Epy.20always.20updates.20LLVM.20submodule/near/240113320 and https://github.com/rust-lang/rust/pull/82653#issuecomment-846755631. I haven't been able to replicate https://github.com/rust-lang/rust/pull/82653#issuecomment-849013698.
2021-06-23Use HTTPS links where possibleSmitty-4/+4
2021-06-23Comment and include rust-analyzer.Eric Huss-0/+9
2021-06-22Don't dist miri on stable or beta.Eric Huss-0/+3
2021-06-22Update cargoEric Huss-1/+1
2021-06-22Rollup merge of #86297 - GuillaumeGomez:rustdoc-gui-args, r=Mark-SimulacrumYuki Okushi-0/+3
Allow to pass arguments to rustdoc-gui tool Very convenient for testing. This is another part of https://github.com/rust-lang/rust/pull/86293 cc ``@jsha`` r? ``@Mark-Simulacrum``
2021-06-21Rollup merge of #86156 - ehuss:linkchecker-fixes, r=Mark-SimulacrumYuki Okushi-0/+22
Fix a bug in the linkchecker There was a small typo in the linkchecker (in #85652) that caused it to report a `#` fragment link error pointing to the wrong file (it was displaying the path to the source file, not the target of the link). This also includes a few other changes: - Fixes the tests due to some changes in the redirect handling in #84703. - Adds the tests to rustbuild to run whenever the linkchecker itself is run. - Updates the tests to validate more of the output (so that a mistake like this would have been caught). Closes #86144
2021-06-17Lazify is_really_default condition in the RustdocGUI bootstrap stepThe8472-8/+27
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-16Allow to pass arguments to rustdoc-gui toolGuillaume Gomez-0/+3
2021-06-14Allow to run only a few GUI testsGuillaume Gomez-1/+8
2021-06-11Auto merge of #85961 - 1000teslas:issue-71519-fix, r=petrochenkovbors-0/+11
MVP for using rust-lld as part of cc Will fix #71519. I need to figure out how to write a test showing that lld is used instead of whatever linker cc normally uses. When I manually run rustc using `echo 'fn main() {}' | RUSTC_LOG=rustc_codegen_ssa::back::link=debug ./rustc -Clinker-flavor=gcc-lld --crate-type bin -Clink-arg=-Wl,-v` (thanks to bjorn3 on Zulip), I can see that lld is used, but I'm not sure how to inspect that output in a test.
2021-06-10Auto merge of #86098 - pietroalbini:test-stable, r=Mark-Simulacrumbors-0/+2
Add the x86_64-gnu-stable builder During the 1.52 release process we had to deal with some commits that passed the test suite on the nightly branch but failed on the beta or stable branch. In that case it was due to some UI tests including the channel name in the output, but other changes might also be dependent on the channel. This commit adds a new CI job that runs the Linux x86_64 test suite with the stable branch, ensuring nightly changes also work as stable. To ensure the new job works the following other changes are present: * The `ui-fulldeps/session-derive-errors.rs` test has been disabled on beta and stable, which required adding support for `// ignore-{channel}` and `// only-{channel}`. * The `rustdoc/intra-doc/field.rs` has been fixed. r? `@Mark-Simulacrum` fixes https://github.com/rust-lang/release-team/issues/11
2021-06-10Auto merge of #82639 - jyn514:stable-options, r=Mark-Simulacrumbors-1/+0
Don't pass -Z unstable-options by default for UI tests Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not. This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics. - https://github.com/rust-lang/rust/issues/82636 - https://github.com/rust-lang/rust/issues/82637 - https://github.com/rust-lang/rust/issues/82638
2021-06-10gcc-lld mvp1000teslas-0/+11
ignore test if rust-lld not found create ld -> rust-lld symlink at build time instead of run time for testing in ci copy instead of symlinking remove linux check test for linker, suggestions from bjorn3 fix overly restrictive lld matcher use -Zgcc-ld flag instead of -Clinker-flavor refactor code adding lld to gcc path revert ci changes suggestions from petrochenkov rename gcc_ld to gcc-ld in dirs
2021-06-09Test the linkchecker itself.Eric Huss-0/+22
2021-06-07build doctests with lld if use-lld = trueThe8472-16/+27
2021-06-07ignore ui-fulldeps/session-derive-errors.rs on beta and stablePietro Albini-0/+2
The session-derive-errors test ensures the internal SessionDiagnostic derive macro outputs the right error messages when misused. The macro relies on the proc_macro2 crate though, which changes its span behavior depending on whether the channel is nightly or not. This caused test failures when bumping the channel from nightly to beta/stable. Since SessionDiagnostic is internal-only we don't care about its diagnostics quality outside of nightly, as the compiler itself is developed on nightly. Thus the easiest solution is to ignore that test on the beta and stable channels. This also implements `// only-{channel}` and `// ignore-{channel}` in compiletest to properly support the change.
2021-06-07Rollup merge of #86025 - bjorn3:no_rpath_cfg_prefix, r=jackh726Yuki Okushi-2/+1
Remove the install prefix from the rpath set when using -Crpath It was broken anyway for rustup installs and nobody seems to have noticed. Fixes https://github.com/rust-lang/rust/issues/82392
2021-06-07Rollup merge of #85996 - jyn514:library-changes, r=Mark-SimulacrumYuki Okushi-3/+5
rustbuild: take changes to the standard library into account for `download-rustc` Previously, changing the standard library with `download-rustc = "if-unchanged"` would incorrectly reuse the cached compiler and standard library from CI, which was confusing and led to incorrect test failures or successes. r? `@Mark-Simulacrum`
2021-06-07Rollup merge of #84940 - jyn514:ninja, r=Mark-SimulacrumGuillaume Gomez-2/+7
Don't run sanity checks for `x.py setup` These requirements change as soon as the command finishes running, and `setup` doesn't build anything, so the check doesn't make sense. Previously, `x.py setup` would give hard errors if `ninja` and `cmake` were not installed, even if the new profile didn't require them. Fixes https://github.com/rust-lang/rust/issues/84938.
2021-06-07Rollup merge of #83433 - jyn514:cfg-bootstrap-macro, r=Mark-SimulacrumGuillaume Gomez-0/+7
Pass --cfg=bootstrap for proc macros built by stage0 Cargo has a bug where it ignores RUSTFLAGS when building proc macro crates (https://github.com/rust-lang/cargo/issues/4423). However, sometimes rustc_macro needs to have conditional compilation when there are breaking changes to the `libproc_macro` API (see for example #83363). Previously, this wasn't possible, because the crate couldn't tell the difference between stage 0 and stage 1. Another alternative is to unconditionally build rustc_macros with the master libstd instead of the beta one (i.e. use `--sysroot stage0-sysroot`), but that led to strange and maddening errors: ``` error[E0460]: found possibly newer version of crate `std` which `synstructure` depends on --> compiler/rustc_macros/src/lib.rs:5:5 | 5 | use synstructure::decl_derive; | ^^^^^^^^^^^^ | = note: perhaps that crate needs to be recompiled? = note: the following crate versions were found: crate `std`: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b3602c301b71cc3d.rmeta crate `synstructure`: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/libsynstructure-74ee66863479e972.rmeta error[E0460]: found possibly newer version of crate `std` which `proc_macro2` depends on --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/tracing-attributes-0.1.13/src/lib.rs:90:5 | 90 | use proc_macro2::TokenStream; | ^^^^^^^^^^^ | = note: perhaps that crate needs to be recompiled? = note: the following crate versions were found: crate `std`: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b3602c301b71cc3d.rmeta crate `proc_macro2`: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/libproc_macro2-a83c1f01610c129e.rlib ``` r? `@Mark-Simulacrum` cc `@jhpratt`
2021-06-06Don't pass -Z unstable-options by default for UI testsJoshua Nelson-1/+0
- Pass it explicitly where appropriate - Update stderr files and warnings; it turns that unstable-options has far-reaching effects on diagnostics.