Commit Graph

6339 Commits

Author SHA1 Message Date
Jubilee
5b554613ed
Rollup merge of #132737 - clubby789:lock-no-pid, r=jieyouxu
bootstrap: Print better message if lock pid isn't available

Not actually sure why, but sometimes the PID isn't available so we print
```
WARNING: build directory locked by process , waiting for lock
```
This makes the message a bit nicer in this case
2024-11-07 18:48:24 -08:00
Jubilee
93e9ec05a9
Rollup merge of #131913 - jieyouxu:only_debug_assertions, r=onur-ozkan
Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support

Add `{ignore,needs}-{rustc,std}-debug-assertions` compiletest directives and retire the old `{ignore,only}-debug` directives. The old `{ignore,only}-debug` directives were ambiguous because you could have std built with debug assertions but rustc not built with debug assertions or vice versa. If we want to support the use case of controlling test run based on if rustc was built with debug assertions, then having `{ignore,only}-debug` will be very confusing.

cc ````@matthiaskrgr````

Closes #123987.

r? bootstrap (or compiler tbh)
2024-11-07 18:48:21 -08:00
clubby789
1ee5ab3085 bootstrap: Print better message if lock pid isn't available 2024-11-07 17:28:16 +00:00
bors
fe43131683 Auto merge of #132635 - kiike:fix/dots_in_target, r=onur-ozkan
bootstrap: add quoting support to avoid splitting

With this change, it is now possible to pass quotes to the configure script, such as

`./configure.py --set=target.\"thumbv8m.main-none-eabi\".linker=/linker`
or
`./configure.py '--set=target."thumbv8m.main-none-eabi".linker=/linker'`

, which will treat `thumbv8.main-none-eabi` as a whole part. Currently, the string would be split into two elements: `thumbv8`, and `main-none-eabi`.

The approach taken is to perform custom splitting instead of using `str.split()` and then repairing the split. Also, There are numerous corner cases not handled: the custom split doesn't differentiate between single quotes or double quotes, so it is perfectly possible to pass `./configure.py --set=target.\"thumbv8m.main-none-eabi\'.linker=/linker` and the behaviour would be the same as with all double quotes or single quotes.

As for the code, i'm unsure on whether to delimit strings with double or single quotes. I've seen both single quotes and double quotes used to delimit strings, like in
```py
err("Option '{}' provided more than once".format(key))
```
and this a handful of lines down:
```py
if option.name == 'sccache':
    set('llvm.ccache', 'sccache', config)
```
Please advise on the wanted one.

Fixes #130602

r? `@onur-ozkan`

Thanks in advance for the feedback!
2024-11-07 09:50:31 +00:00
Enric Morales
8471c6bb0c
bootstrap: add quoting support to avoid splitting
With this change, it is now possible to pass quotes to the configure
script, such as

`./configure.py --set=target.\"thumbv8m.main-none-eabi\".linker=/linker`

, which will treat `thumbv8.main-none-eabi` as a whole part. Currently,
the string would be split into two elements: `thumbv8`, and
`main-none-eabi`.
2024-11-06 21:03:02 +01:00
David Wood
d8ab230e73
bootstrap: include llvm-objcopy in dist 2024-11-05 11:49:03 +00:00
Nilstrieb
f42fb43517 Call the target libdir target libdir
Because it's the target libdir.

`--print` uses the same terminology, and it's a simple way to make it
obviously different from `$sysroot/lib`.
2024-11-03 11:49:43 +01:00
Matthias Krüger
bfcd9ecea6
Rollup merge of #132494 - onur-ozkan:library-profile-default, r=jieyouxu
make `download-rustc="if-unchanged"` default for library profile

Since `download-rustc` is tested on CI and https://github.com/rust-lang/rust/pull/132267 makes it effective for library development, we can now make it default for the library profile.

Implements the 3rd item from [this tracking issue](https://github.com/rust-lang/rust/issues/131744).
2024-11-02 12:14:14 +01:00
onur-ozkan
329dacff10 add change entry for library profile update
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-02 10:18:09 +03:00
onur-ozkan
7fd3ce4b4b make download-rustc="if-unchanged" default for library profile
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-02 10:13:55 +03:00
Guillaume Gomez
c794207eae
Rollup merge of #132438 - chenyukang:yukang-fix-analyzer_settings, r=jieyouxu
Remove unncessary option for default rust-analyzer setting

In favor of https://github.com/rust-lang/rust-analyzer/pull/17888
2024-11-02 03:08:52 +08:00
bors
9fa9ef385c Auto merge of #131634 - davidlattimore:lld-protected, r=Kobzol
Use protected visibility when building rustc with LLD

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

I wasn't sure about having two commits in a PR, but I figured, at least initially it might make sense to discuss these commits together. Happy to squash, or move the second commit to a separate PR.

I contemplated trying to enable protected visibility for more cases when LLD will be used other than just `-Zlinker-features=+lld`, but that would be more a complex change that probably still wouldn't cover all cases when LLD is used, so went with the simplest option of just checking if the linker-feature is enabled.

r? lqd
2024-11-01 05:25:27 +00:00
yukang
b6a49d8969 Remove unncessary option for default rust-analyzer setting 2024-11-01 13:11:51 +08:00
许杰友 Jieyou Xu (Joe)
f9ca4201f8 bootstrap: pass minicore path when running compiletest step 2024-10-31 18:20:11 +08:00
许杰友 Jieyou Xu (Joe)
3870022986 bootstrap: pass --with-{rustc,std}-debug-assertions to compiletest
And rename local variables and field names in bootstrap from
`debug_assertions{,_std}` -> `{rustc,std}-debug-assertions` to avoid
confusion where applicable.
2024-10-31 17:33:42 +08:00
David Lattimore
00da974c5c Use protected symbols when building rustc_driver 2024-10-31 20:26:21 +11:00
Matthias Krüger
2b93bf60ee
Rollup merge of #132365 - onur-ozkan:less-rustc-overhead, r=Kobzol
pass `RUSTC_HOST_FLAGS` at once without the for loop

For obvious reasons...
2024-10-31 06:11:57 +01:00
onur-ozkan
4b52bbcf03 pass RUSTC_HOST_FLAGS at once without the for loop
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-31 00:12:25 +03:00
onur-ozkan
5cf6b8bdee force-recompile library changes on download-rustc="if-unchanged"
This makes download-rustc="if-unchanged" more functional and useful
for library developers.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-28 18:22:33 +03:00
onur-ozkan
74bfa661a5 simplify force-recompile logic for "library"
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-27 08:55:52 +03:00
onur-ozkan
a8261333e1 don't use absolute paths on git(Some(self.src))
It will run at the project root, so resolving absolute/top-level paths
is unnecessary.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-27 08:38:20 +03:00
Manuel Drehwald
e2d3f5aaec Allow building rustc's LLVM with Offload support 2024-10-25 14:31:09 -07:00
bors
3dc1b9f5c0 Auto merge of #132007 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/edition-guide

7 commits in c7ebae25cb4801a31b6f05353f6d85bfa6feedd1..1f07c242f8162a711a5ac5a4ea8fa7ec884ee7a9
2024-10-21 14:29:49 UTC to 2024-10-19 19:08:20 UTC

- 2024: Add reserved syntax (rust-lang/edition-guide#326)
- Update stdout of `cargo new` (rust-lang/edition-guide#327)
- Don't run doctests on rustfmt ident sorting page
- add rustfmt raw identifer sorting doc (rust-lang/edition-guide#321)
- Add some tips for what to be careful of with rustdoc-doctests (rust-lang/edition-guide#323)
- Remove cargo-remove-implicit-features (rust-lang/edition-guide#324)
- Rename doctest standalone tag (rust-lang/edition-guide#325)

## rust-embedded/book

1 commits in f40a8b420ec4b4505d9489965e261f1d5c28ba23..ddbf1b4e2858fedb71b7c42eb15c4576517dc125
2024-10-13 19:53:37 UTC to 2024-10-13 19:53:37 UTC

- Add link to Cortex-M comparison to install.md (rust-embedded/book#378)

## rust-lang/reference

29 commits in c64e52a3d306eac0129f3ad6c6d8806ab99ae2e9..23ce619966541bf2c80d45fdfeecf3393e360a13
2024-10-05 00:33:03 +0000 to 2024-10-22 21:34:51 +0000
- Mention `--print cfg` under set configuration options (rust-lang/reference#1636)
- Fix `pat` fragment specifier to be the "current" edition (rust-lang/reference#1640)
- Add restriction for cfg_attr with crate_type and crate_name (rust-lang/reference#1649)
- Sort macro fragment specifiers (rust-lang/reference#1641)
- Document mixed-site hygiene (rust-lang/reference#1656)
- Clarify that "macro attributes" refers to proc macros (rust-lang/reference#1660)
- mdbook-spec: Fix Spec::new creation (rust-lang/reference#1658)
- Fix stdcall example broken by recent rustc change (rust-lang/reference#1659)
- Add spec identifiers to const_eval.md (rust-lang/reference#1569)
- Add identifier syntax to trait-bounds.md (rust-lang/reference#1631)
- Add identifier syntax to macro-ambiguity.md (rust-lang/reference#1634)
- Add spec identifier syntax to conditional-compilation.md (rust-lang/reference#1564)
- Add spec identifiers to behaviour-considered-undefined.md (rust-lang/reference#1562)
- Add test linking (rust-lang/reference#1646)
- Allow `deny` inside `forbid` as a no-op (rust-lang/reference#1655)
- Add identifier syntax to identifiers.md (rust-lang/reference#1583)
- Add spec identifiers to crates-and-source-files.md (rust-lang/reference#1570)
- Add identifier syntax to linkage.md (rust-lang/reference#1633)
- Add identifier syntax to type-coercions.md (rust-lang/reference#1632)
- Add identifiers to variables.md (rust-lang/reference#1626)
- Add identifier syntax to lexer chapters (rust-lang/reference#1620)
- Add spec identifier syntax to `unsafe-keyword.md` and `unsafety.md` (rust-lang/reference#1619)
- Add identifier syntax to types and subchapters. (rust-lang/reference#1618)
- Add identifier syntax to subtyping.md (rust-lang/reference#1613)
- Add identifier syntax to statements.md (rust-lang/reference#1611)
- Add identifier syntax to type-layout.md (rust-lang/reference#1614)
- Clarify definition of "immutable bytes" (rust-lang/reference#1637)
- Add preview artifacts in CI (rust-lang/reference#1647)
- trait bounds grammar: make `?` and `for&lt;&gt;` mutually exclusive (rust-lang/reference#1650)

## rust-lang/rustc-dev-guide

5 commits in 07bc9ca9eb1cd6d9fbbf758c2753b748804a134f..59d94ea75a0b157e148af14c73c2dd60efb7b60a
2024-10-21 02:30:07 UTC to 2024-10-07 21:12:09 UTC

- Add the WASM | WASI | Emscripten notification groups (rust-lang/rustc-dev-guide#2100)
- Update bootstrapping.md (rust-lang/rustc-dev-guide#1900)
- Rename `needs-profiler-support` to `needs-profiler-runtime` (rust-lang/rustc-dev-guide#2095)
- Document compiletest directives `ignore-coverage-map` and `ignore-coverage-run` (rust-lang/rustc-dev-guide#2094)
- Purge `run-pass-valgrind` mentions (rust-lang/rustc-dev-guide#2091)
2024-10-24 22:55:02 +00:00
Eric Huss
df8551b60a Update rustbook to support new test linking in reference 2024-10-23 11:44:23 -07:00
León Orell Valerian Liehr
bb65499b61
Rollup merge of #132054 - onur-ozkan:cargo-config, r=Kobzol
do not remove `.cargo` directory

If vendoring isn't used bootstrap removes `.cargo` directory, which prevents developers from setting certain options in the `.cargo/config.toml` file. This was introduced in https://github.com/rust-lang/rust/pull/97513 (specifically in [this commit](345eb14f6c)). Also, since https://github.com/rust-lang/rust/pull/123942, vendoring is now possible even in git sources, which means we shouldn't remove `.cargo` directory in git sources anymore.
2024-10-23 17:24:31 +02:00
León Orell Valerian Liehr
f2675002a0
Rollup merge of #131181 - dev-ardi:custom-differ, r=jieyouxu
Compiletest: Custom differ

This adds support for a custom differ for compiletests. It’s purely visual and helps produce cleaner output when UI tests fail.

I’m using an environment variable for now since it’s experimental and I don’t want to drill the cli arguments all the way down. Also did a bit of general cleanup while I was at it.

This is how it looks [with debug info silenced](https://github.com/rust-lang/rust/pull/131182) (#131182)
`COMPILETEST_DIFF_TOOL="/usr/bin/env difft --color always --background light --display side-by-side" ./x test tests/ui/parser`
![image](https://github.com/user-attachments/assets/f740ce50-7564-4469-be0a-86e24bc50eb8)
2024-10-23 17:24:30 +02:00
guliwa
1b5921641a
Refactor change detection for rustdoc and download-rustc 2024-10-23 09:30:00 +00:00
onur-ozkan
47d6667454 do not remove .cargo directroy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-23 08:56:54 +03:00
Orion Gonzalez
c8de61b50d s/display-diff-tool/compiletest-diff-tool/ 2024-10-22 19:11:44 +02:00
Orion Gonzalez
37ffb94093 update CONFIG_CHANGE_HISTORY 2024-10-22 19:11:05 +02:00
Orion Gonzalez
ef4325eb85 implemented custom differ 2024-10-22 19:10:35 +02:00
Matthias Krüger
56eae720bd
Rollup merge of #132006 - onur-ozkan:131947, r=jieyouxu
don't stage-off to previous compiler when CI rustc is available

Resolves the 4th item in [Tracking Issue for download-rustc improvements](https://github.com/rust-lang/rust/issues/131744).
2024-10-22 15:28:47 +02:00
Matthias Krüger
cbb85f1bd5
Rollup merge of #131731 - lucarlig:master, r=onur-ozkan
add `TestFloatParse` to `tools.rs` for bootstrap

add TestFloatParse to tools for bootstrap, I am not sure this is what the issue https://github.com/rust-lang/rust/issues/128012 discussion wants.

try-job: aarch64-apple
2024-10-22 15:28:43 +02:00
Jubilee
aba227b3a9
Rollup merge of #131954 - the8472:bootstrap-parallel-git, r=Kobzol
shave 150ms off bootstrap

This starts `git` commands inside `GitInfo`and the submodule updates in parallel. Git should already perform internal locking in cases where it needs to serialize a modification.

```
OLD
Benchmark #1: ./x check core
  Time (mean ± σ):     608.7 ms ±   4.4 ms    [User: 368.3 ms, System: 455.1 ms]
  Range (min … max):   602.3 ms … 618.8 ms    10 runs

NEW
Benchmark #1: ./x check core
  Time (mean ± σ):     462.8 ms ±   2.6 ms    [User: 350.2 ms, System: 485.1 ms]
  Range (min … max):   457.5 ms … 465.6 ms    10 runs
```

This should help with the rust-analyzer setup which issues many individual `./x check` calls. There's more that could be done but these were the lowest-hanging fruits that I saw.
2024-10-21 20:32:02 -07:00
onur-ozkan
774201e3b6 don't stage-off to previous compiler when CI rustc is available
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-21 19:34:41 +03:00
许杰友 Jieyou Xu (Joe)
2b4bf2dbb0 bootstrap: move builder.rs under builder/ directory 2024-10-21 10:34:31 +08:00
许杰友 Jieyou Xu (Joe)
1d77715f83 bootstrap: minor docs cleanup 2024-10-21 10:34:31 +08:00
许杰友 Jieyou Xu (Joe)
4b28e52f32 bootstrap: extract builder cargo to its own module
I found builder.rs to be a massive file which made it hard to digest. To
make `RUSTFLAGS` usage hardening easier later, I extracted the cargo
part in `builder.rs` into its own module.
2024-10-21 10:34:30 +08:00
Matthias Krüger
2f77343eec
Rollup merge of #131926 - clubby789:configure-enable, r=Kobzol
Align boolean option descriptions in `configure.py`

Boolean options are currently printed as
```
Options
        --enable-debug  OR  --disable-debug enables debugging environment; does not affect optimization of bootstrapped code
        --enable-docs  OR  --disable-docs build standard library documentation
        --enable-compiler-docs  OR  --disable-compiler-docs build compiler documentation
        --enable-optimize-tests  OR  --disable-optimize-tests build tests with optimizations
        --enable-verbose-tests  OR  --disable-verbose-tests enable verbose output when running tests
        --enable-ccache  OR  --disable-ccache invoke gcc/clang via ccache to reuse object files between builds
        --enable-sccache  OR  --disable-sccache invoke gcc/clang via sccache to reuse object files between builds
        --enable-local-rust  OR  --disable-local-rust use an installed rustc rather than downloading a snapshot
        --local-rust-root=VAL          set prefix for local rust binary
        --enable-local-rebuild  OR  --disable-local-rebuild assume local-rust matches the current version, for rebuilds; implies local-rust, and is implied if local-rust already matches the current version
```
as of #131117

imo, this is a little difficult to skim. This PR changes this to align the `OR`s and push the description onto a newline:

```
Options
        --enable-debug                     OR --disable-debug
                enables debugging environment; does not affect optimization of bootstrapped code
        --enable-docs                      OR --disable-docs
                build standard library documentation
        --enable-compiler-docs             OR --disable-compiler-docs
                build compiler documentation
        --enable-optimize-tests            OR --disable-optimize-tests
                build tests with optimizations
        --enable-verbose-tests             OR --disable-verbose-tests
                enable verbose output when running tests
        --enable-ccache                    OR --disable-ccache
                invoke gcc/clang via ccache to reuse object files between builds
        --enable-sccache                   OR --disable-sccache
                invoke gcc/clang via sccache to reuse object files between builds
        --enable-local-rust                OR --disable-local-rust
                use an installed rustc rather than downloading a snapshot
        --local-rust-root=VAL          set prefix for local rust binary
        --enable-local-rebuild             OR --disable-local-rebuild
                assume local-rust matches the current version, for rebuilds; implies local-rust, and is implied if local-rust already matches the current version
    ```
2024-10-20 16:54:10 +02:00
Matthias Krüger
fb42a4581b
Rollup merge of #131647 - jieyouxu:unicode-table-generator, r=Mark-Simulacrum
Register `src/tools/unicode-table-generator` as a runnable tool

It seems like `src/tools/unicode-table-generator` is not currently managed by bootstrap. This PR wires it up with bootstrap as a runnable tool.

This tool seems to take two possible args:

1. (Mandatory) path to `library/core/src/unicode/unicode_data.rs`, and
2. (Optional) path to generate a test file.

I only passed the mandatory path to `unicode_data.rs` in bootstrap and didn't do anything about (2). I'm not sure about how this tool is supposed to be run.

`Cargo.lock` is modified because I renamed `unicode-table-generator`'s bin name to match the tool name, as bootstrap's tool running logic expects the bin name to be derived from the tool name.

I also added a triagebot message to remind to not manually edit the library source file and edit the tool then regenerate instead, but this should probably be a tidy check (if that's desirable then that can be in a follow-up PR, though may be overkill).

Helps with #131640 but does not close it because still no docs.

r? `@Mark-Simulacrum` (since I think you authored this tool?)
2024-10-20 16:54:09 +02:00
Matthias Krüger
17ac4c8fb5
Rollup merge of #131365 - heiseish:fix-issue-101993, r=Mark-Simulacrum
Fix missing rustfmt in msi installer #101993

# Context
- Fixed missing `rustfmt`, `clippy`, `miri` and `rust-analyzer` in msi installer
- Fixed missing `rustfmt` for apple darwin installer
- Closes #101993

r​? `@jyn514`
- Please let me know if I should request from someone else instead. I divided the changes into 3 separate commits for the ease of review. The refactoring commit `fbdfd5c03c3c979bcf105ccdd05ff4ab9f37a763` is a bit more involved, but I think it helps in the long term for readability and to avoid bugs.
- I changed `build-manifest` to `build_manifest` in order to invoke it as a library. Not sure if this is gonna break any upstream processes. I checked `generate-manifest-list` and `generate-release` but didn't find any obvious reference
- Will push fixes for linting later
2024-10-20 16:54:09 +02:00
lucarlig
bc9fc714fb add TestFloatParse to tools for bootstrap 2024-10-20 12:39:24 +01:00
The 8472
a269e4da72 run git commands in bootstrap in parallel
this saves about 150ms on many ./x invocations
2024-10-20 13:36:21 +02:00
clubby789
28fce83cc6 Align boolean option descriptions in configure.py 2024-10-19 13:02:37 +00:00
许杰友 Jieyou Xu (Joe)
65458aed68 bootstrap: allow setting --jobs in config.toml 2024-10-19 13:35:41 +08:00
Josh Stone
cd60224af7 Fix clippy::needless-lifetimes in bootstrap 2024-10-15 20:53:26 -07:00
Josh Stone
618b0cb046 update STAGE0_MISSING_TARGETS 2024-10-15 20:30:23 -07:00
Giang Dao
2316749ca9 fix missing rustfmt for apple darwin 2024-10-15 23:53:24 +08:00
Giang Dao
f5577a8174 fix missing rustfmt and clippy for msi 2024-10-15 23:53:24 +08:00
Hood Chatham
1d6643c4f6 Fix most ui tests on emscripten target
To fix the linker errors, we need to set the output extension to `.js` instead
of `.wasm`. Setting the output to a `.wasm` file puts Emscripten into standalone
mode which is effectively a distinct target. We need to set the runner to be
`node` as well.

This fixes most of the ui tests. I fixed a few more tests with simple problems:
- `intrinsics/intrinsic-alignment.rs` and `structs-enums/rec-align-u64.rs` --
Two `#[cfg]` macros match for Emscripten so we got a duplicate definition of
`mod m`.
- `issues/issue-12699.rs` -- Seems to hang so I disabled it
- `process/process-sigpipe.rs` -- Not expected to work on Emscripten so I
disabled it
2024-10-15 14:25:55 +02:00