about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2020-09-28Bump bootstrap version and update changelogTyler Mandry-2/+11
2020-09-28Remove skip_only_host_stepsTyler Mandry-58/+23
And make tests explicitly list their hosts and targets.
2020-09-28bootstrap: Always build for host, even when target is givenTyler Mandry-17/+9
This changes the behavior from *not* building for host whenever an explicit target is specified. I find this much less confusing. You can still disable host steps by passing an explicit empty list for host. Fixes #76990.
2020-09-28Don't warn if the config file is somewhere other than `config.toml`Joshua Nelson-5/+7
Previously, `config.config` was always hardcoded as `"config.toml"`. I thought that it was being overridden with the actual value later, but it turns out `flags.config` was being completely discarded. This keeps `config.config` in sync with `flags.config`.
2020-09-28Auto merge of #77008 - fortanix:raoul/lvi-tests, r=Mark-Simulacrumbors-2/+8
LVI hardening tests Mitigating the speculative execution LVI attack against SGX enclaves requires compiler changes (i.e., adding lfences). This pull requests adds various tests to check if this happens correctly.
2020-09-27reduce overlong lineTshepang Lekhonkhobe-1/+2
2020-09-26Rollup merge of #76631 - jyn514:x.py-setup, r=Mark-SimulacrumRalf Jung-8/+152
Add `x.py setup` Closes #76503. - Suggest `x.py setup` if config.toml doesn't exist yet - Prompt for a profile if not given on the command line - Print the configuration that will be used - Print helpful starting commands after setup - Link to the dev-guide after finishing
2020-09-25Rollup merge of #77146 - Mark-Simulacrum:xpyinstall, r=alexcrichtonJonas Schievink-1/+1
Install std for non-host targets It seems reasonable that when configuring various targets you'd expect all of them to get std installed, even if you're not building compiler toolchains for each of those. cc #76990 r? @alexcrichton
2020-09-25Rollup merge of #77126 - Mark-Simulacrum:llvm-less-often, r=alexcrichtonJonas Schievink-2/+13
Invalidate local LLVM cache less often This avoids a download of LLVM after every rebase. The downside to this is that if we land some patch affecting LLVM built in CI that breaks this option, but that PR does not update the LLVM submodule, we'll likely not notice until the next update -- but this seems unlikely to happen in practice and I am not personally worried about it. r? @alexcrichton
2020-09-25Rollup merge of #77120 - ecstatic-morse:keep-stage-std, r=Mark-SimulacrumJonas Schievink-2/+26
Add `--keep-stage-std` to `x.py` for keeping only standard library artifacts Unlike `--keep-stage 0`, `--keep-stage-std 0` will allow the stage 0 compiler artifacts (i.e., stage1/bin/rustc) to be rebuilt if it has changed. This allows contributors to iterate on later stages of the compiler in tandem with the standard library without needing to to rebuild the entire compiler. I often run into this when working on const-checking, since I may need to add a feature gate or make a small tweak to the standard library.
2020-09-25Rollup merge of #77106 - matthiaskrgr:changelog_seen, r=Mark-SimulacrumJonas Schievink-1/+1
clarify that `changelog-seen = 1` goes to the beginning of config.toml Fixes #77105
2020-09-25Rollup merge of #77086 - ehuss:src-libunwind, r=Mark-SimulacrumJonas Schievink-1/+1
Include libunwind in the rust-src component. Some targets, such as musl, need the libunwind source to build the unwind crate (referenced [here](https://github.com/rust-lang/rust/blob/0da58007451a154da2480160429e1604a1f5f0ec/library/unwind/build.rs#L142)). Fixes rust-lang/wg-cargo-std-aware#59
2020-09-25Patch compilation test helpers for sgx platformRaoul Strackx-2/+8
2020-09-24Add `x.py setup`Joshua Nelson-8/+152
- Suggest `x.py setup` if config.toml doesn't exist yet (twice, once before and once after the build) - Prompt for a profile if not given on the command line - Print the configuration file that will be used - Print helpful starting commands after setup - Link to the dev-guide after finishing - Note that distro maintainers will see the changelog warning
2020-09-24Install std for non-host targetsMark Rousskov-1/+1
2020-09-23Add entry to CHANGELOG for `--keep-stage-std`Dylan MacKenzie-0/+4
2020-09-23Remove warning about possible future deprecationDylan MacKenzie-4/+0
2020-09-23Re-download LLVM on submodule updates onlyMark Rousskov-2/+13
2020-09-23Add `keep-stage-std` to `x.py`Dylan MacKenzie-2/+26
This keeps only the `std` artifacts compiled by the given stage, not the compiler. This is useful when working on the latter stages of the compiler in tandem with the standard library, since you don't have to rebuild the *entire* compiler when the standard library changes.
2020-09-23clarify that `changelog-seen = 1` goes to the beginning of config.tomlMatthias Krüger-1/+1
Fixes #77105
2020-09-23Auto merge of #76864 - est31:downloaded_llvm_no_clone_sources, r=Mark-Simulacrumbors-2/+3
Don't download/sync llvm-project submodule if download-ci-llvm is set llvm-project takes > 1GB storage space and a long time to download. It's better to not download it unless needed.
2020-09-22Include libunwind in the rust-src component.Eric Huss-1/+1
2020-09-22Auto merge of #76810 - Mark-Simulacrum:fix-lld-macos, r=alexcrichtonbors-11/+13
Don't dynamically link LLVM tools unless rustc is too This PR initially tried to support link-shared on all of our target platforms (other than Windows), but ran into a number of difficulties: * LLVM doesn't really support a shared link on macOS (llvm-config runs into problems with the version suffix) * LLVM doesn't seem to support a shared link when cross-compiling (the libLLVM.so ends up empty and symbols are not found) So, this PR has now been revised such that we don't attempt to dynamically link LLVM tools (even if that would, otherwise, be supported) on targets where LLVM is statically linked to rustc. Currently that's basically everything except for x86_64-unknown-linux-gnu (where we dynamically link to avoid rerunning ThinLTO in each stage). Follow-up to #76708. Fixes #76698.
2020-09-22Auto merge of #76626 - jyn514:x.py-changelog, r=Mark-Simulacrumbors-1/+90
Add a changelog for x.py and nag contributors until they read it Add a changelog for x.py - Add a changelog and instructions for updating it - Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read. There's no way to tie reading the changelog to updating the version, so unfortunately they still have to update `config.toml` manually. Actually reading the changelog is optional, anyone can set `changelog-seen = N` without reading (although it's not recommended). - Nag people if they haven't read the x.py changelog + Print message twice to make sure it's seen - Give different error messages depending on whether the version needs to be updated or added Closes https://github.com/rust-lang/rust/issues/76617 r? `@Mark-Simulacrum`
2020-09-22Auto merge of #76799 - Mark-Simulacrum:fix-cross-compile-dist, r=alexcrichtonbors-2/+56
Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolve #76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in #76549.
2020-09-21Add a changelog for x.pyJoshua Nelson-1/+90
- Add a changelog and instructions for updating it - Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read - Nag people if they haven't read the x.py changelog + Print message twice to make sure it's seen - Give different error messages depending on whether the version needs to be updated or added
2020-09-21Rollup merge of #76628 - jyn514:default-config-files, r=Mark-SimulacrumRalf Jung-25/+103
Add sample defaults for config.toml - Allow including defaults in `src/bootstrap/defaults` using `profile = "..."`. - Add default config files, with a README noting they're experimental and asking you to open an issue if you run into trouble. The config files have comments explaining why the defaults are set. - Combine config files using the `merge` dependency. This introduces a new dependency on `merge` that hasn't yet been vetted. I want to improve the output when `include = "x"` isn't found: ``` thread 'main' panicked at 'fs::read_to_string(&file) failed with No such file or directory (os error 2) ("configuration file did not exist")', src/bootstrap/config.rs:522:28 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failed to run: /home/joshua/rustc/build/bootstrap/debug/bootstrap test tidy Build completed unsuccessfully in 0:00:00 ``` However that seems like it could be fixed in a follow-up. Closes #76619
2020-09-20Specify output directory for bootstrap testsMark Rousskov-0/+5
2020-09-20Provide bootstrap tools with RUSTC in environmentMark Rousskov-0/+6
2020-09-20Add sample defaults for config.tomlJoshua Nelson-25/+103
- Allow including defaults in `src/bootstrap/defaults` using `profile = "..."` - Add default config files - Combine config files using the merge dependency. - Add comments to default config files - Add a README asking to open an issue if the defaults are bad - Give a loud error if trying to merge `.target`, since it's not currently supported - Use an exhaustive match - Use `<none>` in config.toml.example to avoid confusion - Fix bugs in `Merge` derives Previously, it would completely ignore the profile defaults if there were any settings in `config.toml`. I sent an email to the `merge` maintainer asking them to make the behavior in this commit the default. This introduces a new dependency on `merge` that hasn't yet been vetted. I want to improve the output when `include = "x"` isn't found: ``` thread 'main' panicked at 'fs::read_to_string(&file) failed with No such file or directory (os error 2) ("configuration file did not exist")', src/bootstrap/config.rs:522:28 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failed to run: /home/joshua/rustc/build/bootstrap/debug/bootstrap test tidy Build completed unsuccessfully in 0:00:00 ``` However that seems like it could be fixed in a follow-up.
2020-09-20Discover Rust toolchain without PythonMark Rousskov-12/+36
2020-09-20Remove support for different src directoryMark Rousskov-4/+4
This requires that bootstrap is run from the same worktree as the sources it'll build, but this is basically required for the build to work anyway. You can still run it from a different directory, just that the files it builds must be beside it.
2020-09-20Set BUILD_TRIPLE via build scriptMark Rousskov-2/+5
This moves build triple discovery for rustbuild from bootstrap.py into a build script, meaning it will "just work" if building rustbuild via Cargo rather than Python.
2020-09-20Rollup merge of #76878 - pietroalbini:version, r=Mark-SimulacrumRalf Jung-21/+22
Move the version number to a plaintext file The Rust version number is currently embedded in bootstrap's source code, which makes it hard to update it automatically or access it outside of ./x.py (as you'd have to parse the source code). This PR moves the version number to a standalone plaintext file, which makes accessing or updating it trivial. r? @Mark-Simulacrum
2020-09-20Rollup merge of #76800 - jyn514:usage, r=Mark-SimulacrumRalf Jung-30/+32
Don't generate bootstrap usage unless it's needed Previously, `x.py` would unconditionally run `x.py build` to get the help message. After https://github.com/rust-lang/rust/issues/76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`). r? @Mark-Simulacrum This should fix the CI failures in https://github.com/rust-lang/rust/pull/76797 and https://github.com/rust-lang/rust/pull/75991.
2020-09-19Do not link LLVM tools to LLVM dylib unless rustc isMark Rousskov-11/+13
Previously we would have some platforms where LLVM was linked to rustc statically, but to the LLVM tools dynamically. That meant we were distributing two copies of LLVM: one as a separate dylib and one statically linked in to librustc_driver.
2020-09-19Rollup merge of #76796 - jyn514:wrong-stage, r=shepmasterRalf Jung-1/+7
Give a better error message when x.py uses the wrong stage for CI r? @shepmaster
2020-09-18build-manifest: stop receiving release numbers from bootstrapPietro Albini-8/+2
2020-09-18bootstrap: move the version number to a plaintext filePietro Albini-21/+22
The Rust version number is currently embedded in bootstrap's source code, which makes it hard to update it automatically or access it outside of ./x.py (as you'd have to parse the source code). This commit moves the version number to a standalone plaintext file, which makes accessing or updating it trivial.
2020-09-18Don't download/sync llvm-project submodule if download-ci-llvm is setest31-2/+3
llvm-project takes > 1GB storage space and a long time to download. It's better to not download it unless needed.
2020-09-18Distribute rustc sources as part of `rustc-dev`Jonas Schievink-0/+12
2020-09-17Add test for x.py build cross-compilationMark Rousskov-0/+48
2020-09-16Build rustdoc for cross-compiled targetsMark Rousskov-1/+5
This isn't an issue for most folks who use x.py dist, which will directly depend on this. But for x.py build, if we don't properly set target here rustdoc will not be built. Currently, there is not a default-on step for generating a rustc for a given target either, so we will fail to build a rustc as well.
2020-09-16Pass --target to lint docsMark Rousskov-1/+3
Otherwise, we may not have a standard library built for the native "host" target of the rustc being run.
2020-09-16Rollup merge of #76741 - Mark-Simulacrum:no-dry-run-timing, r=alexcrichtonTyler Mandry-1/+1
Avoid printing dry run timings This avoids a wall of text on CI with 0.000 as the likely time. r? @alexcrichton
2020-09-16Rollup merge of #76735 - jyn514:no-clone, r=Mark-SimulacrumTyler Mandry-40/+39
Remove unnecessary `clone()`s in bootstrap The performance difference is negligible, but it makes me feel better. r? @Mark-Simulacrum
2020-09-16Don't generate bootstrap usage unless it's neededJoshua Nelson-30/+32
Previously, `x.py` would unconditionally run `x.py build` to get the help message. After https://github.com/rust-lang/rust/issues/76165, when checking the CI stage was moved into `Config`, that would cause an assertion failure (but only only in CI!): ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `1`, right: `2`', src/bootstrap/config.rs:619:49 ``` This changes bootstrap to only generate a help message when it needs to (when someone passes `--help`).
2020-09-16Give a better error message when x.py uses the wrong stage for CIJoshua Nelson-1/+7
2020-09-16Remove unnecessary `clone()`s in bootstrapJoshua Nelson-40/+39
The performance difference is negligible, but it makes me feel better. Note that this does not remove some clones in `config`, because it would require changing the logic around (and performance doesn't matter for bootstrap).
2020-09-16Rollup merge of #76717 - ehuss:fix-rustc-book-libdir, r=Mark-SimulacrumDylan DPC-6/+14
Fix generating rustc docs with non-default lib directory. If `libdir` is set in `config.toml`, then the tool to generate the rustc docs was unable to run `rustc` because it could not find the shared libraries. The solution is to set the dylib search path to include the libdir. I changed the API of `add_rustc_lib_path` to take `Command` instead of `Cargo` to try to share the code in several places. This is how it worked before https://github.com/rust-lang/rust/pull/64316, and I think this still retains the spirit of that change. Fixes #76702