summary refs log tree commit diff
path: root/src/bootstrap/dist.rs
AgeCommit message (Collapse)AuthorLines
2022-01-06Revert "bootstrap: copy `llvm-dwp` to sysroot"David Wood-5/+1
This reverts commit 241160de72b5b55187ca54243e2a6e82e336d07c.
2021-12-12bootstrap: Change `unwrap()` to `expect()` for `WIX` pathAbhishek Sudhakaran-1/+3
On Windows, `x.py dist` command panics without proper error message if 'WIX' environment variable is not set. This patch changes `Option::unwrap()` to `Option::expect()`.
2021-12-04Include `lld` in `rust-dev` packageAaron Hill-0/+7
Fixes #88941 This will allow using `download-ci-llvm` while still having LLD available.
2021-11-13Change paths for `dist` command to match the components they generateJoshua Nelson-9/+9
Before, you could have the confusing situation where the command to generate a component had no relation to the name of that component (e.g. the `rustc` component was generated with `src/librustc`). This changes the name to make them match up.
2021-11-08Make `compiler-docs` only control the default instead of being a hard off-switchJoshua Nelson-4/+2
This also fixes `x doc src/tools/clippy` when compiler-docs is disabled.
2021-10-07Add wrapper for -Z gcc-ld=lld to invoke rust-lld with the correct flavorHans Kratz-5/+8
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-29Auto merge of #88250 - rusticstuff:macos-lld, r=nagisabors-0/+2
Make `-Z gcc-ld=lld` work for Apple targets `-Z gcc-ld=lld` was introduced in #85961. It does not work on Macos because lld needs be either named `ld64` or passed `-flavor darwin` as the first two arguments in order to select the Mach-O flavor. Rust invokes cc (=clang) on Macos for linking which calls `ld` as linker binary and not `ld64`, so just creating an `ld64` binary and modifying the search path with `-B` does not work. In order to solve this patch does: * Set the `lld_flavor` for all Apple-derived targets to `LldFlavor::Ld64`. As far as I can see this actually works towards fixing `-Xlinker=rust-lld` as all those targets use the Mach-O object format. * Copy/hardlink rust-lld to the gcc-ld subdirectory as ld64 next to ld. * If `-Z gcc-ld=lld` is used and the target lld flavor is Ld64 add `-fuse-ld=/path/to/ld64` to the linker invocation. Fixes #86945.
2021-08-24PGO for LLVM builds on x86_64-unknown-linux-gnu in CIMark Rousskov-4/+10
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-23Include ld64 nexte to ld for use with -Z gcc-ldHans Kratz-0/+2
2021-08-02Rollup merge of #87282 - pietroalbini:refactor-extended, r=Mark-SimulacrumYuki Okushi-120/+109
Ensure `./x.py dist` adheres to `build.tools` According to `config.toml.example`, the way to produce dist artifacts for both the compiler and a *subset* of tools would be to enable the extended build and manually specify the list of tools to build: ```toml [build] extended = true tools = ["cargo", "rustfmt"] ``` This works as expected for `./x.py build` and `./x.py install`, but *not* for `./x.py dist`. Before this PR `./x.py dist` simply ignored the contents of `build.tools`, building just rustc/rustdoc if `build.extended = false` and all of the tools otherwise. This PR does two things: * Changes `./x.py dist extended` to only build the tools defined in `build.tools`, if `build.tools` is not empty. The rest of the extended step was refactored to simplify the code. * Changes how dist jobs for tools are gated: instead of `assert!(builder.config.extended)` to prevent tools from being built with `build.extended = false`, tools are simply built by default depending on `build.extended` and `build.tools`. This also enables to **explicitly** dist tools even with `build.extended = false`. This PR is best reviewed commit-by-commit. Fixes #86436
2021-07-28set all of the optional tools as DEFAULT = truePietro Albini-0/+9
The default is then overridden by `should_run`.
2021-07-23refactor extended tarball generaton to use the new ensure_if_defaultPietro Albini-30/+17
2021-07-23don't build extra tools if build.tools is explicitly an empty listPietro Albini-6/+1
2021-07-19refactor gating of mingwPietro Albini-6/+4
2021-07-19refactor gating of demanglerPietro Albini-24/+26
2021-07-19refactor gating of toolsPietro Albini-74/+75
2021-07-19change output of dist cargo and clippy to be consistent with other toolsPietro Albini-8/+8
2021-07-19refactor gating of dist docsPietro Albini-12/+9
2021-07-19refactor adding rustc and std into extended buildsPietro Albini-9/+9
2021-07-16Package LLVM libs for the target rather than the build hostAdam Gemmell-1/+9
2021-06-30copy rust-lld as ld in dist1000teslas-3/+3
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-10gcc-lld mvp1000teslas-0/+4
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-04-17bootstrap: Restore missing --bulk-dirs for rust-docs, rustc-docsAnders Kaseorg-2/+2
The --bulk-dirs argument was removed for rust-docs in commit c768ce138427b1844c1f6594daba9c0e33928032 and rustc-docs in commit 8ca46fc7a83734c9622f11f25d16b82316f44bcc (#79788), presumably by mistake; that slowed down installation of rust-docs from under a second to some twenty *minutes*. Restoring --bulk-dirs reverses this slowdown. Fixes #80684. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-04-03Address review comments and Windows failure, and make cleanerRich Kadel-24/+28
2021-04-03Make rust-demangler installableRich Kadel-0/+86
Adds bootstrap rules to support installing rust-demangler. When compiling with `-Z instrument-coverage`, the coverage reports are generated by `llvm-cov`. `llvm-cov` includes a built-in demangler for C++, and an option to supply an alternate demangler. For Rust, we have `rust-demangler`, currently used in `rustc` coverage tests. Fuchsia's toolchain for Rust is built via `./x.py install`. Fuchsia is adding support for Rust coverage, and we need to include the `rust-demangler` in the installed `bin` directory. Configured rust-demangler as an in-tree extended tool. Added tests to support `./x.py test rust-demangler`. Install with extended tools by default only if `profiler = true`.
2021-02-15Rollup merge of #82106 - jyn514:cleanup-bootstrap, r=Mark-SimulacrumJonas Schievink-2/+2
Remove unnecessary `Option` in `default_doc` Previously, there were two different ways to encode the same info: `None` or `Some(&[])`. Now there is only one way, `&[]`.
2021-02-14Remove unnecessary `Option` in `default_doc`Joshua Nelson-2/+2
Previously, there two different ways to encode the same info: `None` or `Some(&[])`. Now there is only one way, `&[]`.
2021-02-11dist: include src/build_helper as part of the crate graph for rustc-dev.Benjamin Bouvier-0/+8
Since it was missing, it wasn't possible to really use rustc-dev to build, see for instance: https://github.com/rust-analyzer/rust-analyzer/issues/7589.
2021-01-15Allow downloading LLVM on WindowsJoshua Nelson-18/+30
- Don't ignore packaging `llvm/lib/` for `rust-dev` when LLVM is linked statically - Add `link-type.txt` so bootstrap knows whether llvm was linked statically or dynamically - Don't assume CI LLVM is linked dynamically in `bootstrap::config` - Fall back to dynamic linking if `link-type.txt` doesn't exist - Fix existing bug that split the output of `llvm-config` on lines, not spaces - Enable building LLVM tests This works around the following llvm bug: ``` llvm-config: error: component libraries and shared library llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest.a llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest_main.a llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libLLVMTestingSupport.a thread 'main' panicked at 'command did not execute successfully: "/home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-config" "--libfiles" ``` I'm not sure why llvm-config thinks these are required, but to avoid the error, this builds them anyway. - Temporarily set windows as the try builder. This should be reverted before merging. - Bump version of `download-ci-llvm-stamp` `src/llvm-project` hasn't changed, but the generated tarball has. - Only special case MacOS when dynamic linking. Static linking works fine. - Store `link-type.txt` to the top-level of the tarball This allows writing the link type unconditionally. Previously, bootstrap had to keep track of whether the file IO *would* succeed (it would fail if `lib/` didn't exist), which was prone to bugs. - Make `link-type.txt` required Anyone downloading this from CI should be using a version of bootstrap that matches the version of the uploaded artifacts. So a missing link-type indicates a bug in x.py.
2021-01-05Rollup merge of #80533 - matthiaskrgr:bootstrap_clppy, r=Mark-SimulacrumYuki Okushi-4/+4
bootstrap: clippy fixes addresses: clippy::or_fun_call clippy::single_char_add_str clippy::comparison_to_empty clippy::or_fun_call
2020-12-31bootstrap: use the correct paths during ./x.py installPietro Albini-2/+2
2020-12-31bootstrap: change the dist outputs to GeneratedTarballPietro Albini-38/+38
The struct will allow to store more context on the generated tarballs.
2020-12-31bootstrap: never delete the tarball temporary directoryPietro Albini-2/+2
Files in the temporary directory are used by ./x.py install.
2020-12-31bootstrap: clippy fixesMatthias Krüger-4/+4
addresses: clippy::or_fun_call clippy::single_char_add_str clippy::comparison_to_empty clippy::or_fun_call
2020-12-23bootstrap: convert reproducible-artifacts to use TarballPietro Albini-41/+4
2020-12-23bootstrap: use the normal compiler to build stdPietro Albini-2/+1
2020-12-23bootstrap: avoid producing the rust tarball during dry runsPietro Albini-0/+5
2020-12-23bootstrap: convert rustc-src to use TarballPietro Albini-31/+3
2020-12-23bootstrap: convert rust to use TarballPietro Albini-38/+5
2020-12-23bootstrap: convert rust-src to use TarballPietro Albini-27/+3
2020-12-23bootstrap: convert rust-analyzer to use TarballPietro Albini-50/+6
2020-12-23bootstrap: convert rls to use TarballPietro Albini-50/+6
2020-12-23bootstrap: convert rustfmt to use TarballPietro Albini-49/+7
2020-12-23bootstrap: convert miri to use TarballPietro Albini-51/+7
2020-12-23bootstrap: simplify including licenses and readmes to tarballsPietro Albini-8/+2
2020-12-23bootstrap: convert clippy to use TarballPietro Albini-48/+10
2020-12-23bootstrap: convert cargo to use TarballPietro Albini-56/+15
2020-12-23bootstrap: convert rust-analysis to use TarballPietro Albini-36/+12