Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 4 pull requests #134349

Merged
merged 12 commits into from
Dec 15, 2024
Merged

Rollup of 4 pull requests #134349

merged 12 commits into from
Dec 15, 2024

Conversation

jieyouxu
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Urgau and others added 12 commits December 15, 2024 00:25
This was confusing because there are three layers of output hiding.
1. libtest shoves all output into a buffer and does not print it unless the test fails or `--nocapture` is passed.
2. compiletest chooses whether to print the output from any given process.
3. run-make-support chooses what output to print.

This modifies 2 and 3.

- compiletest: Don't require both `--verbose` and `--nocapture` to show the output of run-make tests.
- compiletest: Distinguish rustc and rmake stderr by printing the command name (e.g. "--stderr--" to "--rustc stderr--").
- run-make-support: Unconditionally print the needle/haystack being searched. Previously this was only printed on failure.

Before:
```
$ x t tests/run-make/linker-warning --force-rerun -- --nocapture
running 1 tests
.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 281.64ms
$ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture 2>&1 | wc -l
1004
$ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture | tail -n40
running 1 tests

------stdout------------------------------

------stderr------------------------------
warning: unused import: `std::path::Path`
 --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:1:5
  |
1 | use std::path::Path;
  |     ^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `run_make_support::rfs::remove_file`
 --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:3:5
  |
3 | use run_make_support::rfs::remove_file;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: 2 warnings emitted

------------------------------------------
test [run-make] tests/run-make/linker-warning ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 285.89ms
```

After:

```
Testing stage1 compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu)

running 1 tests
------rmake stdout------------------------------

------rmake stderr------------------------------
assert_contains_regex:
=== HAYSTACK ===
error: linking with `./fake-linker` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin:...:/bin" VSLANG="1033" "./fake-linker" "-m64" "/tmp/rustcYqdAZT/symbols.o" "main.main.d17f5fbe6225cf88-cgu.0.rcgu.o" "main.2uoctswmurc6ir5rvoay0p9ke.rcgu.o" "-Wl,--as-needed" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-B/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
  = note: error: baz

error: aborting due to 1 previous error

=== NEEDLE ===
fake-linker.*run_make_error
assert_not_contains_regex:
=== HAYSTACK ===

=== NEEDLE ===
fake-linker.*run_make_error

------------------------------------------
.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 314.81ms
```
Fix `--nocapture` for run-make tests

This was confusing because there are three layers of output hiding.
1. libtest shoves all output into a buffer and does not print it unless the test fails or `--nocapture` is passed.
2. compiletest chooses whether to print the output from any given process.
3. run-make-support chooses what output to print.

This modifies 2 and 3.

- compiletest: Don't require both `--verbose` and `--nocapture` to show the output of run-make tests.
- compiletest: Print the output from `rmake` processes if they succeed. Previously this was only printed on failure.
- compiletest: Distinguish rustc and rmake stderr by printing the command name (e.g. "--stderr--" to "--rustc stderr--").
- run-make-support: Unconditionally print the needle/haystack being searched. Previously this was only printed on failure.

Before:
```
$ x t tests/run-make/linker-warning --force-rerun -- --nocapture
running 1 tests
.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 281.64ms
$ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture 2>&1 | wc -l
1004
$ x t tests/run-make/linker-warning --force-rerun -v -- --nocapture | tail -n40
running 1 tests

------stdout------------------------------

------stderr------------------------------
warning: unused import: `std::path::Path`
 --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:1:5
  |
1 | use std::path::Path;
  |     ^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `run_make_support::rfs::remove_file`
 --> /home/jyn/src/rust2/tests/run-make/linker-warning/rmake.rs:3:5
  |
3 | use run_make_support::rfs::remove_file;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: 2 warnings emitted

------------------------------------------
test [run-make] tests/run-make/linker-warning ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 285.89ms
```

After:

```
Testing stage1 compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu)

running 1 tests
------rmake stdout------------------------------

------rmake stderr------------------------------
assert_contains_regex:
=== HAYSTACK ===
error: linking with `./fake-linker` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin:...:/bin" VSLANG="1033" "./fake-linker" "-m64" "/tmp/rustcYqdAZT/symbols.o" "main.main.d17f5fbe6225cf88-cgu.0.rcgu.o" "main.2uoctswmurc6ir5rvoay0p9ke.rcgu.o" "-Wl,--as-needed" "-Wl,-Bstatic" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-B/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
  = note: error: baz

error: aborting due to 1 previous error

=== NEEDLE ===
fake-linker.*run_make_error
assert_not_contains_regex:
=== HAYSTACK ===

=== NEEDLE ===
fake-linker.*run_make_error

------------------------------------------
.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 377 filtered out; finished in 314.81ms
```

r? `@jieyouxu`
…kingjubilee

Add m68k_target_feature

This adds the following unstable target features (tracking issue: rust-lang#134328):

- isa-68000
- isa-68010
- isa-68020
- isa-68030
- isa-68040
- isa-68060
- isa-68881
- isa-68882

The feature names and implied features are match with [definitions in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/M68k/M68k.td#L21-L57).

isa-68881 and isa-68882 are FPU ISA features.
isa-68881 is needed to support input/output in floating-point regs in inline assembly. isa-68020 is needed to implement taiki-e/atomic-maybe-uninit#28 more robustly.

cc `@glaubitz` `@ricky26` (designated developers  of [m68k-unknown-linux-gnu](https://doc.rust-lang.org/nightly/rustc/platform-support/m68k-unknown-linux-gnu.html#designated-developers))
r? workingjubilee

`@rustbot` label +O-motorola68k +A-target-feature
…onur-ozkan

bootstrap: make ./x test error-index work

This makes it more likely that someone who sees an error index CI failure will be able to figure out how to reproduce that locally. Note that bootstrap already prints "Testing stage2 error-index", which is misleading since the test is actually called error_index_generator.
Pass `TyCtxt` to early diagostics decoration

This PR pass a `TyCtxt` to the early diagnostics decoration code so that diagnostics code that take advantage of (a very limited but still useful) `TyCtxt` in their note, help, suggestions, ...

This is particulary useful for rust-lang#133221 which wants to get the crate name of a `DefId`, which is possible with `tcx.crate_name(...)`.

I highly recommend reviewing this PR commit by commit.

r? `@jieyouxu`
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Dec 15, 2024
@jieyouxu
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Dec 15, 2024

📌 Commit 56545ca has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 15, 2024
@bors
Copy link
Contributor

bors commented Dec 15, 2024

⌛ Testing commit 56545ca with merge c26db43...

@bors
Copy link
Contributor

bors commented Dec 15, 2024

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing c26db43 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 15, 2024
@bors bors merged commit c26db43 into rust-lang:master Dec 15, 2024
7 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 15, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#134111 Fix --nocapture for run-make tests 7085015df75f828c7fd4406ad173b49b09208aeb (link)
#134329 Add m68k_target_feature 29579c3fbe5ff05c8fd7a13f3ebbff661537d03f (link)
#134331 bootstrap: make ./x test error-index work bd144e3cebab2abf98fbfe936fb832ca160fd678 (link)
#134339 Pass TyCtxt to early diagostics decoration ec0e8a2423a320c68b07a1a76f43128a2853b431 (link)

previous master: d18506299b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c26db43): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.8%, -0.1%] 4
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 4
All ❌✅ (primary) -0.3% [-0.8%, -0.1%] 4

Max RSS (memory usage)

Results (primary 0.4%, secondary 0.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.2% [1.2%, 1.3%] 2
Regressions ❌
(secondary)
2.3% [2.0%, 3.0%] 4
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-1.9% [-1.9%, -1.8%] 2
All ❌✅ (primary) 0.4% [-1.2%, 1.3%] 3

Cycles

Results (primary -2.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.5% [-2.5%, -2.5%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 770.653s -> 770.348s (-0.04%)
Artifact size: 333.19 MiB -> 333.25 MiB (0.02%)

@jieyouxu jieyouxu deleted the rollup-zqn0jox branch December 16, 2024 04:58
@jieyouxu
Copy link
Member Author

I think perf is just noise here, the rolled up PRs shouldn't be perf changing at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants