Commit Graph

140199 Commits

Author SHA1 Message Date
bors
60445fda58 Auto merge of #108534 - Mark-Simulacrum:compression, r=pietroalbini
Import rust-installer & adjust compression settings

This brings in rust-lang/rust-installer#123, which enables a larger compression window (8 -> 64MB) amongst other changes to the xz compression settings. The net effect should be smaller compressed tarballs which will decrease bandwidth usage for
static.rust-lang.org, download times, and decompression time.

This comes at the cost of higher baseline requirements for running rustup to use these files, which we believe should be largely acceptable (running rustc is likely to use at least this much memory) but if we get specific reports we may explore options to decrease impact (e.g., using the gzip tarballs automatically in rustup).

To simplify iteration on compression settings this also imports the rust-lang/rust-installer submodule, it is now hosted fully inside rust-lang/rust. Once we land this I'll file a followup to add a note to that repo and we can subsequently archive it.

--

CI times for dist-x86_64-linux builds:

* threads=6, master - 2h 50m
* threads=1, new - 3h 40m
* threads=6, new - 2h 50m
2023-03-08 09:52:12 +00:00
bors
9b60e6c68f Auto merge of #108312 - michaelwoerister:hash-set-not-hash-stable, r=eholk
Do not implement HashStable for HashSet (MCP 533)

This PR removes all occurrences of `HashSet` in query results, replacing it either with `FxIndexSet` or with `UnordSet`, and then removes the `HashStable` implementation of `HashSet`. This is part of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533), that is, removing the `HashStable` implementations of all collection types with unstable iteration order.

The changes are mostly mechanical. The only place where additional sorting is happening is in Miri's override implementation of the `exported_symbols` query.
2023-03-08 06:07:11 +00:00
Matthias Krüger
b0ec35362f
Rollup merge of #108866 - Kohei316:master, r=ozkanonur
Force to use the stage 2 compiler  when config.download_rustc is set

Fixes #108768
2023-03-07 19:57:46 +01:00
Matthias Krüger
c4453ccb82
Rollup merge of #108793 - clubby789:pythonpath-compiletest, r=compiler-errors
Append to existing `PYTHONPATH` in compiletest instead of overwriting

Fixes #108779
2023-03-07 19:57:45 +01:00
Matthias Krüger
23beda44ea
Rollup merge of #108581 - jfgoog:include-mingw-linker, r=petrochenkov
Add a new config flag, dist.include-mingw-linker.

The flag controls whether to copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain.

It applies only when the host or target is pc-windows-gnu.

The flag is true by default to preserve existing behavior.
2023-03-07 19:57:44 +01:00
morine0122
740d476bbf Add force to use the stage 2 compiler in compiler_for when config.download_rustc is set 2023-03-08 01:52:28 +09:00
Yuki Okushi
b866e1ee0a
Rollup merge of #108823 - wesleywiser:add_cf-protection_tracking_issue, r=Nilstrieb
Add tracking issue for cf-protection to unstable book
2023-03-07 23:06:24 +09:00
Yuki Okushi
79fd51df39
Rollup merge of #108805 - GuillaumeGomez:update-askama, r=notriddle
Update askama to 0.12 and improve whitespace control

`askama` 0.12 was just released, and it adds the possibility to have "whitespace suppression" enabled by default in the configuration so I switched to it.

r? ``@notriddle``
2023-03-07 23:06:24 +09:00
Yuki Okushi
a7b9488599
Rollup merge of #108619 - jyn514:llvm-version-check, r=cuviper
Remove the option to disable `llvm-version-check`

We don't support old versions of LLVM; there's no reason to have an easy way to force bootstrap to use them anyway. If someone really needs to use an unsupported version, they can modify bootstrap to change the version range.

r? ``@cuviper`` on whether we want to do this or not, since you maintain rust on Fedora and touched this config last.
2023-03-07 23:06:21 +09:00
Mark Rousskov
dabafb44e0 Use 3 or 6 compression threads for rust-installer
Limit to 3 threads for 32-bit platforms, otherwise we use 6 threads.
This avoids exceeding the amount of memory we can allocate on a 32-bit
platform.
2023-03-07 08:30:08 -05:00
Mark Rousskov
ddc2d1e806 Add bootstrap support for rust-installer 2023-03-07 08:30:08 -05:00
Mark Rousskov
8d9cef4709 Directly import rust-installer submodule
This moves the rust-installer code to be directly hosted in
rust-lang/rust, since it's not used elsewhere and this makes it easier
to make and review changes without needing a separate upstream commit.
2023-03-07 08:30:08 -05:00
Mark Rousskov
e733ff797f Bump rust-installer
This brings in rust-lang/rust-installer#123, which enables a larger
compression window (8 -> 64MB) amongst other changes to the xz
compression settings. The net effect should be smaller compressed
tarballs which will decrease bandwidth usage for
static.rust-lang.org, download times, and decompression time.

This comes at the cost of higher baseline requirements for running
rustup to use these files, which we believe should be largely acceptable
(running rustc is likely to use at least this much memory) but if we get
specific reports we may explore options to decrease impact (e.g., using
the gzip tarballs automatically in rustup).
2023-03-07 08:30:07 -05:00
Wesley Wiser
545fe60519 Add tracking issue for cf-protection to unstable book 2023-03-06 13:03:12 -05:00
Guillaume Gomez
511d2628c0 Update documentation for HTML templates style 2023-03-06 11:38:15 +01:00
Guillaume Gomez
a776c17263 Remove unneeded minus sign in jinja tags 2023-03-06 11:38:15 +01:00
Guillaume Gomez
76714c3731 Update askama version to 0.12 2023-03-06 11:17:11 +01:00
clubby789
2632a1c879 Append to PYTHONPATH in compiletest 2023-03-06 00:12:35 +00:00
Matthias Krüger
c08c69b4b1
Rollup merge of #108776 - jyn514:quiet-tidy, r=ozkanonur
Make `x test tidy` less noisy

Before:
```
Building tool tidy (stage0)
    Finished release [optimized + debuginfo] target(s) in 0.29s
fmt check
skip untracked path chrome_profiler.json during rustfmt invocations
skip untracked path query_impl-default,args.mm_profdata during rustfmt invocations
skip untracked path query_impl-llvm.txt during rustfmt invocations
skip untracked path query_impl-mono_items.txt during rustfmt invocations
skip untracked path query_impl-summarize.txt during rustfmt invocations
skip untracked path rustc.svg during rustfmt invocations
skip untracked path rustc_middle.mono_items.json during rustfmt invocations
skip untracked path rustc_middle.mono_items.md during rustfmt invocations
skip untracked path rustc_query_impl.mono_items-thread_local_attr.json during rustfmt invocations
skip untracked path rustc_query_impl.mono_items-thread_local_macro.json during rustfmt invocations
skip untracked path rustc_query_impl.mono_items.md during rustfmt invocations
tidy check
Found 505 error codes
Highest error code: `E0793`
* 397 features
Ensuring the YAML anchors in the GitHub Actions config were expanded
Building tool expand-yaml-anchors (stage0)
    Finished release [optimized + debuginfo] target(s) in 0.14s
Build completed successfully in 0:00:54
```

After:
```
Building tool tidy (stage0)
    Finished release [optimized + debuginfo] target(s) in 2.24s
fmt check
tidy check
Ensuring the YAML anchors in the GitHub Actions config were expanded
Building tool expand-yaml-anchors (stage0)
    Finished release [optimized + debuginfo] target(s) in 0.14s
Build completed successfully in 0:00:04
```
2023-03-05 20:57:23 +01:00
Matthias Krüger
7125df06c3
Rollup merge of #108773 - jyn514:faster-tidy-fmt, r=albertlarsan68
x fmt: Only check modified files locally

Previously, `x fmt` would only format modified files, while `x fmt .` and `x fmt --check` would still look at all files. After this change, `x fmt --check` only looks at modified files locally.

I feel pretty confident in this change - other than https://github.com/rust-lang/rust/issues/106261, no one has reported bugs in `get_modified_rs_files` since it was added in https://github.com/rust-lang/rust/pull/105702.

Combined with the changes in https://github.com/rust-lang/rust/pull/108772, this brings the time for me to run `x t tidy` with a hot FS cache down from 5 to 2 seconds (and moves the majority of the time spent back to `tidy check`, which means it can be sped up more in the future).
2023-03-05 20:57:22 +01:00
Joshua Nelson
b4a5f4c221 Make x test tidy less noisy
Before:
```
Building tool tidy (stage0)
    Finished release [optimized + debuginfo] target(s) in 0.29s
fmt check
skip untracked path chrome_profiler.json during rustfmt invocations
skip untracked path query_impl-default,args.mm_profdata during rustfmt invocations
skip untracked path query_impl-llvm.txt during rustfmt invocations
skip untracked path query_impl-mono_items.txt during rustfmt invocations
skip untracked path query_impl-summarize.txt during rustfmt invocations
skip untracked path rustc.svg during rustfmt invocations
skip untracked path rustc_middle.mono_items.json during rustfmt invocations
skip untracked path rustc_middle.mono_items.md during rustfmt invocations
skip untracked path rustc_query_impl.mono_items-thread_local_attr.json during rustfmt invocations
skip untracked path rustc_query_impl.mono_items-thread_local_macro.json during rustfmt invocations
skip untracked path rustc_query_impl.mono_items.md during rustfmt invocations
tidy check
Found 505 error codes
Highest error code: `E0793`
* 397 features
Ensuring the YAML anchors in the GitHub Actions config were expanded
Building tool expand-yaml-anchors (stage0)
    Finished release [optimized + debuginfo] target(s) in 0.14s
Build completed successfully in 0:00:54
```

After:
```
Building tool tidy (stage0)
    Finished release [optimized + debuginfo] target(s) in 2.24s
fmt check
tidy check
Ensuring the YAML anchors in the GitHub Actions config were expanded
Building tool expand-yaml-anchors (stage0)
    Finished release [optimized + debuginfo] target(s) in 0.14s
Build completed successfully in 0:00:04
```
2023-03-05 14:49:29 +00:00
Joshua Nelson
8becfed1c9 Remove the option to disable llvm-version-check
We don't support old versions of LLVM; there's no reason to have an easy
way to force bootstrap to use them anyway. If someone really needs to
use an unsupported version, they can modify bootstrap to change the
version range.
2023-03-05 14:42:15 +00:00
Joshua Nelson
620efed932 x fmt: Only check modified files locally
Previously, `x fmt` would only format modified files, while `x fmt .`
and `x fmt --check` would still look at all files. After this change, `x
fmt --check` only looks at modified files locally.

I feel pretty confident in this change - other than
https://github.com/rust-lang/rust/issues/106261, no one has reported
bugs in `get_modified_rs_files` since it was added in
https://github.com/rust-lang/rust/pull/105702.
2023-03-05 08:22:55 -06:00
Matthias Krüger
52196169fe
Rollup merge of #108749 - GuillaumeGomez:clean-up-rustdoc-js-tester, r=notriddle
Clean up rustdoc-js tester.js file

A much needed cleanup.

r? `@notriddle`
2023-03-05 14:29:10 +01:00
Matthias Krüger
03c1e4d4ff
Rollup merge of #108626 - ozkanonur:consistent-json-docs, r=aDotInTheVoid
rustdoc-json: switch from HashMap to FxHashMap to fix non-determinism

Using `HashMap` in `rustdoc_json_types::Crate` were causing creating randomly ordered objects in the json doc files. Which might cause problems to people who are doing comparison on those files specially in CI pipelines. See https://github.com/rust-lang/rust/issues/103785#issuecomment-1307425590

This PR fixes that issue and extends the coverage of `tests/run-make/rustdoc-verify-output-files` testing ability.
2023-03-05 14:29:09 +01:00
Matthias Krüger
f7bd8afa07
Rollup merge of #108618 - KittyBorgX:master, r=Mark-Simulacrum
Rename `src/etc/vscode_settings.json` to `rust_analyzer_settings.json`

Fixes https://github.com/rust-lang/rust/issues/108614
2023-03-05 14:29:09 +01:00
Matthias Krüger
c86ea5a0ef
Rollup merge of #108616 - jyn514:sync-codegen, r=albertlarsan68
Sync codegen defaults with compiler defaults and add a ping message so they stay in sync

Looks like this got missed in https://github.com/rust-lang/rust/pull/107241.
2023-03-05 14:29:08 +01:00
Matthias Krüger
925baa8b37
Rollup merge of #108613 - jyn514:rm-skip-rebuild, r=Mark-Simulacrum
Remove `llvm.skip-rebuild` option

This was added to in 2019 to speed up rebuild times when LLVM was modified. Now that download-ci-llvm exists, I don't think it makes sense to support an unsound option like this that can lead to miscompiles; and the code cleanup is nice too.

r? `@Mark-Simulacrum` cc `@varkor` #65612
2023-03-05 14:29:08 +01:00
Matthias Krüger
2f8bf34c9c
Rollup merge of #106440 - jyn514:tidy, r=the8472
Ignore files in .gitignore in tidy

- Switch from `walkdir` to `ignore`. This required various changes to make `skip` thread-safe.
- Ignore `build` anywhere in the source tree, not just at the top-level. We support this in bootstrap, we should support it in tidy too.

As a nice side benefit, this also makes tidy a bit faster.

Before:
```
; hyperfine -i '"/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"'
Benchmark 1: "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"
  Time (mean ± σ):      1.080 s ±  0.008 s    [User: 2.616 s, System: 3.243 s]
  Range (min … max):    1.069 s …  1.099 s    10 runs
```

After:
```
; hyperfine '"/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"'
Benchmark 1: "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"
  Time (mean ± σ):     705.0 ms ±   1.4 ms    [User: 3179.1 ms, System: 1517.5 ms]
  Range (min … max):   702.3 ms … 706.9 ms    10 runs
```

r? `@the8472`
2023-03-05 14:29:07 +01:00
Joshua Nelson
98334f6a2d Don't walk the tests/ directories in checks that always skip it
`WalkBuilder` handles top-level paths differently than `fn walk` used
to: it doesn't run the `skip` function to determine if it should be
skipped, instead assuming the top-level function is always included.

This is a reasonable assumption; adapt our code so it doesn't make
pointless calls to `walk`.
2023-03-05 05:51:23 -06:00
Joshua Nelson
97cffd5295 Reuse allocations between files 2023-03-05 05:44:13 -06:00
Joshua Nelson
1cccf2dd4c Ignore things in .gitignore in tidy
- Switch from `walkdir` to `ignore`. This required various changes to
  make `skip` thread-safe.
- Ignore `build` anywhere in the source tree, not just at the top-level.
  We support this in bootstrap, we should support it in tidy too.

As a nice side benefit, this also makes tidy a bit faster.

Before:
```
; hyperfine -i '"/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"'
Benchmark 1: "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"
  Time (mean ± σ):      1.080 s ±  0.008 s    [User: 2.616 s, System: 3.243 s]
  Range (min … max):    1.069 s …  1.099 s    10 runs
```

After:
```
; hyperfine '"/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"'
Benchmark 1: "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0-tools-bin/rust-tidy" "/home/gh-jyn514/rust2" "/home/gh-jyn514/rust2/build/aarch64-unknown-linux-gnu/stage0/bin/cargo" "/home/gh-jyn514/rust2/build" "32"
  Time (mean ± σ):     705.0 ms ±   1.4 ms    [User: 3179.1 ms, System: 1517.5 ms]
  Range (min … max):   702.3 ms … 706.9 ms    10 runs
```
2023-03-05 05:44:13 -06:00
Joshua Nelson
ba0b7af236 Sync codegen defaults with compiler defaults and add a ping message so they stay in sync 2023-03-05 05:16:37 -06:00
bors
0d439f8181 Auto merge of #108351 - petrochenkov:rmdit, r=cjgillot
rustc_middle: Remove trait `DefIdTree`

This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-03-05 10:37:02 +00:00
bors
35636f9459 Auto merge of #107723 - Kobzol:bootstrap-bolt, r=Mark-Simulacrum
Apply BOLT optimizations without rebuilding LLVM

This PR adds an explicit BOLT bootstrap step which applies BOLT on the fly when LLVM artifacts are copied to a sysroot (it only does this once per bootstrap invocation, the result is cached).  This avoids one LLVM rebuild in the Linux CI dist build.

r? `@jyn514`
2023-03-05 05:15:50 +00:00
bors
bb1838847d Auto merge of #108747 - matthiaskrgr:rollup-wfc7fx4, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #108627 (Properly colorize multi-part suggestions in the same line)
 - #108632 (Omit unchanged options from config.toml in `configure.py`)
 - #108715 (Remove unclosed_delims from parser)
 - #108723 (rustdoc: function signature search with traits in `where` clause)
 - #108724 (field is not used outside the crate)
 - #108734 (rustdoc: Note in a type's layout/size if it is uninhabited)
 - #108736 (Remove `allow(potential_query_instability)` from `ast_passes`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-04 22:50:24 +00:00
ozkanonur
52c71e6e28 fix inconsistent json outputs from rustdoc
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-05 00:09:09 +03:00
Guillaume Gomez
0b5165e76d Clean up rustdoc-js tester.js file 2023-03-04 21:11:34 +01:00
Matthias Krüger
99fad38b19
Rollup merge of #108734 - clubby789:rustdoc-layout-uninhabited, r=GuillaumeGomez
rustdoc: Note in a type's layout/size if it is uninhabited

Closes #87008

![image](https://user-images.githubusercontent.com/13556931/222900244-8e326d51-8d3b-4700-a935-96830179e2e9.png)
2023-03-04 20:48:19 +01:00
Matthias Krüger
9cabc40ab1
Rollup merge of #108723 - notriddle:notriddle/where-clause, r=GuillaumeGomez
rustdoc: function signature search with traits in `where` clause

## Before

![image](https://user-images.githubusercontent.com/1593513/222873534-a640a72a-c654-4702-9f3b-175129d9591d.png)

## After

![image](https://user-images.githubusercontent.com/1593513/222873544-fdfc431d-2b65-4b56-bede-0302ea9f153a.png)
2023-03-04 20:48:18 +01:00
Matthias Krüger
538f19d638
Rollup merge of #108632 - Teapot4195:issue-108612-fix, r=ozkanonur
Omit unchanged options from config.toml in `configure.py`

Leaves section tags, but removes options that are unchanged.
Change in `config.toml.example` is to prevent comments from sneaking in by being directly after a section tag

closes #108612
2023-03-04 20:48:17 +01:00
Jakub Beránek
9aad2ad361
Add check for dry run 2023-03-04 17:36:00 +01:00
Michael Howell
9d27028391 rustdoc: function signature search with traits in where clause 2023-03-04 09:05:57 -07:00
Jakub Beránek
91bb563e13
Try to avoid the last rustc rebuild 2023-03-04 16:37:40 +01:00
Jakub Beránek
bfc220a96e
Create BOLT build steps to avoid running BOLT multiple times on the same file 2023-03-04 16:37:40 +01:00
Jakub Beránek
c5d65aa580
Apply BOLT optimizations without rebuilding LLVM 2023-03-04 16:37:40 +01:00
Mark Rousskov
4cb1503d3a Bump version to 1.70.0 2023-03-04 10:10:46 -05:00
clubby789
7520155e4e rustdoc: Note in a type's layout/size if it is uninhabited 2023-03-04 12:07:29 +00:00
Dylan DPC
2fc4935cdb
Rollup merge of #108656 - GuillaumeGomez:rustdoc-search-unclosed-generic, r=notriddle
Rustdoc search: Emit an error for unclosed generic

Now, search like `a<` will error as it should (and as written in the eBNF).

r? `@notriddle`
2023-03-04 15:24:38 +05:30
bors
70adb4e5b4 Auto merge of #108709 - matthiaskrgr:rollup-j2tjbyx, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #104549 (add -Zexport-executable-symbols to unstable book)
 - #108292 (Label opaque type for 'captures lifetime' error message)
 - #108540 (Add `Atomic*::from_ptr`)
 - #108634 (Add link to component dashboard)
 - #108647 (Remove dead pgo.sh file)
 - #108678 (Use `Option::as_slice` where applicable)
 - #108681 (Improve comments in `needs_process_obligation`.)
 - #108688 (Match unmatched backticks in library/)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-03 22:45:58 +00:00