Commit Graph

3112 Commits

Author SHA1 Message Date
Rune Tynan 728ffc8c03
Address review v2 2021-01-19 17:02:34 -05:00
Rune Tynan 7715656edd
Add jsondocck tool, and use it for rustdoc JSON 2021-01-19 14:24:25 -05:00
Mara Bos 92dbfb541a
Rollup merge of #81064 - Mark-Simulacrum:support-stage1-check, r=jyn514
Support non-stage0 check

Seems to work locally - a full stage 1 check succeeds, building std (because we can't get away with checking it), and then checking the compiler and other tools. This ran into the problem that a unconditional x.py check in stage 1 *both* checks and builds stage 1 std, and then has to clean up because for some reason the rmeta and rlib artifacts conflict (though I'm not actually entirely sure why, but it doesn't seem worth digging in in too much detail).

Ideally we wouldn't be building and checking like that but it's a minor worry as checking std is pretty fast and you can avoid it if you're aiming for speed by passing the compiler (e.g., compiler/rustc) explicitly.

r? ```@jyn514```
2021-01-17 12:24:53 +00:00
Mara Bos cfe2253bca
Rollup merge of #80932 - jyn514:download-windows-llvm, r=Mark-Simulacrum
Allow downloading LLVM on Windows and MacOS

- Don't ignore packaging `llvm/lib/` for `rust-dev` when LLVM is linked
statically
- Add `link-type.txt` so bootstrap knows whether llvm was linked
  statically or dynamically
- Don't assume CI LLVM is linked dynamically in `bootstrap::config`
- Fall back to dynamic linking if `link-type.txt` doesn't exist
- Fix existing bug that split the output of `llvm-config` on lines, not spaces
- Only special case MacOS when dynamic linking. Static linking works fine.
- Enable building LLVM tests

  This works around the following llvm bug:

  ```
  llvm-config: error: component libraries and shared library

  llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest.a
  llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest_main.a
  llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libLLVMTestingSupport.a
  thread 'main' panicked at 'command did not execute successfully: "/home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-config" "--libfiles"
  ```

  I'm not sure why llvm-config thinks these are required, but to avoid
  the error, this builds them anyway.

- Bump version of `download-ci-llvm-stamp`

  `src/llvm-project` hasn't changed, but the generated tarball has.

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

# Current Status

This works on both MacOS and Windows! 🎉 🎉 Thanks to ```@nagisa,``` ```@halkcyon,``` ```@Lokathor,``` ```@jryans,``` and ```@poliorcetics``` for helping me test!

The `if-available` check now supports all tier 1 platforms. Although only x64 apple and x64 msvc have been tested, none of the changes here are Windows or Mac specific, and I expect this to work anywhere that LLVM artifacts are uploaded to CI (i.e. the `rust-dev` component exists).

## Windows

Note that if you have an old version of MSVC build tools you'll need to update them. VS Build Tools 2019 14.28 and later are known to work. With old tools, you may see an error like the following:

```
error LNK2001: unresolved external symbol __imp___std_init_once_complete
```
2021-01-17 12:24:49 +00:00
Mara Bos 5b5aa102b9
Rollup merge of #80901 - jyn514:better-colors, r=Mark-Simulacrum
Make `x.py --color always` apply to logging too

Follow-up to https://github.com/rust-lang/rust/pull/78548, https://github.com/rust-lang/rust/pull/79004.

r? ```@Mark-Simulacrum```
2021-01-16 17:29:58 +00:00
Joshua Nelson 53989e449d Allow configuring the default stage for `x.py check` 2021-01-16 10:07:09 -05:00
Joshua Nelson c17ed34da1 Print which stage is being checked (now that it may not be stage0) 2021-01-16 10:07:09 -05:00
Mark Rousskov 8b702e02c0 Support non-stage0 check 2021-01-16 10:07:09 -05:00
Joshua Nelson 5c4adbe1e1 Add all tier 1 platforms to supported platforms for "if-available"
... and update the comment in `config.toml.example`
2021-01-15 22:08:47 -05:00
Joshua Nelson 6766070422 Allow downloading LLVM on Windows
- Don't ignore packaging `llvm/lib/` for `rust-dev` when LLVM is linked
statically
- Add `link-type.txt` so bootstrap knows whether llvm was linked
  statically or dynamically
- Don't assume CI LLVM is linked dynamically in `bootstrap::config`
- Fall back to dynamic linking if `link-type.txt` doesn't exist
- Fix existing bug that split the output of `llvm-config` on lines, not spaces
- Enable building LLVM tests

  This works around the following llvm bug:

  ```
  llvm-config: error: component libraries and shared library

  llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest.a
  llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libgtest_main.a
  llvm-config: error: missing: /home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/lib/libLLVMTestingSupport.a
  thread 'main' panicked at 'command did not execute successfully: "/home/joshua/rustc2/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-config" "--libfiles"
  ```

  I'm not sure why llvm-config thinks these are required, but to avoid
  the error, this builds them anyway.

- Temporarily set windows as the try builder. This should be reverted
  before merging.

- Bump version of `download-ci-llvm-stamp`

  `src/llvm-project` hasn't changed, but the generated tarball has.

- Only special case MacOS when dynamic linking. Static linking works fine.
- Store `link-type.txt` to the top-level of the tarball

  This allows writing the link type unconditionally. Previously, bootstrap
  had to keep track of whether the file IO *would* succeed (it would fail
  if `lib/` didn't exist), which was prone to bugs.

- Make `link-type.txt` required

  Anyone downloading this from CI should be using a version of bootstrap
  that matches the version of the uploaded artifacts. So a missing
  link-type indicates a bug in x.py.
2021-01-15 22:07:38 -05:00
Yuki Okushi 1d83f9828f
Rollup merge of #79997 - coolreader18:wasm-reactor, r=alexcrichton
Emit a reactor for cdylib target on wasi

Fixes #79199, and relevant to #73432

Implements wasi reactors, as described in WebAssembly/WASI#13 and [`design/application-abi.md`](https://github.com/WebAssembly/WASI/blob/master/design/application-abi.md)

Empty `lib.rs`, `lib.crate-type = ["cdylib"]`:

```shell
$ cargo +reactor build --release --target wasm32-wasi
   Compiling wasm-reactor v0.1.0 (/home/coolreader18/wasm-reactor)
    Finished release [optimized] target(s) in 0.08s
$ wasm-dis target/wasm32-wasi/release/wasm_reactor.wasm >reactor.wat
```
`reactor.wat`:
```wat
(module
 (type $none_=>_none (func))
 (type $i32_=>_none (func (param i32)))
 (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
 (import "wasi_snapshot_preview1" "fd_prestat_get" (func $__wasi_fd_prestat_get (param i32 i32) (result i32)))
 (import "wasi_snapshot_preview1" "fd_prestat_dir_name" (func $__wasi_fd_prestat_dir_name (param i32 i32 i32) (result i32)))
 (import "wasi_snapshot_preview1" "proc_exit" (func $__wasi_proc_exit (param i32)))
 (import "wasi_snapshot_preview1" "environ_sizes_get" (func $__wasi_environ_sizes_get (param i32 i32) (result i32)))
 (import "wasi_snapshot_preview1" "environ_get" (func $__wasi_environ_get (param i32 i32) (result i32)))
 (memory $0 17)
 (table $0 1 1 funcref)
 (global $global$0 (mut i32) (i32.const 1048576))
 (global $global$1 i32 (i32.const 1049096))
 (global $global$2 i32 (i32.const 1049096))
 (export "memory" (memory $0))
 (export "_initialize" (func $_initialize))
 (export "__data_end" (global $global$1))
 (export "__heap_base" (global $global$2))
 (func $__wasm_call_ctors
  (call $__wasilibc_initialize_environ_eagerly)
  (call $__wasilibc_populate_preopens)
 )
 (func $_initialize
  (call $__wasm_call_ctors)
 )
 (func $malloc (param $0 i32) (result i32)
  (call $dlmalloc
   (local.get $0)
  )
 )
 ;; lots of dlmalloc, memset/memcpy, & libpreopen code
)
```

I went with repurposing cdylib because I figured that it doesn't make much sense to have a wasi shared library that can't be initialized, and even if someone was using it adding an `_initialize` export is a very small change.
2021-01-12 07:58:59 +09:00
Joshua Nelson 04b60362f8 Make `--color always` apply to logging too 2021-01-10 23:42:44 -05:00
Yuki Okushi 4f43b77bb6
Rollup merge of #80820 - nagisa:nagisa/dcl-nixos, r=Mark-Simulacrum
Support `download-ci-llvm` on NixOS

In particular, the CI built `libLLVM-*.so` needs to have `libz.so`
RPATHed so that binaries like `llvm-config` work at all.
2021-01-10 16:56:02 +09:00
Simonas Kazlauskas 15ade4d504 Support `download-ci-llvm` on NixOS
In particular, the CI built `libLLVM-*.so` needs to have `libz.so`
RPATHed so that binaries like `llvm-config` work at all.
2021-01-09 18:29:25 +02:00
Noah 92d3537abb
Add wasi-exec-model cg option for emitting wasi reactors 2021-01-08 13:09:40 -06:00
Pietro Albini 2caf9bcb33
bootstrap: fix x.py install not working with relative prefix 2021-01-07 20:40:42 +01:00
bors f412fb56b8 Auto merge of #80708 - JohnTitor:rollup-6esk027, r=JohnTitor
Rollup of 12 pull requests

Successful merges:

 - #80442 (Mention Arc::make_mut and Rc::make_mut in the documentation of Cow)
 - #80533 (bootstrap: clippy fixes)
 - #80538 (Add check for `[T;N]`/`usize` mismatch in astconv)
 - #80612 (Remove reverted change from relnotes)
 - #80627 (Builder: Warn if test file does not exist)
 - #80637 (Use Option::filter instead of open-coding it)
 - #80643 (Move variable into the only branch where it is relevant)
 - #80656 (Fixed documentation error for `std::hint::spin_loop`)
 - #80666 (Fix missing link for "fully qualified syntax")
 - #80672 (./x.py clippy: allow the most noisy lints)
 - #80677 (doc -- list edit for consistency)
 - #80696 (make sure that promoteds which fail to evaluate in dead const code behave correctly)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-05 03:06:32 +00:00
Yuki Okushi cb433736da
Rollup merge of #80672 - matthiaskrgr:xpy_clippy_less_noise, r=Mark-Simulacrum
./x.py clippy: allow the most noisy lints

This silences the following clippy lints in ./x.py clippy:

many_single_char_names (there are a lot of warnings caused by stdarch)
collapsible_if (can reduce readability)
type_complexity
missing_safety_doc (there are almost 3K warnings issued)
too_many_arguments
needless_lifetimes (people want 'tcx lifetimes etc)
wrong_self_convention (warns about from_..(), to_..(), into_..().. fns that do or do not take self by reference.

Just for clarification; this only changes the output of `x.py clippy` inside the rustc repo and does not change anything about clippy or how `cargo clippy` is run on peoples crates.
2021-01-05 09:52:49 +09:00
Yuki Okushi 1c6593c473
Rollup merge of #80627 - bugadani:warn, r=Mark-Simulacrum
Builder: Warn if test file does not exist

Running `./x.py test` with a file that does not exists (but where the path belongs to a test suite) silently ignores the missing file and runs the whole test suite. This PR prints a warning to reduce the potential surprise factor.

Closes #80621
2021-01-05 09:52:40 +09:00
Yuki Okushi 4c4e8e70bb
Rollup merge of #80533 - matthiaskrgr:bootstrap_clppy, r=Mark-Simulacrum
bootstrap: clippy fixes

addresses:

clippy::or_fun_call
clippy::single_char_add_str
clippy::comparison_to_empty
clippy::or_fun_call
2021-01-05 09:52:35 +09:00
bors 9919ad6e9e Auto merge of #80426 - jyn514:bootstrap-caching, r=Mark-Simulacrum
Don't use `self.date` unconditionally for `program_out_of_date()`

This avoids unnecessary cache invalidations for programs not affected by
the stage0 version (which is everything except the stage0 compiler
itself).

The redundant invalidations weren't noticed until now because they only
showed up on stage0 bumps, at which point people are used to rebuilding
everything anyway. I noticed it in https://github.com/rust-lang/rust/pull/79540
because I wasn't adding `self.date` to the stamp file (because I didn't realize it was necessary). Rather than
adding self.date I thought it was better to remove it from the cache key.
2021-01-05 00:20:18 +00:00
Dániel Buga 6002e78392 Builder: Warn if test file does not exist 2021-01-04 16:09:59 +01:00
Matthias Krüger 6a4b24e4dd ./x.py clippy: allow the most noisy lints
This silences the following clippy lints in ./x.py clippy:

many_single_char_names (there are a lot of warnings caused by stdarch)
collapsible_if (can reduce readability)
type_complexity
missing_safety_doc (there are almost 3K warnings issued)
too_many_arguments
needless_lifetimes (people want 'tcx lifetimes etc)
wrong_self_convention (warns about from_..(), to_..(), into_..().. fns that do or do not take self by reference.
2021-01-04 02:26:50 +01:00
Mara Bos 4890c06fc4
Rollup merge of #80574 - jyn514:clean-bootstrap, r=Mark-Simulacrum
Clean bootstrap artifacts on `x.py clean`

Closes https://github.com/rust-lang/rust/issues/76519

r? `@Mark-Simulacrum`
2021-01-02 11:29:10 +00:00
bors 5986dd878f Auto merge of #79883 - frewsxcv:frewsxcv-san, r=shepmaster
Enable ASan, TSan, UBSan for aarch64-apple-darwin.

I confirmed ASan, TSan, UBSan all work for me locally with `clang` on my new Macbook Air.

~This requires https://github.com/rust-lang/llvm-project/pull/86~
2021-01-02 06:58:59 +00:00
Joshua Nelson b5019d6ec3 Give a better error for download-ci-llvm if .xz is not supported
Previously:

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

Now:

```
error: XZ support is required to download LLVM
help: consider disabling `download-ci-llvm` or using a different version of python
Build completed unsuccessfully in 0:00:00
```
2021-01-01 10:41:56 -05:00
Joshua Nelson 139ef750ee Clean bootstrap artifacts on `x.py clean` 2021-01-01 00:02:54 -05:00
Corey Farwell d482de30ea Merge remote-tracking branch 'origin/master' into frewsxcv-san 2020-12-31 23:27:33 -05:00
Dylan DPC 30c4e6da85
Rollup merge of #80532 - tmiasko:rm;, r=Mark-Simulacrum
remove unnecessary trailing semicolon from bootstrap
2020-12-31 22:20:56 +01:00
Pietro Albini 8e0ab0fb5e
bootstrap: use the correct paths during ./x.py install 2020-12-31 11:38:32 +01:00
Pietro Albini 1fab57491d
bootstrap: change the dist outputs to GeneratedTarball
The struct will allow to store more context on the generated tarballs.
2020-12-31 11:38:05 +01:00
Pietro Albini aac429ffd3
bootstrap: never delete the tarball temporary directory
Files in the temporary directory are used by ./x.py install.
2020-12-31 11:34:38 +01:00
bors f0073a59cf Auto merge of #80435 - pietroalbini:compression-formats, r=Mark-Simulacrum
Only produce .xz tarballs on CI

This PR adds a `./configure` option to choose which tarball compression formats to produce, and changes our CI configuration to only produce `.xz` tarballs. The release process will then recompress everything into `.gz` when producing a release.

This will drastically reduce our storage costs for CI artifacts, as we'd stop storing the same data twice. **Stable, beta and nightly releases will not be affected by this at all.**

Before landing this we'll need to increase the VM size of our release process, to recompress everything in a reasonable amount of time.
r? `@Mark-Simulacrum`
2020-12-31 00:23:13 +00:00
Matthias Krüger 87423fbc6a bootstrap: clippy fixes
addresses:

clippy::or_fun_call
clippy::single_char_add_str
clippy::comparison_to_empty
clippy::or_fun_call
2020-12-31 00:58:52 +01:00
bors 9775ffef2a Auto merge of #80530 - m-ou-se:rollup-zit69ko, r=m-ou-se
Rollup of 9 pull requests

Successful merges:

 - #78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength)
 - #79479 (Add `Iterator::intersperse`)
 - #80128 (Edit rustc_ast::ast::FieldPat docs)
 - #80424 (Don't give an error when creating a file for the first time)
 - #80458 (Some Promotion Refactoring)
 - #80488 (Do not create dangling &T in Weak<T>::drop)
 - #80491 (Miri: make size/align_of_val work for dangling raw ptrs)
 - #80495 (Rename kw::Invalid -> kw::Empty)
 - #80513 (Add regression test for #80062)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-12-30 21:25:15 +00:00
Mara Bos 1975142c97
Rollup merge of #80424 - jyn514:bootstrap-cleanup, r=Mark-Simulacrum
Don't give an error when creating a file for the first time

Previously, `os.remove` would always give a FileNotFound error the first
time you called it, causing bootstrap to make unnecessary copies. This
now only calls `remove()` if the file exists, avoiding the unnecessary
error.

This is a pretty small cleanup but I think it's useful. Taken from https://github.com/rust-lang/rust/pull/79540.
2020-12-30 20:56:51 +00:00
Pietro Albini 5526d90250
bootstrap: extract from any compression algorithm during distcheck 2020-12-30 16:20:23 +01:00
Mark Rousskov fe031180d0 Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
Yuki Okushi 7c57d51a9f
Rollup merge of #80461 - rust-lang:tmandry-patch-1, r=Mark-Simulacrum
Add llvm-libunwind change to bootstrap CHANGELOG

From #77703.

This doesn't need a `changelog-seen` version bump because the old values aren't accepted anymore, meaning anyone who was using this had to change it already.

r? ``@Mark-Simulacrum``
2020-12-30 18:15:14 +09:00
Tomasz Miąsko 83322c067e remove unnecessary trailing semicolon from bootstrap 2020-12-30 00:00:00 +00:00
Vadim Petrochenkov 4d2d0bad4e Remove `compile-fail` test suite 2020-12-29 23:39:56 +03:00
Pietro Albini 0a2034dca4
bootstrap: add the dist.compression-formats option
The option allows to add or remove compression formats used while
producing dist tarballs.
2020-12-29 11:56:25 +01:00
Tyler Mandry 8041ccff2c
Add llvm-libunwind change to bootstrap CHANGELOG
From #77703.
2020-12-28 15:57:53 -08:00
Dylan DPC a4a59a0f17
Rollup merge of #80434 - pietroalbini:tarball-temp-dir, r=Mark-Simulacrum
bootstrap: put the component name in the tarball temp dir path

This should not matter right now, but if we ever parallelize rustbuild this will avoid tarball contents being merged together.

r? `@Mark-Simulacrum`
2020-12-28 14:13:23 +01:00
Dylan DPC 18be436550
Rollup merge of #80362 - jyn514:rustc-macros, r=ehuss
Document rustc_macros on nightly-rustc

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

![image](https://user-images.githubusercontent.com/23638587/103113442-b7ba2d00-4628-11eb-8a4d-c542f2d170e1.png)
![image](https://user-images.githubusercontent.com/23638587/103113448-bc7ee100-4628-11eb-8657-2d72e88de656.png)

r? ``@ehuss``
2020-12-28 14:13:16 +01:00
Pietro Albini f994f1e884
bootstrap: put the component name in the tarball temp dir path
This should not matter right now, but if we ever parallelize rustbuild
this will avoid tarball contents being merged together.
2020-12-28 12:51:58 +01:00
bors aef92d44e4 Auto merge of #80397 - Mark-Simulacrum:fix-bare-tarball, r=pietroalbini
Use package name for top-level directory in bare tarballs

This fixes a bug introduced by #79788.

r? `@pietroalbini`
2020-12-28 08:29:02 +00:00
Joshua Nelson 2f063cd394 Don't use `self.date` unconditionally for `program_out_of_date()`
This avoids unnecessary cache invalidations for programs not affected by
the stage0 version (which is everything except the stage0 compiler
itself).

The redundant invalidations weren't noticed until now because they only
showed up on stage0 bumps, at which point people are used to rebuilding
everything anyway. I noticed it because I wasn't adding `self.date` to
the stamp file (because I didn't realize it was necessary). Rather than
adding self.date I thought it was better to remove it from the cache
key.
2020-12-27 20:32:19 -05:00
Joshua Nelson 7ac02bddc7 Don't give an error when creating a file for the first time
Previously, `os.remove` would always give a FileNotFound error the first
time you called it, causing bootstrap to make unnecessary copies. This
now only calls `remove()` if the file exists, avoiding the unnecessary
error.
2020-12-27 19:55:02 -05:00
bors 76188b6830 Auto merge of #80315 - tmiasko:ignore-proc-macros, r=Mark-Simulacrum
Ignore proc-macros when assembling rustc libdir

Fixes #80294.
2020-12-27 16:03:01 +00:00
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