summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2020-11-15Miri is not required on betaMark Rousskov-2/+2
2020-11-15Install CI llvm into the library directoryMark Rousskov-1/+4
2020-11-15Avoid installing external LLVM dylibsMark Rousskov-0/+16
If the LLVM was externally provided, then we don't currently copy artifacts into the sysroot. This is not necessarily the right choice (in particular, it will require the LLVM dylib to be in the linker's load path at runtime), but the common use case for external LLVMs is distribution provided LLVMs, and in that case they're usually in the standard search path (e.g., /usr/lib) and copying them here is going to cause problems as we may end up with the wrong files and isn't what distributions want. This behavior may be revisited in the future though.
2020-10-20bootstrap: set correct path for the build-manifest binaryPietro Albini-1/+1
2020-10-20build-manifest: bundle the rustc version in the binaryPietro Albini-2/+0
2020-10-20bootstrap: add --include-default-paths to ./x.pyPietro Albini-21/+30
2020-10-20bootstrap: add disabled by default build-manifest dist componentPietro Albini-0/+68
2020-10-20build-manifest: accept the Rust version instead of the monorepo pathPietro Albini-2/+2
This commit changes the way build-manifest is invoked, to let it accept the Rust version directly instead of requiring the path of the Rust monorepo and letting build-manifest figure out the path on its own. This allows to run build-manifest without a clone of the monorepo.
2020-10-20bootstrap: always use the Rust version in package namesPietro Albini-52/+1
The format of the tarballs produced by CI is roughly the following: {component}-{release}-{target}.{ext} While on the beta and nightly channels `{release}` is just the channel name, on the stable channel is either the Rust version or the version of the component we're shipping: cargo-0.47.0-x86_64-unknown-linux-gnu.tar.xz clippy-0.0.212-x86_64-unknown-linux-gnu.tar.xz llvm-tools-1.46.0-x86_64-unknown-linux-gnu.tar.xz miri-0.1.0-x86_64-unknown-linux-gnu.tar.xz rls-1.41.0-x86_64-unknown-linux-gnu.tar.xz rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz ... This makes it really hard to get the package URL without having access to the manifest (and there is no manifest on ci-artifacts.rlo), as there is no consistent version number to use. This commit addresses the problem by always using the Rust version number as `{release}` for the stable channel, regardless of the version number of the component we're shipping. I chose that instead of "stable" to avoid breaking the URL scheme *that* much. Rustup should not be affected by this change, as it fetches the URLs from the manifest. Unfortunately we don't have a way to test other clients before making a stable release, as this change only affects the stable channel.
2020-10-08build-manifest: keep legacy behavior when invoking through ./x.py distPietro Albini-0/+1
2020-10-08bootstrap: add ./x.py run src/tools/build-manifestPietro Albini-2/+44
2020-09-30Auto merge of #77298 - jyn514:bootstrap-config, r=Mark-Simulacrumbors-5/+7
Don't warn if the config file is somewhere other than `config.toml` 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`. Fixes https://github.com/rust-lang/rust/issues/77293 r? `@Mark-Simulacrum` cc `@davidtwco`
2020-09-30Auto merge of #77133 - tmandry:bootstrap-host, r=Mark-Simulacrumbors-71/+37
bootstrap: Always build for host, even when target is given 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. r? `@Mark-Simulacrum`
2020-09-29Filter out empty items in bootstrap::flags::splitTyler Mandry-1/+1
2020-09-29Auto merge of #77145 - pietroalbini:refactor-build-manifest-versions, ↵bors-8/+2
r=Mark-Simulacrum Refactor versions detection in build-manifest This PR refactors how `build-manifest` handles versions, making the following changes: * `build-manifest` now detects the "package releases" on its own, without relying on rustbuild providing them through CLI arguments. This drastically simplifies calling the tool outside of `x.py`, and will allow to ship the prebuilt tool in a tarball in the future, with the goal of stopping to invoke `x.py` during `promote-release`. * The `tar` command is not used to extract the version and the git hash from tarballs anymore. The `flate2` and `tar` crates are used instead. This makes detecting those pieces of data way faster, as the archive is decompressed just once and we stop parsing the archive once all the information is retrieved. * The code to extract the version and the git hash now stores all the collected data dynamically, without requiring to add new fields to the `Builder` struct every time. I tested the changes locally and it should behave the same as before. r? `@Mark-Simulacrum`
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.