Commit Graph

3112 Commits

Author SHA1 Message Date
Mark Rousskov fe52a65186 Use package name for top-level directory in bare tarballs
This fixes a bug introduced by #79788.
2020-12-26 17:15:20 -05:00
bors 1f5beec3b1 Auto merge of #80316 - ehuss:rustdoc-index, r=Mark-Simulacrum
Include rustdoc in the compiler docs index.

This should help ensure that the index page at https://doc.rust-lang.org/nightly/nightly-rustc/ includes a link to the rustdoc docs as well.

Fixes #80307
2020-12-26 09:29:56 +00:00
Joshua Nelson 82acbc8a49 Document rustc_macros on nightly-rustc 2020-12-24 20:25:40 -05:00
Pietro Albini 8736731f70
bootstrap: convert reproducible-artifacts to use Tarball 2020-12-23 19:40:45 +01:00
Pietro Albini 2c081769b0
bootstrap: use the normal compiler to build std 2020-12-23 19:35:22 +01:00
Pietro Albini ae12a0c200
bootstrap: avoid producing the rust tarball during dry runs 2020-12-23 19:35:22 +01:00
Pietro Albini f18335edb2
bootstrap: convert rustc-src to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 48924ab708
bootstrap: convert rust to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 1906c42962
bootstrap: convert rust-src to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 2e0a16cf0d
bootstrap: convert rust-analyzer to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini cfb23e845e
bootstrap: convert rls to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 2b54f0de37
bootstrap: convert rustfmt to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 2073ea5c07
bootstrap: convert miri to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 32afb3c436
bootstrap: simplify including licenses and readmes to tarballs 2020-12-23 19:35:22 +01:00
Pietro Albini 521b884913
bootstrap: convert clippy to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 8a711a00a7
bootstrap: convert cargo to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini c4aaff65f0
bootstrap: convert rust-analysis to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini c0cadc9eb7
bootstrap: convert rustc-dev to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 79f60fbd04
bootstrap: convert rust-std to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini fd4515cb3f
bootstrap: refactor showing the "dist" info 2020-12-23 19:35:22 +01:00
Pietro Albini 0a2e1c5a2c
bootstrap: convert rustc to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 82d9eaa54d
bootstrap: convert rust-mingw to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 8ca46fc7a8
bootstrap: convert rustc-docs to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini c768ce1384
bootstrap: convert rust-docs to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini 7be85701cd
bootstrap: convert llvm-tools to use Tarball 2020-12-23 19:35:22 +01:00
Pietro Albini ddf82636c6
bootstrap: convert build-manifest to use the new Tarball struct 2020-12-23 19:35:22 +01:00
bors 3ffea60dd5 Auto merge of #80262 - Mark-Simulacrum:pgo-rustc, r=pietroalbini
Utilize PGO for rustc linux dist builds

This implements support for applying PGO to the rustc compilation step (not
standard library or any tooling, including rustdoc). Expanding PGO to more tools
is not terribly difficult but will involve more work and greater CI time
commitment.

For the same reason of avoiding greater implementation time commitment,
implementing for platforms outside of x86_64-unknown-linux-gnu is skipped.
In practice it should be quite simple to extend over time to more platforms. The
initial implementation is intentionally minimal here to avoid too much work
investment before we start seeing wins for a subset of Rust users.

The choice of workloads to profile here is somewhat arbitrary, but the general
rationale was to aim for a small set that largely avoided time regressions on
perf.rust-lang.org's full suite of crates. The set chosen is libcore, cargo (and
its dependencies), and a few ad-hoc stress tests from perf.rlo. The stress tests
are arguably the most controversial, but they benefit those cases (avoiding
regressions) and do not really remove wins from other benchmarks.

The primary next step after this PR lands is to implement support for PGO in
LLVM. It is unclear whether we can afford a full LLVM rebuild in CI, though, so
the approach taken there may need to be more staggered. rustc-only PGO seems
well affordable on linux at least, giving us up to 20% wall time wins on some
crates for 15 minutes of extra CI time (1 hour with this PR, up from 45 minutes).

The PGO data is uploaded to allow others to reuse it if attempting to reproduce
the CI build or potentially, in the future, on other platforms where an
off-by-one strategy is used for dist builds at minimal performance cost.

r? `@michaelwoerister` (but tell me if you don't want to / don't feel comfortable approving and we can find others)
2020-12-23 12:54:56 +00:00
Eric Huss a6d377d565 Include rustdoc in the compiler docs index. 2020-12-22 16:33:36 -08:00
Tomasz Miąsko 32716814a2 Ignore proc-macros when assembling rustc libdir 2020-12-23 00:00:00 +00:00
Mark Rousskov a448f88b69 Utilize PGO for rustc linux dist builds
This implements support for applying PGO to the rustc compilation step (not
standard library or any tooling, including rustdoc). Expanding PGO to more tools
is not terribly difficult but will involve more work and greater CI time
commitment.

For the same reason of avoiding greater time commitment, this currently avoids
implementing for platforms outside of x86_64-unknown-linux-gnu, though in
practice it should be quite simple to extend over time to more platforms. The
initial implementation is intentionally minimal here to avoid too much work
investment before we start seeing wins for a subset of Rust users.

The choice of workloads to profile here is somewhat arbitrary, but the general
rationale was to aim for a small set that largely avoided time regressions on
perf.rust-lang.org's full suite of crates. The set chosen is libcore, cargo (and
its dependencies), and a few ad-hoc stress tests from perf.rlo. The stress tests
are arguably the most controversial, but they benefit those cases (avoiding
regressions) and do not really remove wins from other benchmarks.

The primary next step after this PR lands is to implement support for PGO in
LLVM. It is unclear whether we can afford a full LLVM rebuild in CI, though, so
the approach taken there may need to be more staggered. rustc-only PGO seems
well affordable on linux at least, giving us up to 20% wall time wins on some
crates for 15 minutes of extra CI time (1 hour up from 45 minutes).

The PGO data is uploaded to allow others to reuse it if attempting to reproduce
the CI build or potentially, in the future, on other platforms where an
off-by-one strategy is used for dist builds at minimal performance cost.
2020-12-22 12:23:37 -05:00
Yuxuan Shui fbc9d50d75
make sure installer only creates directories in DESTDIR
Fixes #80238

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-20 17:16:02 +00:00
J. Ryan Stinnett e628fcfcb5 Skip `dsymutil` by default for compiler bootstrap
`dsymutil` adds time to builds on Apple platforms for no clear benefit, and also
makes it more difficult for debuggers to find debug info. The compiler currently
defaults to running `dsymutil` to preserve its historical default, but when
compiling the compiler itself, we skip it by default since we know it's safe to
do so in that case.
2020-12-20 02:55:35 +00:00
bors f745834457 Auto merge of #80081 - ehuss:update-cargo, r=Mark-Simulacrum
Update cargo

4 commits in d274fcf862b89264fa2c6b917b15230705257317..a3c2627fbc2f5391c65ba45ab53b81bf71fa323c
2020-12-07 23:08:44 +0000 to 2020-12-14 17:21:26 +0000
- Check if rerun-if-changed points to a directory. (rust-lang/cargo#8973)
- Implement external credential process. (RFC 2730) (rust-lang/cargo#8934)
- Revert recent build-std vendoring changes (rust-lang/cargo#8968)
- Fix the unit dependency graph with dev-dependency `links` (rust-lang/cargo#8969)
2020-12-18 19:09:17 +00:00
Eric Huss 74498c17e0 Update cargo 2020-12-18 07:30:23 -08:00
David Wood 62eab830c8
bootstrap: update ci-llvm stamp after #80087
Unfortunately, #80087 forgot to update the ci-llvm stamp, so the updated
ci-llvm tarball with `llvm-dwp` wasn't downloaded by users. This commit
updates the ci-llvm stamp to resolve that problem.

Signed-off-by: David Wood <david@davidtw.co>
2020-12-17 10:29:58 +00:00
Yuki Okushi 5ce62da43b
Rollup merge of #80082 - ehuss:revert-rust-src-vendor, r=Mark-Simulacrum
Revert #78790 - rust-src vendoring

This reverts the rust-src vendor changes from #78790. There were a few issues (see #79218, https://github.com/rust-lang/cargo/issues/8962, https://github.com/rust-lang/cargo/issues/8963), that I don't think will get fixed in the next few days before the beta branch.

Fixes #79218
2020-12-17 11:44:10 +09:00
David Wood 6132e21961
bootstrap: include llvm-dwp in CI LLVM
This commit includes the `llvm-dwp` tool in the CI LLVM (which rustc
developers can download instead of building LLVM locally) - `llvm-dwp`
is required by Split DWARF which landed in PR #77117.

Signed-off-by: David Wood <david@davidtw.co>
2020-12-16 19:16:36 +00:00
Eric Huss 6893206086 Revert "Auto merge of #78790 - Gankra:rust-src-vendor, r=Mark-Simulacrum"
This reverts commit 7afc517230, reversing
changes made to d4ea0b3e46.
2020-12-16 09:10:40 -08:00
David Wood 99ad915e32
compiletest: add split dwarf compare mode
This commit adds a Split DWARF compare mode to compiletest so that
debuginfo tests are also tested using Split DWARF in split mode (and
manually in single mode).

Signed-off-by: David Wood <david@davidtw.co>
2020-12-16 10:33:51 +00:00
David Wood 241160de72
bootstrap: copy `llvm-dwp` to sysroot
`llvm-dwp` is required for linking the DWARF objects into DWARF packages
when using Split DWARF, especially given that rustc produces multiple
DWARF objects (one for each codegen unit).

Signed-off-by: David Wood <david@davidtw.co>
2020-12-16 10:33:45 +00:00
Yuki Okushi d90084c226
Rollup merge of #79970 - bjorn3:no_unnecessary_llvm_checkout, r=Mark-Simulacrum
Misc rustbuild improvements when the LLVM backend isn't used

* Don't checkout llvm-project
* Don't require cmake and ninja

Fixes #78564
2020-12-13 11:05:43 +09:00
Yuki Okushi 54119d4436
Rollup merge of #79954 - jyn514:normalize-oops, r=Mark-Simulacrum
Fix building compiler docs with stage 0

This regressed in https://github.com/rust-lang/rust/pull/79525 (see https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Can't.20document.20single.20crate).

r? `@Mark-Simulacrum`
2020-12-13 11:05:40 +09:00
Yuki Okushi 1b81f08d4c
Rollup merge of #79940 - matthiaskrgr:cl15ppy, r=Dylan-DPC
fix more clippy::complexity findings

fix clippy::unnecessary_filter_map
use if let Some(x) = ..  instead of ...map(|x|) to conditionally run fns that return () (clippy::option_map_unit_fn)
fix clippy::{needless_bool, manual_unwrap_or}
don't clone types that are copy (clippy::clone_on_copy)
don't convert types into identical types with .into() (clippy::useless_conversion)
use strip_prefix over slicing (clippy::manual_strip)

r? ``@Dylan-DPC``
2020-12-13 11:05:36 +09:00
Yuki Okushi f80c6aeb87
Rollup merge of #79845 - jyn514:python3, r=Mark-Simulacrum
Fix rustup support in default_build_triple for python3

bootstrap completely ignores all errors when detecting a rustup version,
so this wasn't noticed before.

Fixes the following error:

```
rustup not detected: a bytes-like object is required, not 'str'
falling back to auto-detect
```

This also takes the opportunity to only call rustup and other external
commands only once during startup.

Follow-up to https://github.com/rust-lang/rust/pull/78513.
2020-12-13 11:05:35 +09:00
Joshua Nelson 9df0348299 Fix building compiler docs with stage 0 2020-12-12 17:31:35 -05:00
bjorn3 d79e19f332 Don't require cmake and ninja when the LLVM backend is not used 2020-12-12 18:13:04 +01:00
bjorn3 16f69b5430 Don't checkout llvm-project when the LLVM backend isn't built 2020-12-12 18:06:07 +01:00
Matthias Krüger b7795e135a fix clippy::{needless_bool, manual_unwrap_or} 2020-12-11 23:02:19 +01:00
Matthias Krüger db6c50998c don't clone types that are copy (clippy::clone_on_copy) 2020-12-11 23:02:19 +01:00
Matthias Krüger 5c8de1cf49 use strip_prefix over slicing (clippy::manual_strip) 2020-12-11 23:02:17 +01:00
Corey Farwell 25bfa15371 Manually code-sign after running install_name_tool 2020-12-10 18:51:30 -05:00
Corey Farwell d1911dd075 If "aarch64-apple-darwin", copy sanitizers. 2020-12-10 00:18:43 -05:00
Corey Farwell 5940c19315 Enable ASan, TSan, UBSan for aarch64-apple-darwin. 2020-12-09 23:53:53 -05:00
Joshua Nelson 8909c4dc31 Fix rustup support in default_build_triple for python3
bootstrap completely ignores all errors when detecting a rustup version,
so this wasn't noticed before.

Fixes the following error:

```
rustup not detected: a bytes-like object is required, not 'str'
falling back to auto-detect
```

This also takes the opportunity to only call rustup and other external
commands only once during startup.
2020-12-08 19:38:25 -05:00
Matthias Krüger dbe3acfaeb don't wrap code block in Ok() (clipppy::unit_arg) 2020-12-08 20:27:48 +01:00
Nixon Enraght-Moony 1098cce27a Add tests for rustdoc json
Move rustdoc/rustdoc-json to rustdoc-json

Scaffold rustdoc-json test mode

Implement run_rustdoc_json_test

Fix up python

Make tidy happy
2020-12-01 18:34:39 +00:00
Mara Bos f45e6953d7
Rollup merge of #79527 - jyn514:intra-doc-tests, r=Manishearth
Move intra-doc link tests into a subdirectory

They were starting to get unwieldy.

r? ``@Manishearth``
2020-12-01 10:50:19 +00:00
Mara Bos 99e075ff29
Rollup merge of #79525 - jyn514:feature-gate-normalize, r=GuillaumeGomez
Add -Z normalize-docs and enable it for compiler docs

Works around https://github.com/rust-lang/rust/issues/79459 by only enabling normalization for the compiler itself (and anyone who opts-in on nightly). Eventually I want to remove this and enable normalization by default, but that's turned out to be [really hard](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20normalize.20projection.20types.20to.20a.20single.20type.3F/near/218125195).

This uses a command line option instead of a feature gate so it's easier to pass it to all crates at once. Theoretically it's better to use a feature gate instead so that it's easier for people to use on docs.rs, but I'm also not terribly concerned with how easy it to use a temporary hack.

Addresses https://github.com/rust-lang/rust/issues/77459.
2020-12-01 10:50:18 +00:00
Mara Bos 36ce8db229
Rollup merge of #79522 - ehuss:lint-check-validate, r=Mark-Simulacrum
Validate lint docs separately.

This addresses some concerns raised in https://github.com/rust-lang/rust/pull/76549#issuecomment-727638552 about errors with the lint docs being confusing and cumbersome. Errors from validating the lint documentation were being generated during `x.py doc` (and `x.py dist`), since extraction and validation are being done in a single step. This changes it so that extraction and validation are separated, so that `x.py doc` will not error if there is a validation problem, and tests are moved to `x.py test src/tools/lint-docs`.

This includes the following changes:

* Separate validation to `x.py test`.
* Added some more documentation on how to more easily modify and test the docs.
* Added more help to the error messages to hopefully provide more information on how to fix things.

The first commit just moves the code around, so you may consider looking at the other commits for a smaller diff.
2020-12-01 10:50:16 +00:00
Joshua Nelson 95a6427d2c Add -Z normalize-docs and enable it for compiler docs 2020-11-29 17:21:24 -05:00
Joshua Nelson 872acb0c35 Move `src/test/rustdoc-ui` intra-doc tests into a subdirectory
This also changes the builder to allow using
`x.py test src/test/rustdoc-ui/intra-doc`; before, it would panic that
no paths were found.
2020-11-28 21:14:09 -05:00
nooberfsh 331d52643a Fix a bootstrap comment 2020-11-29 10:02:24 +08:00
Eric Huss d2d91b42a5 lint-docs: Add --validate flag to validate lint docs separately. 2020-11-28 13:39:02 -08:00
Joseph Rafael Ferrer 6b47920c69 Convert UNC path to local path to satisfy install script on Windows 2020-11-23 22:37:51 +08:00
bors d806d65657 Auto merge of #79115 - cuviper:rust-description, r=Mark-Simulacrum
x.py: allow a custom string appended to the version

This adds `rust.description` to the config as a descriptive string to be
appended to `rustc --version` output, which is also used in places like
debuginfo `DW_AT_producer`. This may be useful for supplementary build
information, like distro-specific package versions.

For example, in Fedora 33, `gcc --version` outputs:

    gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6)

With this change, we can add similar vendor info to `rustc --version`.
2020-11-21 15:43:09 +00:00
Dylan DPC d5ee4edee1
Rollup merge of #79183 - cuviper:compiletest-test-sysroot, r=Mark-Simulacrum
Make compiletest testing use the local sysroot

We already set `compiletest` to use the local sysroot in #68019, but
that missed the configuration for testing `compiletest` itself.
2020-11-19 23:58:40 +01:00
Dylan DPC de62272548
Rollup merge of #79156 - jyn514:relative-llvm, r=Mark-Simulacrum
Allow using `download-ci-llvm` from directories other than the root

Previously, bootstrap.py would attempt to find the LLVM commit from
`src/llvm-project`. However, it assumed it was always being run from the
top-level directory, which isn't always the case.

Before:

```
downloading https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz

curl: (22) The requested URL returned error: 404
failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmppyh4w8 https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
Build completed unsuccessfully in 0:00:02
```

After:

```
downloading https://ci-artifacts.rust-lang.org/rustc-builds/430feb24a46993e5073c1bb1b39da190d83fa2bf/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
 ###################################################################################################################################################################### 100.0%
extracting /home/joshua/rustc/src/bootstrap/build/cache/llvm-430feb24a46993e5073c1bb1b39da190d83fa2bf-False/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
```

r? ```@Mark-Simulacrum```
cc ```@pnkfelix```
2020-11-19 16:26:42 +01:00
Dylan DPC 3b857a5a3a
Rollup merge of #79155 - 12101111:fix-profiler-config, r=Mark-Simulacrum
fix handling the default config for profiler and sanitizers

#78354 don't handle the case that user don't add any target-specific config in `[target.*]` of `config.toml`:
```toml
changelog-seen = 2
[llvm]
link-shared = true
[build]
sanitizers = true
profiler = true
[install]
[rust]
[dist]
```

The previes code handle the default config in `Config::prase()`:

```rust
target.sanitizers = cfg.sanitizers.unwrap_or(build.sanitizers.unwrap_or_default());
target.profiler = cfg.profiler.unwrap_or(build.profiler.unwrap_or_default());
config.target_config.insert(TargetSelection::from_user(&triple), target);
```

In this case, `toml.target` don't contain any target, so the above code won't execute. Instead, a default `Target` is insert in c919f490bb/src/bootstrap/sanity.rs (L162-L166)

The default value for `bool` is false, hence the issue in #79124

This fix change the type of `sanitizers` and `profiler` to `Option<bool>`, so the default value is `None`, and fallback config is handled in  `Config::sanitizers_enabled` and `Config::profiler_enabled`

fix #79124

cc `@Mark-Simulacrum` `@richkadel`
2020-11-19 16:26:40 +01:00
Josh Stone 566e8771a5 Make compiletest testing use the local sysroot
We already set `compiletest` to use the local sysroot in #68019, but
that missed the configuration for testing `compiletest` itself.
2020-11-18 14:41:27 -08:00
Joshua Nelson 5163912e56 Allow using `download-ci-llvm` from directories other than the root
Previously, bootstrap.py would attempt to find the LLVM commit from
`src/llvm-project`. However, it assumed it was always being run from the
top-level directory, which isn't always the case.

Before:

```
downloading https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz

curl: (22) The requested URL returned error: 404
failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmppyh4w8 https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
Build completed unsuccessfully in 0:00:02
```

After:

```
downloading https://ci-artifacts.rust-lang.org/rustc-builds/430feb24a46993e5073c1bb1b39da190d83fa2bf/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
 ###################################################################################################################################################################### 100.0%
extracting /home/joshua/rustc/src/bootstrap/build/cache/llvm-430feb24a46993e5073c1bb1b39da190d83fa2bf-False/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
```
2020-11-17 22:09:08 -05:00
12101111 36972b0d63 fix handling the default config for profiler and sanitizers 2020-11-18 10:33:07 +08:00
Pietro Albini d17874ff60 bootstrap: use the same version number for rustc and cargo
Historically the stable tarballs were named after the version number of
the specific tool, instead of the version number of Rust. For example,
both of the following tarballs were part of the same release:

    rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz
    cargo-0.49.0-x86_64-unknown-linux-gnu.tar.xz

PR #77336 changed the dist code to instead use Rust's version number for
all the tarballs, regardless of the tool they contain:

    rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz
    cargo-1.48.0-x86_64-unknown-linux-gnu.tar.xz

Because of that there is no need anymore to have a separate `cargo`
field in src/stage0.txt, as the Cargo version will always be the same as
the rustc version. This PR removes the field, simplifying the code and
the maintenance work required while producing releases.
2020-11-17 09:14:02 -05:00
Josh Stone 5f08568042 x.py: allow a custom string appended to the version
This adds `rust.description` to the config as a descriptive string to be
appended to `rustc --version` output, which is also used in places like
debuginfo `DW_AT_producer`. This may be useful for supplementary build
information, like distro-specific package versions.

For example, in Fedora 33, `gcc --version` outputs:

    gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6)

With this change, we can add similar vendor info to `rustc --version`.
2020-11-16 14:08:21 -08:00
bors f4d014cee7 Auto merge of #79074 - Mark-Simulacrum:fix-ci-llvm, r=jyn514
Install CI llvm into the library directory

In other words, my concern in https://github.com/rust-lang/rust/issues/78932#issuecomment-725781767 was perfectly justified by something we were already doing. For now just special case CI LLVM, but in the future we may want a more general fix.

Fixes #79071.

r? `@alexcrichton`
2020-11-16 00:40:04 +00:00
Mark Rousskov 4feaa35f39 Install CI llvm into the library directory 2020-11-15 08:59:53 -05:00
Jonas Schievink c8ac745040
Rollup merge of #79059 - jyn514:cranelift, r=Mark-Simulacrum
Print 'checking cranelift artifacts' to easily separate it from other artifacts

Before:

```
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking rustdoc v0.0.0 (/home/joshua/rustc/src/librustdoc)
    Checking rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc)
    Finished release [optimized] target(s) in 2.08s
    Checking regalloc v0.0.31
    Checking gimli v0.22.0
    Checking object v0.21.1
    Checking cranelift-codegen v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-module v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-native v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-frontend v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-object v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-simplejit v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking rustc_codegen_cranelift v0.1.0 (/home/joshua/rustc/compiler/rustc_codegen_cranelift)
    Finished release [optimized] target(s) in 10.55s

```

After:

```
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking rustdoc v0.0.0 (/home/joshua/rustc/src/librustdoc)
    Checking rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc)
    Finished release [optimized] target(s) in 2.08s
Checking cranelift artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking cranelift-codegen v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
```

r? `@bjorn3`
`@bors` delegate=bjorn3
2020-11-15 13:40:05 +01:00
Jonas Schievink e0c378a673
Rollup merge of #79004 - jyn514:bacon, r=Mark-Simulacrum
Add `--color` support to bootstrap

When running under external utilities which wrap x.py, it can be convenient to force color support on.
2020-11-15 13:39:45 +01:00
Dylan DPC e3d52b8051
Rollup merge of #78986 - Mark-Simulacrum:fix-llvm, r=alexcrichton
Avoid installing external LLVM dylibs

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.

Fixes #78932.
2020-11-15 03:02:55 +01:00
Dylan DPC 3fe2abafe5
Rollup merge of #78968 - zec:add-llvm-as, r=Mark-Simulacrum
Include llvm-as in llvm-tools-preview component

Including `llvm-as` adds the ability to include assembly language fragments that can be inlined using LTO while making sure the correct version of LLVM is always used.
2020-11-15 03:02:49 +01:00
Joshua Nelson 6900dcbc03 Print 'checking cranelift artifacts' to easily separate it from other artifacts
Before:

```
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking rustdoc v0.0.0 (/home/joshua/rustc/src/librustdoc)
    Checking rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc)
    Finished release [optimized] target(s) in 2.08s
    Checking regalloc v0.0.31
    Checking gimli v0.22.0
    Checking object v0.21.1
    Checking cranelift-codegen v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-module v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-native v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-frontend v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-object v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking cranelift-simplejit v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
    Checking rustc_codegen_cranelift v0.1.0 (/home/joshua/rustc/compiler/rustc_codegen_cranelift)
    Finished release [optimized] target(s) in 10.55s

```

After:

```
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking rustdoc v0.0.0 (/home/joshua/rustc/src/librustdoc)
    Checking rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc)
    Finished release [optimized] target(s) in 2.08s
Checking cranelift artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Checking cranelift-codegen v0.67.0 (https://github.com/bytecodealliance/wasmtime/?branch=main#44cbdece)
```
2020-11-14 17:37:37 -05:00
Joshua Nelson 31741aad39 Add `--color` support to bootstrap
This allows using bootstrap with https://github.com/Canop/bacon.
2020-11-12 16:31:21 -05:00
Mark Rousskov 3747df71fa Avoid installing external LLVM dylibs
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-11-12 09:49:45 -05:00
DevJPM 6830f1c6e2 Bump the minimal supported LLVM version in the bootstrapping code to 9.0 2020-11-12 14:39:47 +01:00
Zachary Catlin e4a43fce3b Merge changes from rust-lang/rust 2020-11-11 21:17:45 -05:00
Zachary Catlin 562d50eb7b Include llvm-as in llvm-tools-preview component
Including llvm-as adds the ability to include assembly language fragments
that can be inlined using LTO.
2020-11-11 21:10:31 -05:00
Jonas Schievink 61c0a2c4ac
Rollup merge of #78947 - dalance:llvm_cov, r=Mark-Simulacrum
Ship llvm-cov through llvm-tools

`llvm-cov` is used to generate coverage report with LLVM InstrProf-based code coverage #34701.
So if `llvm-cov` is shipped through llvm-tools, users can try it easily accorging to the instruction of [The Rust Unstable Book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/source-based-code-coverage.html).
2020-11-11 20:59:14 +01:00
Jonas Schievink 194b96852f
Rollup merge of #78354 - 12101111:rustbuild_profiler, r=Mark-Simulacrum
Support enable/disable sanitizers/profiler per target

This PR add options under `[target.*]` of `config.toml` which can enable or disable sanitizers/profiler runtime for corresponding target.
If these options are empty, the global options under `[build]` will take effect.

Fix #78329
2020-11-11 20:58:56 +01:00
bors 7afc517230 Auto merge of #78790 - Gankra:rust-src-vendor, r=Mark-Simulacrum
Vendor libtest's dependencies in the rust-src component

This is the Rust side of https://github.com/rust-lang/wg-cargo-std-aware/issues/23

Note that this won't produce a useful result for `cargo -Zbuild-std` if there are multiple versions of a crate vendored, but will otherwise produce a valid vendor dir.

See https://github.com/rust-lang/cargo/pull/8834 for the other half of this change.
2020-11-11 16:24:43 +00:00
dalance 2453ce717a Ship llvm-cov through llvm-tools 2020-11-12 00:03:09 +09:00
Dylan DPC 7ac079f047
Rollup merge of #78566 - JRF63:polly, r=Mark-Simulacrum
Enable LLVM Polly via llvm-args.

I think doing it this way is better than in #51061. Polly has other useful options and we probably don't want to create a `-Z` flag for each one of them.

![results](https://user-images.githubusercontent.com/7283601/97695555-338f7180-1adf-11eb-82bd-5130e0e6fa89.png)

[Benchmark](https://gist.github.com/JRF63/9a6268b91720958e90dbe7abffe20298)

I noticed that `-lto` seems to interfere with polly in this specific microbenchmark, as enabling it causes the perf to drop to that of non-polly builds.

Other related PRs: #75615
2020-11-09 19:06:51 +01:00
Dylan DPC 62d3a4f9c2
Rollup merge of #78513 - jyn514:rustup-toolchain, r=Mark-Simulacrum
Infer the default host target from the host toolchain if possible

- `beta-x86_64-unknown-linux-gnu` has beta stripped
- `rustc2` is ignored

This fixes ongoing issues where x.py will detect the wrong host triple
between MSVC and GNU.

I don't think this will break anyone's workflow - I'd be very surprised if you a) had no `[build]` section in `config.toml`, b) had rustc installed, and c) expected the default target to be something other than the default target used by `rustc`. But I could be wrong - I'm happy to hear user stories :)

Fixes https://github.com/rust-lang/rust/issues/78150.

r? ``@Mark-Simulacrum``
cc ``@Lokathor``
2020-11-09 19:06:49 +01:00
Alexis Beingessner ceba2befb4 Vendor libtest's dependencies in the rust-src component
This is the Rust side of https://github.com/rust-lang/wg-cargo-std-aware/issues/23
2020-11-09 11:20:12 -05:00
bors 25f6938da4 Auto merge of #78201 - joshtriplett:rustc-tls-model, r=Mark-Simulacrum
Compile rustc crates with the initial-exec TLS model

This should produce more efficient code, with fewer calls to
__tls_get_addr. The tradeoff is that libraries using it won't work with
dlopen, but that shouldn't be a problem for rustc's internal libraries.
2020-11-09 11:08:07 +00:00
Mara Bos cb90042049
Rollup merge of #78842 - shepmaster:bootstrap-rustfmt, r=Mark-Simulacrum
Honor the rustfmt setting in config.toml

Prior to this, setting the rustfmt configuration was ignored:

```
% mkdir example

% cd example

% ../configure --set build.rustfmt=/usr/bin/true

% ../x.py fmt
./x.py fmt is not supported on this channel
failed to run: /Users/shep/Projects/rust/example/build/bootstrap/debug/bootstrap fmt
Build completed unsuccessfully in 0:00:01
```

And after:

```
% ../x.py fmt
Build completed successfully in 0:00:11
```

r? `@Mark-Simulacrum`
2020-11-08 13:36:25 +01:00
Mara Bos a619e25398
Rollup merge of #78706 - bjorn3:fix_run_make_without_llvm, r=Mark-Simulacrum
Fix run-make tests running when LLVM is disabled

The `--cc`, `--cxx`, `--cflags` and `--ar` flags were only passed to compiletest when `builder.config.llvm_enabled()` returned true. This is preventing me from running the tests on cg_clif.
2020-11-08 13:36:12 +01:00
Jake Goulding 8cae2f167c Honor the rustfmt setting in config.toml
Prior to this, setting the rustfmt configuration was ignored:

```
% mkdir example

% cd example

% ../configure --set build.rustfmt=/usr/bin/true

% ../x.py fmt
./x.py fmt is not supported on this channel
failed to run: /Users/shep/Projects/rust/example/build/bootstrap/debug/bootstrap fmt
Build completed unsuccessfully in 0:00:01
```

And after:

```
% ../x.py fmt
Build completed successfully in 0:00:11
```
2020-11-07 13:36:42 -05:00
Josh Triplett 0328e69287 Compile tools and internal libraries with the initial-exec TLS model
This should produce more efficient code, with fewer calls to
__tls_get_addr. The tradeoff is that libraries using it won't work with
dlopen, but that shouldn't be a problem for tools or for our own
internal libraries.

Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
2020-11-06 15:07:05 -08:00
Yuki Okushi 3f5723c6c5
Rollup merge of #78705 - Mark-Simulacrum:nicer-failure-compiletest, r=jyn514
Print a summary of which test suite failed

Especially on CI, where cross-compiling is common and single builder may end up
with multiple hosts and multiple targets, it can be annoying to scroll back to
the nearest start of test marker. This prints out a summary of the test suite
being run directly in compiletest.

For example, on a mir-opt failure, this would show something like this:

```
failures:
    [mir-opt] mir-opt/while-storage.rs

test result: FAILED. 140 passed; 1 failed; 2 ignored; 0 measured; 0 filtered out

Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
```

Fixes #78517
2020-11-07 01:02:16 +09:00
Yuki Okushi 8ca753108c
Rollup merge of #78514 - jyn514:setup-number, r=Mark-Simulacrum
Allow using 1/2/3/4 for `x.py setup` options

This undocumented feature allows you to typo 'a' as '1'.

r? ```@Mark-Simulacrum```
cc ```@Lokathor```
2020-11-07 01:02:07 +09:00
bors dc06a36074 Auto merge of #77351 - jyn514:clippy-sysroot, r=Mark-Simulacrum
Fix `x.py clippy`

I don't think this ever worked.

Fixes https://github.com/rust-lang/rust/issues/77309. `--fix` support is a work in progress, but works for a very small subset of `libtest`.

This works by using the host `cargo-clippy` driver; it does not use `stage0.txt` at all. To mitigate confusion from this, it gives an error if you don't have `rustc +nightly` as the default rustc in `$PATH`. Additionally, it means that bootstrap can't set `RUSTC`; this makes it no longer possible for clippy to detect the sysroot itself. Instead, bootstrap passes the sysroot to cargo.

r? `@ghost`
2020-11-06 11:31:18 +00:00
Joshua Nelson 8d2fa72fc8 Get `--fix` working for everything except rustdoc
Here's the error for rustdoc:

```
Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
error: no library targets found in package `rustdoc-tool`
```
2020-11-05 18:06:09 -05:00
Joshua Nelson 3863dee159 Infer the default host target from the host toolchain if possible
This fixes ongoing issues where x.py will detect the wrong host triple
between MSVC and GNU.

- Add line to changelog
2020-11-05 17:44:22 -05:00
Guillaume Gomez 99200f760b Fix even more URLs 2020-11-05 20:11:29 +01:00
bors f2bbdd0a32 Auto merge of #78740 - pietroalbini:no-more-legacy, r=Mark-Simulacrum
Remove legacy promote-release support from build-manifestg

Now that we're not running the [legacy `promote-release`](https://github.com/rust-lang/rust-central-station/tree/master/promote-release) anymore, this PR removes support from it from `bootstrap` and `build-manifest`.

r? `@Mark-Simulacrum`
2020-11-04 20:02:08 +00:00
Mara Bos a65507b47d
Rollup merge of #78709 - ehuss:fix-in_tree_crates-non-member, r=Mark-Simulacrum
Fix panic in bootstrap for non-workspace path dependencies.

If you add a `path` dependency to a `Cargo.toml` that is located outside of the workspace, then the `in_tree_crates` function can panic because it finds a path dependency that is not defined (since it uses `cargo metadata --no-deps`).  This fixes it by skipping over those entries, which are usually not things you select on the command-line.

Fixes #78617
2020-11-03 19:32:44 +01:00
Mara Bos 8a1f9e09a1
Rollup merge of #78687 - jyn514:bootstrap-help, r=Mark-Simulacrum
Suggest library/std when running all stage 0 tests

r? ``@Mark-Simulacrum``
cc ``@ijackson``

For context, this came out of a discord conversation where ``@ijackson`` was running `test --stage 1` when they were only adding doc-tests to the standard library.
2020-11-03 19:32:40 +01:00
Eric Huss 2172adbd5c Fix panic in bootstrap for non-workspace path dependencies. 2020-11-03 09:54:11 -08:00
Mark Rousskov f289a87628 Print a summary of which test suite failed
Especially on CI, where cross-compiling is common and single builder may end up
with multiple hosts and multiple targets, it can be annoying to scroll back to
the nearest start of test marker. This prints out a summary of the test suite
being run directly in compiletest.
2020-11-03 11:03:30 -05:00
bjorn3 39103ced58 Fix run-make tests running when LLVM is disabled 2020-11-03 16:55:33 +01:00
Pietro Albini 7704d35acc
build-manifest: remove legacy promote-release support
This commit removes support for the legacy promote-release, as that's
not executed anymore on the nightly channel.
2020-11-03 12:15:06 +01:00
Joshua Nelson 1aedcd33f5 Suggest library/std when running all stage 0 tests 2020-11-02 17:35:52 -05:00
Joseph Rafael Ferrer 301bb123f4 Enable LLVM Polly via llvm-args. 2020-10-30 18:23:02 +08:00
Joshua Nelson 8cf7d66d0a Create config.toml in the current directory, not the top-level directory
See https://github.com/rust-lang/rust/issues/78509 for discussion.
2020-10-29 21:23:55 -04:00
Joshua Nelson 1e737249af Allow using 1/2/3/4 for `x.py setup` options
This undocumented feature allows you to typo 'a' as '1'.
2020-10-28 23:40:40 -04:00
Yuki Okushi 2c307fab49
Rollup merge of #77703 - Keruspe:system-libunwind, r=Mark-Simulacrum
add system-llvm-libunwind config option

allows using the system-wide llvm-libunwind as the unwinder

Workaround for #76020
2020-10-27 08:44:44 +09:00
Joshua Nelson 31ecd2a124 Allow using clippy with either beta or nightly
Not 100% sure this will _always_ work, but it works currently.
2020-10-26 19:00:16 -04:00
Joshua Nelson bdbb54297a x.py fmt 2020-10-26 19:00:15 -04:00
Joshua Nelson 51f8076403 Add --fix support to `x.py clippy` 2020-10-26 18:58:52 -04:00
Joshua Nelson b3246e0cb1 Set the proper sysroot for clippy
Clippy does its own runtime detection of the sysroot, which was
incorrect in this case (it used the beta sysroot). This overrides the
sysroot to use `stage0-sysroot` instead.

- Get `x.py clippy` to work on nightly
- Give a nice error message if nightly clippy isn't installed
2020-10-26 18:56:55 -04:00
bors 35debd4c11 Auto merge of #77975 - bjorn3:cg_clif_subtree3, r=Mark-Simulacrum
Add cg_clif as optional codegen backend

Rustc_codegen_cranelift is an alternative codegen backend for rustc based on Cranelift. It has the potential to improve compilation times in debug mode. In my experience the compile time improvements over debug mode LLVM for a clean build are about 20-30% in most cases.

This PR adds cg_clif as optional codegen backend. By default it is only enabled for `./x.py check`. It can be enabled for `./x.py build` too by adding `cranelift` to the `rust.codegen-backends` array in `config.toml`.

MCP: https://github.com/rust-lang/compiler-team/issues/270

r? `@Mark-Simulacrum`
2020-10-26 16:31:38 +00:00
bjorn3 cf798c1ec6 Add support for using cg_clif to bootstrap rustc 2020-10-26 09:52:59 +01:00
12101111 b989d46b48 Support enable/disable sanitizers/profiler per target 2020-10-26 10:34:07 +08:00
bors 0dce3f606e Auto merge of #77901 - jonas-schievink:unignore-test-36710, r=Mark-Simulacrum
Unignore test for #36710 on MUSL

This now works fine thanks to autodetected `-C link-self-contained`.

Closes #36710
2020-10-25 16:37:01 +00:00
Nelson J Morais c3cbaf64d3 x.py test --test-args flag description enhancement 2020-10-23 20:06:37 +01:00
Yuki Okushi 025481a5eb
Rollup merge of #78153 - est31:downloaded_llvm_maybe_sync, r=Mark-Simulacrum
Sync LLVM submodule if it has been initialized

Since having enabled the download-ci-llvm option,
and having rebased on top of #76864,
I've noticed that I had to update the llvm-project
submodule manually if it was checked out.
Orignally, the submodule update logic was
introduced to reduce the friction for contributors
to manage the submodules, or in other words, to prevent
getting PRs that have unwanted submodule rollbacks
because the contributors didn't run git submodule update.

This commit adds logic to ensure there is no inadvertent
LLVM submodule rollback in a PR if download-ci-llvm
(or llvm-config) is enabled. It will detect whether the
llvm-project submodule is initialized, and if so, update
it in any case. If it is not initialized, behaviour is
kept to not do any update/initialization.

An alternative to the chosen implementation would
be to not pass the --init command line arg to
`git submodule update` for the src/llvm-project
submodule. This would show a confusing error message
however on all builds with an uninitialized repo.
We could pass the --silent param, but we still want
it to print something if it is initialized and has
to update something.
So we just do a manual check for whether the
submodule is initialized.
2020-10-23 18:26:32 +09:00
bors 8f0fa9d51f Auto merge of #78131 - SimonSapin:ar, r=Mark-Simulacrum
Package more llvm-* tools in the rust-dev component, for run-make-fulldeps tests

Fixes https://github.com/rust-lang/rust/issues/78110
2020-10-22 04:40:06 +00:00
Yuki Okushi 004a3aa49b
Rollup merge of #78009 - nielx:fix/CMAKE_SYSTEM_NAME, r=Mark-Simulacrum
Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling

This resolves issues where the cross-build of LLVM fails because it tries to
link to the host's system libraries instead of the target's system libraries.
2020-10-22 09:45:35 +09:00
Marc-Antoine Perennou 66fa42a946 allow using the system-wide llvm-libunwind as the unwinder
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-10-21 14:45:58 +02:00
est31 5948e62f34 Sync LLVM submodule if it has been initialized
Since having enabled the download-ci-llvm option,
and having rebased on top of f05b47ccdf,
I've noticed that I had to update the llvm-project
submodule manually if it was checked out.
Orignally, the submodule update logic was
introduced to reduce the friction for contributors
to manage the submodules, or in other words, to prevent
getting PRs that have unwanted submodule rollbacks
because the contributors didn't run git submodule update.

This commit adds logic to ensure there is no inadvertent
LLVM submodule rollback in a PR if download-ci-llvm
(or llvm-config) is enabled. It will detect whether the
llvm-project submodule is initialized, and if so, update
it in any case. If it is not initialized, behaviour is
kept to not do any update/initialization.

An alternative to the chosen implementation would
be to not pass the --init command line arg to
`git submodule update` for the src/llvm-project
submodule. This would show a confusing error message
however on all builds with an uninitialized repo.
We could pass the --silent param, but we still want
it to print something if it is initialized and has
to update something.
So we just do a manual check for whether the
submodule is initialized.
2020-10-20 20:21:17 +02:00
Simon Sapin 99f99ca7ab Make users of `download-ci-llvm` download a new version 2020-10-20 20:07:58 +02:00
Simon Sapin bc3dbc62d6 Package more llvm-* tools in the rust-dev component, for run-make-fulldeps tests
Fixes https://github.com/rust-lang/rust/issues/78110
2020-10-20 11:31:28 +02:00
Yuki Okushi 24907f3507
Rollup merge of #77778 - jyn514:git-hook, r=mark-simulacrum
[x.py setup] Allow setting up git hooks from other worktrees

Closes https://github.com/rust-lang/rust/issues/77684
r? @caass
2020-10-20 12:11:00 +09:00
Jonas Schievink 77a7ccf869 bootstrap: configure native toolchain for run-make
This allows moving a lot of run-make-fulldeps tests to just run-make
tests, and allows running those on target-only platforms
2020-10-19 16:37:04 +02:00
Jonas Schievink 0558e6eb93 bootstrap: fall back to auto-detected CXX
This allows us to use the C++ compiler configured via
`CXX_target_triple` env vars
2020-10-19 16:37:04 +02:00
Camelid 6716c8320f bootstrap: Print units for "finished in xxx" message
It now says "finished in xxx seconds".

Also slightly improved some wording in the README.
2020-10-18 13:55:35 -07:00
Yuki Okushi 83ee319822
Rollup merge of #76607 - Mark-Simulacrum:tidy-bins, r=pnkfelix
Modify executable checking to be more universal

This uses a dummy file to check if the filesystem being used supports the executable bit in general.

Supersedes #74753.
2020-10-18 04:11:05 +09:00
Niels Sascha Reedijk 7b652d341e Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling
This resolves issues where the cross-build of LLVM fails because it tries to
link to the host's system libraries instead of the target's system libraries.
2020-10-16 08:32:41 +01:00
bors 19e1aac6ea Auto merge of #77756 - alarsyo:setup-llvm-detect, r=jyn514
Detect configuration for LLVM during setup

This is a first draft to address #77579, setting `download-ci-llvm` to true on Linux, but I could also implement the `if-available` setting mentioned in the issue.

On other platforms I was thinking about using [the which crate](https://crates.io/crates/which), if adding a dependency on it is considered okay of course, to detect the presence of `llvm-config` in the path, and use it if found. Still a work in progress of course.
2020-10-15 02:10:11 +00:00
Ian Jackson 636728e394 x.py setup: Avoid infinite loop if stdin is /dev/null
EOF is not an error; it just causes read_line to produce "".

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14 11:40:53 +01:00
Ian Jackson e9058571ce x.py setup: Fix handling of wrong interactive input
We need a fresh input buffer each time, or we reuse the previous
data (since `read_line` appends).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14 11:40:53 +01:00
Ian Jackson 6e9e040bf8 x.py: setup: Offer keywords in interactive prompt
We understand these profile names because we use .to_str().
Mention them in the question.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14 11:40:53 +01:00
Ian Jackson b7c6041df1 x.py: setup: Provide a description of what it does
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-14 11:40:53 +01:00
Ian Jackson c4c5653a48 x.py: setup: Refactor to centralise list of profiles
Put all()'s otuput in the order we want to print things in, and add a
comment about why they are in this order.  Provide purpose() and
all_for_help().  Use these things everywhere.

Move all the abbrev character ("a", "b", etc.) processing into
interactive_path.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-14 11:40:53 +01:00
Dylan DPC 31799bade5
Rollup merge of #77829 - gburgessiv:unused-features-var, r=alexcrichton
bootstrap: only use compiler-builtins-c if they exist

The assignment of `features` above was added in rust-lang#60981, but
never used. Presumably the intent was to replace the string literal here
with it.

While I'm in the area, `compiler_builtins_c_feature` doesn't need to be
a `String`.

I'm not entirely sure of a great way to locally test this -- `./x.py test`
passed on my machine, but 🤷‍♂️.

r? @alexcrichton
2020-10-14 02:30:44 +02:00
Yuki Okushi b4a3b5617f
Rollup merge of #77909 - pietroalbini:fix-build-manifest-path, r=Mark-Simulacrum
bootstrap: set correct path for the build-manifest binary

This changes the path of the binary inside the tarball to be:

```
build-manifest-{release}-{target}/build-manifest/bin/build-manifest
```

...instead of:

```
build-manifest-{release}-{target}/build-manifest/bin/build-manifest/build-manifest
```

r? @Mark-Simulacrum
2020-10-14 06:02:41 +09:00
Yuki Okushi c82478719b
Rollup merge of #77868 - Aaron1011:llvm-tools-opt-llc, r=Mark-Simulacrum
Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component

Fixes #55890

It's useful to have `llc` and `opt` available when debugging an LLVM
miscompilation,.
2020-10-14 06:02:31 +09:00
Yuki Okushi ec0cabd0fe
Rollup merge of #77786 - jyn514:rustdoc, r=Mark-Simulacrum
Mention rustdoc in `x.py setup`

This lets new contributors know which option they should pick; previously it wasn't clear 'compiler' also included rustdoc.

Unresolved questions: should this say 'compiler and tools' instead? I don't know of any tools that are modified in-tree other than rustdoc, though.

r? @Mark-Simulacrum
2020-10-14 06:02:27 +09:00
Yuki Okushi fe7e794b6a
Rollup merge of #77776 - jyn514:wrong-way, r=Mark-Simulacrum
Give an error when running `x.py test --stage 0 src/test/ui`

The error can be overridden with `COMPILETEST_FORCE_STAGE0=1`. In practice I don't know why anyone would do this.

r? @Mark-Simulacrum

Closes https://github.com/rust-lang/rust/issues/77711
2020-10-14 06:02:25 +09:00
Pietro Albini 6091538105
bootstrap: set correct path for the build-manifest binary 2020-10-13 20:37:38 +02:00
Antoine Martin b8ae4c5e36 Handle included config in bootstrap.py 2020-10-13 18:08:02 +02:00
Antoine Martin ab614b0f01 Implement "if-available" option for download-ci-llvm 2020-10-13 18:00:25 +02:00
Joshua Nelson b7080e6fd4 Give an error when running `x.py test --stage 0 src/test/ui` 2020-10-13 10:33:32 -04:00
bors d772879df3 Auto merge of #77762 - pietroalbini:dist-build-manifest, r=Mark-Simulacrum
Dist build manifest

This PR makes two changes that should remove a significant chunk of the time spent in our release process: cloning the `rust-lang/rust` monorepo, all its submodules, and building `bootstrap` to then invoke `build-manifest`:

* `build-manifest` doesn't rely on a clone of the monorepo being present anymore. The only remaining bit of information it fetched from it (the Rust version) is instead bundled in the binary.
* A new "component" is added, `build-manifest`. That component includes a prebuilt version of the tool, and it's *not* included in the Rustup manifest. This will allow `promote-release` to directly invoke the tool without interacting with our build system.
* The Linux x86_64 CI is changed to also build the component mentioned above. It's the only CI builder tasked to do so, and to cleanly support this a new `--include-default-paths` flag was added to `./x.py`.
* The `BUILD_MANIFEST_NUM_THREADS` environment variable is added to configure the number of threads at runtime.

This PR is best reviewed commit-by-commit.
r? `@Mark-Simulacrum`
2020-10-13 12:11:47 +00:00
Aaron Hill c16c8acae1
Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component
Fixes #55890

It's useful to have `llc` and `opt` available when debugging an LLVM
miscompilation,.
2020-10-12 17:05:48 -04:00
Yuki Okushi 93ec29b0cb
Rollup merge of #77852 - 12101111:fix-bootstrap-doc, r=jonas-schievink
update url in bootstrap README (gcc-rs -> cc-rs)

gcc-rs is renamed to cc-rs 3 years ago.
2020-10-13 04:08:05 +09:00
Yuki Okushi dde997710a
Rollup merge of #77746 - winnayx:issue-77572-fix, r=jyn514
Fix `x.py setup` sets `changelog-seen`

Fixes #77572 by setting changelog-seen in setup.rs
2020-10-13 04:07:56 +09:00
Pietro Albini 0b7ee9d522
build-manifest: bundle the rustc version in the binary 2020-10-12 19:54:40 +02:00
Pietro Albini 60ae018bf1
bootstrap: add --include-default-paths to ./x.py 2020-10-12 19:53:25 +02:00
Pietro Albini 2f387e9d11
bootstrap: add disabled by default build-manifest dist component 2020-10-12 19:53:24 +02:00
Pietro Albini 25cc75c924
build-manifest: accept the Rust version instead of the monorepo path
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-12 19:53:22 +02:00
12101111 5d44402345 update url in bootstrap README 2020-10-12 21:17:11 +08:00
Winnie Xiao d7494af551 Mostly print statements to see where things are
More print statementsstatements lol

Solved the basic case of eliminating check_version ifk_version if subcommand = setup

Finished v1

checking out old bootstrap.py

checked out old irrelevant files

fixed tidy

Moved VERSION from bin/main.rs to lib.rs

Fixed semicolon return issue

x.py fmt
2020-10-11 22:32:06 +02:00
George Burgess IV ca5478a5df bootstrap: only use compiler-builtins-c if they exist
The assignment of `features` above was added in rust-lang#60981, but
never used. Presumably the intent was to replace the string literal here
with it.

While I'm in the area, `compiler_builtins_c_feature` doesn't need to be
a `String`.
2020-10-11 12:36:13 -07:00
Joshua Nelson 23c3356f9a Mention rustdoc in `x.py setup`
This also allows 'rustdoc' as a string for the compiler profile.
2020-10-10 10:27:11 -04:00
Joshua Nelson bd13567481 Allow setting up git hooks from other worktrees 2020-10-10 00:03:55 -04:00
Pietro Albini 8d2b15943b
bootstrap: always use the Rust version in package names
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-09 15:21:45 +02:00
bors 9c07010b7f Auto merge of #77631 - jyn514:helpful-changelog, r=RalfJung
Make src/bootstrap/CHANGELOG.md more helpful

Addresses fe6fc555ac (r42949241).

r? `@RalfJung`
cc `@Mark-Simulacrum`
2020-10-08 05:50:49 +00:00
Joshua Nelson 2a41342e9c Make src/bootstrap/CHANGELOG.md more helpful 2020-10-06 18:28:01 -04:00
Dylan DPC f600154be6
Rollup merge of #77624 - akoptelov:c-all-targets-fix, r=jyn514
Add c as a shorthand check alternative for new options #77603

There is a missing "c" that is a shorthand for "check" in newly added match arm for handling check-specific options.
2020-10-07 00:16:16 +02:00
Dylan DPC 59707c5748
Rollup merge of #77400 - alarsyo:xpy-setup-suggestions, r=jyn514
Fix suggestions for x.py setup

#76631 introduced a new `setup` command to x.py

By default the command prompts for a profile to use:

```
Welcome to the Rust project! What do you want to do with x.py?
a) Contribute to the standard library
b) Contribute to the compiler
c) Contribute to the compiler, and also modify LLVM or codegen
d) Install Rust from source
```

and then displays command suggestions, depending on which profile was chosen. However [the mapping between chosen profile](9cba260df0/src/bootstrap/setup.rs (L75-L85)) and [suggestion](9cba260df0/src/bootstrap/setup.rs (L42-L47)) isn't exact, leading to suggestions not being shown if the user presses `c` or `d`. (because "c" is translated to "llvm" and "d" to "maintainer", but suggestions trigger for "codegen" and "user" respectively)

A more thorough refactor would stop using "strings-as-type" to make sure this kind of error doesn't happen, but it may be overkill for that kind of "script" program?

Tagging the setup command author: @jyn514
2020-10-07 00:16:01 +02:00
Alexander Koptelov db46f43977 Add c as a shorthand check alternative for new options #77603 2020-10-06 22:05:11 +03:00
bors 9fdaeb393a Auto merge of #76356 - caass:hooks, r=jyn514
Add a command to install a git hook to automatically run `x.py test tidy --bless`

Some folks (such as myself) would probably find a lot of convenience in a pre-commit hook that automatically runs tidy before committing, to avoid burning CI time learning that your commit wasn't tidy.

I'm absolutely positive I have missed some stuff. I basically just got this to where you can run `./x.py run install-git-hook` and then clicked the commit button. Please let me know what else you'd like me to add before this can be merged!

[rustc-dev-guide companion PR](https://github.com/rust-lang/rustc-dev-guide/pull/848)
2020-10-06 14:51:51 +00:00
Antoine Martin d67a7e6cfc Use String type for Profile parse error 2020-10-06 16:40:30 +02:00
Antoine Martin 3afc004845 Show available profiles on error 2020-10-06 16:40:30 +02:00
Antoine Martin d3d3397121 Use Profile enum for x.py setup 2020-10-06 16:40:30 +02:00
Antoine Martin 6e06388a7f Fix suggestions for x.py setup 2020-10-06 15:53:58 +02:00
Yuki Okushi 54d72d73e9
Rollup merge of #77558 - thomcc:defaults-toml-extension, r=jyn514
Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml}

This allows these files to have okay syntax highlighting in editors, and helps avoid nagging from editors which want to suggest that I install a plugin for `*.library` files to view the `config.toml.library` or whatever.

It's a very minor change.

r?@jyn514
2020-10-06 16:26:07 +09:00
Cassandra Fridkin 0845627f73
Make changes based on @jyn514's comments 2020-10-05 22:00:43 -04:00
Cassandra Fridkin d585c96eaf
Add install_git_hook_maybe to setup.rs 2020-10-05 20:22:11 -04:00
Cassandra Fridkin f53d436638
Remove the rust stuff and just make it a simple shell script
It's ok, now I'm writing enough Rust that i'm able to get my fix elsewhere
2020-10-05 18:59:47 -04:00
Cassandra Fridkin 44af74f6dd
Merge branch 'master' into hooks 2020-10-05 18:49:51 -04:00
Thom Chiovoloni 5388eb41e9 Add changelog entry mentioning the renamed profile files 2020-10-04 18:39:59 -07:00
Thom Chiovoloni afe83d4c1c Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml} 2020-10-04 18:35:16 -07:00
Dylan DPC fffeaa7b83
Rollup merge of #77407 - pietroalbini:less-build-manifest, r=Mark-Simulacrum
Improve build-manifest to work with the improved promote-release

This PR makes some changes to build-manifest to have it work better with the other improvements I'm making to [promote-release](https://github.com/rust-lang/promote-release).

A new way to invoke the tool was added: `./x.py run src/tools/build-manifest`. The new invocation disables the generation of `.sha256` files and the generation of GPG signatures, as those steps are not tied to the Rust version we're building the manifest of: handling them in `promote-release` will improve the maintenability of our release process. Invocations through the old command (`./x.py dist hash-and-sign`) are referred inside the source code as "legacy". The new invocation also enables internal parallelism, disabled on legacy to avoid overloading our old server.

Improvements were also made on how the checksums included in the manifest are generated:

* The manifest is first generated with placeholder checksums, and then a function walks through the manifes and calculates only the needed hashes. Before this PR, all the hashes were calculated beforehand, including the hashes of unused files.
* Calculating the hashes is now done in parallel with rayon, to better utilize all the available disk bandwidth.
* The `sha2` crate is now used instead of the `sha256sum` CLI tool: this avoids the overhead of calling another process, but more importantly enables hardware acceleration whenever available (the `sha256sum` CLI tool doesn't support it at all).

r? @Mark-Simulacrum
This PR is best reviewed commit-by-commit.
2020-10-05 02:29:33 +02:00
Yuki Okushi 69f2cf5ad9
Rollup merge of #77473 - Mark-Simulacrum:check-limited, r=ecstatic-morse
Make --all-targets in x.py check opt-in

In particular due to #76822, making this the default is currently suboptimal.

r? @ecstatic-morse
2020-10-04 11:45:10 +09:00
ecstatic-morse eaa0186662
Add quotes around command in CHANGELOG 2020-10-03 09:29:50 -07:00
Mark Rousskov f2961638c8 Place all-targets checking behind a flag
This matches Cargo behavior and avoids the (somewhat expensive) double checking,
as well as the unfortunate duplicate error messages (#76822,
rust-lang/cargo#5128).
2020-10-03 09:53:13 -04:00
bors 6f56fbdc1c Auto merge of #77347 - jyn514:dox, r=Amanieu
Remove --cfg dox from rustdoc.rs

This was added in https://github.com/rust-lang/rust/pull/53076 because
several dependencies were using `cfg(dox)` instead of `cfg(rustdoc)` (now `cfg(doc)`).
I ran `rg 'cfg\(dox\)'` on the source tree with no matches, so I think
this is now safe to remove.

r? `@Mark-Simulacrum`
cc `@QuietMisdreavus` :)
2020-10-03 07:23:02 +00:00
bors d92d28e523 Auto merge of #77298 - jyn514:bootstrap-config, r=Mark-Simulacrum
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-30 15:03:09 +00:00
Pietro Albini d4928ad7fd
build-manifest: keep legacy behavior when invoking through ./x.py dist 2020-09-30 14:29:02 +02:00
Pietro Albini e05e2f9a94
bootstrap: add ./x.py run src/tools/build-manifest 2020-09-30 13:54:12 +02:00
bors 0d9afb6717 Auto merge of #77133 - tmandry:bootstrap-host, r=Mark-Simulacrum
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-30 00:59:12 +00:00
Tyler Mandry bf7aeaa617 Filter out empty items in bootstrap:🎏:split 2020-09-29 22:50:57 +00:00
Joshua Nelson 351f850d33 Remove unused --cfg stageN 2020-09-29 18:25:52 -04:00
Joshua Nelson 6533c29bea Remove --cfg dox from rustdoc.rs
This was added in https://github.com/rust-lang/rust/pull/53076 because
several dependencies were using `cfg(dox)` instead of `cfg(rustdoc)`.
I ran `rg 'cfg\(dox\)'` on the source tree with no matches, so I think
this is now safe to remove.
2020-09-29 18:00:19 -04:00
bors 9b77a6a200 Auto merge of #77145 - pietroalbini:refactor-build-manifest-versions, 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-29 16:41:53 +00:00
Tyler Mandry 6bd57e3531 Bump bootstrap version and update changelog 2020-09-28 20:15:43 +00:00
Tyler Mandry 52ca5ca7b7 Remove skip_only_host_steps
And make tests explicitly list their hosts and targets.
2020-09-28 19:32:46 +00:00
Tyler Mandry e715c7f234 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.
2020-09-28 19:32:46 +00:00
Joshua Nelson d537067c97 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`.
2020-09-28 10:28:15 -04:00