about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2022-09-17Add a new component, `rust-json-docs`, to distribute the JSON-formatted ↵Luca Palmieri-62/+219
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-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-17Rollup merge of #101783 - chriswailes:env-vars, r=jyn514Matthias Krüger-10/+18
Improve handing of env vars during bootstrap process This CL modifies the handing of env vars during the bootstrap process in two ways: 1. Replaces '-' characters with '_' characters in target names to increase compatibility with different shells 2. Passes Stage0 snapshot compiler related env vars to early invocations of Cargo
2022-09-17Rollup merge of #101781 - chriswailes:dynamic-llvm-on-musl, r=jyn514Matthias Krüger-11/+2
Extend list of targets that support dyanmic linking for llvm tools This commit adds `linux-musl` to the list of targets that support dynamic linking for the LLVM tools.
2022-09-17Revert "fix #101691: copy stage0 binaries into stage0-sysroot"Mark Rousskov-37/+0
This reverts commit 32f8eb2fee4d6781a79052b560abd10e12ebb34f.
2022-09-16Rollup merge of #101921 - est31:bootstrap_cfg_rustdoc, r=joshtriplettMichael Howell-4/+13
Pass --cfg=bootstrap for rustdoc for proc_macro crates This PR does three things: * First, it passes --cfg=bootstrap on stage 0 for rustdoc invocations on proc_macro crates. This mirrors what we do already for rustc invocations of those, and is needed because cargo doesn't respect RUSTFLAGS or RUSTDOCFLAGS when confronted with a proc macro. * Second, it marks the bootstrap config variable as expected. This is needed both on later stages where it's not set, but also on stage 0, where it is set. * Third, it adjusts the comment in the rustc wrapper to better reflect the reason why we set the bootstrap variable as expected: due to recent changes, setting it as expected is also required even if the cfg variable is passed: ebf4cc361e0d0f11a25b42372bd629953365d17e .
2022-09-16Don't add rustdoc's CSS to other doc pagesJacob Hoffman-Andrews-8/+2
This was originally added so those doc pages could use the same font files, but it turns out to be fragile. And those doc pages are just stubs that link to other pages, so they don't need fancy fonts.
2022-09-16Improve handing of env vars during bootstrap processChris Wailes-10/+18
This CL modifies the handing of env vars during the bootstrap process in two ways: 1. Replaces '-' characters with '_' characters in target names to increase compatibility with different shells 2. Passes Stage0 snapshot compiler related env vars to early invocations of Cargo
2022-09-16Pass --cfg=bootstrap for rustdoc for proc_macro cratesest31-4/+13
This commit does three things: * First, it passes --cfg=bootstrap on stage 0 for rustdoc invocations on proc_macro crates. This mirrors what we do already for rustc invocations of those, and is needed because cargo doesn't respect RUSTFLAGS or RUSTDOCFLAGS when confronted with a proc macro. * Second, it marks the bootstrap config variable as expected. This is needed both on later stages where it's not set, but also on stage 0, where it is set. * Third, it adjusts the comment in the rustc wrapper to better reflect the reason why we set the bootstrap variable as expected: due to recent changes, setting it as expected is also required even if the cfg variable is passed: ebf4cc361e0d0f11a25b42372bd629953365d17e .
2022-09-16Remove the allow-list for dynamic linking of LLVM toolsChris Wailes-11/+2
This commit removes an allow-list for the dynamic linking of the LLVM tools and instead relies on the builder's linking preference only.
2022-09-16Use `builder.sysroot(...)` instead of a hackMaybe Waffle-6/+2
2022-09-16Rollup merge of #101809 - aDotInTheVoid:jsondoclint, r=GuillaumeGomezDylan DPC-0/+3
Replace `check_missing_items.py` with `jsondoclint` [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E) check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing. ### Motivation 1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly. 2. Better Errors: - Multiple Errors can be emited for a single crate - Errors can say where in JSON they occored ``` 2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]' 2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]' ``` 3. Catches more bugs. - Because matches are exaustive, all posible variants considered for enums - All Id's checked - Has already found #101770, #101199 and #100973 - Id type is also checked, so the Id's in a structs fields can only be field items. 4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point. cc ``@CraftSpider`` r? ``@GuillaumeGomez``
2022-09-16Allow building `rust-analyzer-proc-macro-srv` as a standalone toolMaybe Waffle-10/+26
2022-09-14Allow using vendoring when running bootstrap from outside the current ↵Joshua Nelson-1/+5
working directory
2022-09-14Give a better error messages when the rustc shim is missingJoshua Nelson-1/+4
2022-09-14Fix pre-existing bug in exe checkJoshua Nelson-1/+1
2022-09-14Don't hardcode the path to `bootstrap_out`Joshua Nelson-13/+9
The `rust-dev` dist component puts binaries in `bootstrap/bin`, but we expected them to be in `bootstrap/debug` to match cargo's behavior. Rather than making the dist component inconsistent with other components, make bootstrap slightly smarter and allow using any path as long as all the binaries are in the same directory. As a bonus, this greatly simplifies the logic, and makes it possible for the shell scripts to start avoiding python. Co-authored-by: Joshua Nelson <github@jyn.dev>
2022-09-14Make it possible to run bootstrap on a different machine than the one it was ↵Joshua Nelson-4/+44
built - Default to trying git rev-parse for the root directory CARGO_MANIFEST_DIR is a path on the build machine, not the running machine. Don't require this to succeed, to allow building from a tarball; in that case fall back to CARGO_MANIFEST_DIR. - Set `initial_rustc` to a path based on the path of the running executable, not CARGO_MANIFEST_DIR. We only reset `initial_rustc` if we're sure this isn't the working tree bootstrap was originally built in, since I'm paranoid that setting this in other cases will cause things to break; it's not clear to me when $RUSTC differs from `build/$TARGET/stage0/bin/rustc` (maybe never? but better to be sure). Instead, only set this when a) We are not using a custom rustc. If someone has specified a custom rustc we should respect their wishes. b) We are in a checkout of rust-lang/rust other than the one bootstrap was built in.
2022-09-14Fix `--dry-run` for `dist::RustDev`Joshua Nelson-1/+1
2022-09-14Distribute bootstrap in CI artifactsTuna-0/+36
- Add a new `bootstrap` component Originally, we planned to combine this with the `rust-dev` component. However, I realized that would force LLVM to be redownloaded whenever bootstrap is modified. LLVM is a much larger download, so split this to get better caching. - Build bootstrap for all tier 1 and 2 targets
2022-09-14jsondoclint: New ToolNixon Enraght-Moony-0/+3
2022-09-13fix #101691: copy stage0 binaries into stage0-sysrootyukang-0/+37
2022-09-05Avoid UB in the Windows filesystem code in... bootstrap?Thom Chiovoloni-4/+7
2022-09-02Rollup merge of #100200 - petrochenkov:zgccld2, r=lqd,Mark-SimulacrumMatthias Krüger-3/+11
Change implementation of `-Z gcc-ld` and `lld-wrapper` again This PR partially reverts https://github.com/rust-lang/rust/pull/97375 and uses the strategy described in https://github.com/rust-lang/rust/issues/97402#issuecomment-1147404520 instead, thus fixes https://github.com/rust-lang/rust/issues/97755.
2022-09-02Rollup merge of #101166 - GuillaumeGomez:error-index-mdbook, r=notriddleGuillaume Gomez-1/+1
Generate error index with mdbook instead of raw HTML pages This is a follow-up of https://github.com/rust-lang/rust/pull/100922. This comes from a remark from ````@estebank```` who said that the search was a nice thing on the previous version and that it wasn't possible anymore. An easy way to come around this limitation was to use `mdbook`, which is what I did here. Now some explanations on the code. I'll explain how I developed this and why I reached this solution. First I did it very basically by simply setting the source directory and the output directory, generated a `SUMMARY.md` manually which listed all error codes and that was it. Two problems arose from this: 1. A lot of new HTML files were generated at the top level 2. An `index.html` file was generated at the top-level (the summary in short). So for `1.`, it's not great to have too many files at the top-level as it could create file conflicts more easily. And for `2.`, this is actually a huge issue because <doc.rust-lang.org> generates an `index.html` file with a links to a few different resources, so it should never be overwritten. <s>Unfortunately, `mdbook` **always** generates an `index.html` file so the only solution I could see (except for sending them a contribution, I'll maybe do that later) was to temporaly move a potentially existing `index.html` file and then puts it back once done. For this last part, to ensure that we don't return *before* it has been put back, I wrapped the `mdbook` generation code inside `render_html_inner` which is called from `render_html` which in turn handle the "save" of `index.html`.</s> EDIT: `mdbook` completely deletes ALL the content in the target directory so I instead generate into a sub directory and then I move the files to the real target directory. To keep compatibility with the old version, I also put the `<script>` ````@notriddle```` nicely provided in the previous PR only into the `error-index.html` file to prevent unneeded repetition. I didn't use `mdbook` `additional-js` option because the JS is included at the end of all HTML files, which we don't want for two reasons: 1. It's slow. 2. We only want it to be run in `error-index.html` (even if we also ensure in the JS itself too!). <s>Now the last part: why we generate the summary twice. We actually generate it once to tell `mdbook` what the book will look like and a second time because a create a new chapter content which will actually list all the error codes (with the updated paths).</s> EDIT: I removed the need for two summaries. You can test it [here](https://rustdoc.crud.net/imperio/error-index-mdbook/error-index.html). r? ````@notriddle````
2022-09-01Rollup merge of #101072 - tmandry:llvm-is-vanilla, r=Mark-SimulacrumMatthias Krüger-5/+10
bootstrap: Add llvm-has-rust-patches target option This is so you can check out an upstream commit in src/llvm-project and have everything just work. This simplifies the logic in `is_rust_llvm` a bit; it doesn't need to check for download-ci-llvm because we would have already errored if both that and llvm-config were specified on the host platform.
2022-09-01Rollup merge of #100852 - Samyak2:samyak/100459, r=Mark-SimulacrumMatthias Krüger-4/+11
Use `getuid` to check instead of `USER` env var in rustbuild This makes it consistent with `x.py` as changed in #95671 Fixes #100459
2022-09-01Auto merge of #100606 - cuviper:upgrade-linux-ci, r=Mark-Simulacrumbors-1/+4
ci: Upgrade non-dist Linux testers from ubuntu:16.04 to 22.04 The main goal of updating to 22.04 is to get away from `llvm.allow-old-toolchain`. A side benefit is that they can also use the system `cmake` instead of building one.
2022-09-01Auto merge of #100707 - dzvon:fix-typo, r=davidtwcobors-5/+5
Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Generate error index with mdbook instead of raw HTML pagesGuillaume Gomez-1/+1
2022-08-31Fix a bunch of typoDezhi Wu-5/+5
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Rollup merge of #101025 - semarie:openbsd-archs, r=petrochenkovMatthias Krüger-2/+3
Add tier-3 support for powerpc64 and riscv64 openbsd # powerpc64 - MCP for [powerpc64-unknown-openbsd tier-3 support](https://github.com/rust-lang/compiler-team/issues/551) - only need to add spec definition in rustc_target # riscv64 - MCP for [riscv64-unknown-openbsd tier-3 support](https://github.com/rust-lang/compiler-team/issues/552) - add spec definition in rustc_target - follow freebsd about avoiding linking with `libatomic`
2022-08-30Avoid bootstrap from updating rls submoduleRaoul Strackx-1/+0
2022-08-29bootstrap: Add llvm-has-rust-patches target optionTyler Mandry-5/+10
This is so you can check out an upstream commit in src/llvm-project and have everything just work.
2022-08-28add riscv64gc-unknown-openbsd support (target riscv64-unknown-openbsd on ↵Sébastien Marie-2/+3
OpenBSD) - add platform-support documentation - add riscv64gc-unknown-openbsd spec - do not try to link with -latomic on openbsd
2022-08-27Remove RLS from macOS pkg and Windows msi installers.Eric Huss-33/+3
These generally aren't used too much, and I feel like aren't really helpful for installing the RLS stub.
2022-08-27Sunset RLSEric Huss-85/+5
2022-08-27Add replace-version-placeholder toolest31-1/+67
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-27Rollup merge of #100811 - czzrr:master, r=Mark-SimulacrumYuki Okushi-1/+9
Fix wrong compiletest filters on Windows As discussed in [#79334](https://github.com/rust-lang/rust/issues/79334), when calling e.g. ``` python x.py test src/test/ui/expr/compound-assignment/eval-order.rs ``` on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed. I'm not sure how to organize a test for this. Any suggestions?
2022-08-26Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiserbors-16/+14
session: stabilize split debuginfo on linux Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable.
2022-08-26Use getuid to check instead of USER env var in rustbuildSamyak Sarnayak-4/+11
This makes it consistent with `x.py` as changed in #95671 Fixes #100459
2022-08-26`alloc`: add unstable cfg features `no_rc` and `no_sync`Miguel Ojeda-0/+2
In Rust for Linux we are using these to make `alloc` a bit more modular. A `run-make-fulldeps` test is added for each of them, so that enabling each of them independently is kept in a compilable state. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-08-23rustbuild: fix version parsing for browser-ui-testJosh Stone-1/+4
2022-08-23Rollup merge of #100832 - ehuss:bootstrap-cleanup, r=jyn514Matthias Krüger-20/+10
Some small bootstrap cleanup This is a collection of a few small cleanups. See commits for more details. * Remove some unused fields from the tool_extended macro. * Remove rustfmt from publish_toolstate. * Remove Steve from toolstate failure notices. * Don't allow rustfmt to fail on dist.
2022-08-21Correct test-args to compiletest on Windowsczzrr-1/+9
2022-08-20bootstrap: Don't allow rustfmt to fail on dist.Eric Huss-9/+2
When running `x.py dist`, rustfmt was being allowed to fail when missing-tools is true. This isn't much of an issue in practice since other CI jobs will fail if rustfmt fails. This code was just leftovers from when rustfmt was tracked in toolstate, and this removes it to make it clear that it no longer works that way.
2022-08-20bootstrap: Remove some unused fields from the tool_extended macro.Eric Huss-11/+8
2022-08-21Auto merge of #100536 - Alexendoo:bootstrap-tls-model, r=Mark-Simulacrumbors-4/+13
bootstrap: don't apply `-Ztls-model=initial-exec` to proc macros Potentially fixes #100530 r? `@bjorn3`
2022-08-20Enable downloading prebuilt LLVM in test buildersMark Rousskov-2/+8
See comment added for details on the test builder restriction. This is primarily intended for macOS CI, but is likely to be a slight win on other builders too.
2022-08-19Refactor if-available setting to work in CIMark Rousskov-44/+79
This verifies if the HEAD sha matches with the detected LLVM SHA, and if not, permits usage of the detected LLVM. Otherwise, we fallback on regular non-downloaded LLVM (currently still cached with sccache, though that's still 10+ minutes on macOS).