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

Migrate run-make/pgo-branch-weights to rmake #125165

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

Oneirical
Copy link
Contributor

@Oneirical Oneirical commented May 15, 2024

Part of #121876 and the associated Google Summer of Code project.

This is a scary one and I expect things to break. Set as draft, because this isn't ready.

  • There is this comment here, which suggests the test is excluded from the testing process due to a platform specific issue? I can't see anything here that would cause this test to not run...

// FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
// properly. Since we only have GCC on the CI ignore the test for now."

EDIT: This is specific to Windows-gnu.

  • The Makefile has this line:
ifneq (,$(findstring x86,$(TARGET)))
COMMON_FLAGS=-Clink-args=-fuse-ld=gold

I honestly can't tell whether this is checking if the target IS x86, or IS NOT. EDIT: It's checking if it IS x86.

  • I don't know why the Makefile was trying to pass an argument directly in the Makefile instead of setting that "aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc" input as a variable in the Rust program directly. I changed that, let me know if that was wrong.

  • Trying to rewrite cat "$(TMPDIR)/interesting.ll" | "$(LLVM_FILECHECK)" filecheck-patterns.txt resulted in some butchery. For starters, in tools.mk, LLVM_FILECHECK corrects its own backslashes on Windows distributions, but there is no further mention of it, so I assume this is a preset environment variable... but is it really? Then, the command itself uses a Standard Input and a passed input file as an argument simultaneously, according to the documentation.

try-job: aarch64-gnu

@rustbot
Copy link
Collaborator

rustbot commented May 15, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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) labels May 15, 2024
@rust-log-analyzer

This comment has been minimized.

@lqd
Copy link
Member

lqd commented May 15, 2024

  1. There is this comment here, which suggests the test is excluded from the testing process due to a platform specific issue? I can't see anything here that would cause this test to not run...

// FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
// properly. Since we only have GCC on the CI ignore the test for now."

it's the # ignore-windows-gnu in the makefile, which is where this mingw gcc bug is expected to happen, according to the comment

@jieyouxu
Copy link
Member

Yeah, run-make Makefiles have # <directive-name> directives. What's funny about them like the old-format // <directive-name> directive in Rust code is that you can sneak in a directive in a comment block, e.g.

# This is a comment block that has a starting line,
# ignore-windows in the middle of the sentence,
# and hello world in the end of the sentence.

Here # ignore-windows is a (Makefile) directive.

@Oneirical
Copy link
Contributor Author

Oneirical commented May 15, 2024

Ah, I was wondering if that comment meant the test did not run at all... I am equally soothed that my work on this one was not wasted, and worried that this means it will have to be fully understood to proceed...

It does use features found in other tests, though, so this should make the other tests using LLVM instrumentation much easier to port.

EDIT: That does mean that the LLVM_FILECHECK part that fixes Windows path to use slashes won't have to be ported over in this test, since Windows is already getting ignored. Not sure if that mattered in the first place.

EDIT 2: Not Windows, Windows-gnu.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lqd
Copy link
Member

lqd commented May 15, 2024

since Windows is already getting ignored

To clarify, windows-gnu is ignored, not windows-msvc (the main windows target), or the other windows targets.

@rust-log-analyzer

This comment has been minimized.

tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/main.rs Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

I'll take a closer took tomorrow

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

src/tools/run-make-support/src/run.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
@jieyouxu
Copy link
Member

Feel free to ping me if you need any PR CI runs (i.e. try jobs) for various platforms.

@rust-log-analyzer

This comment has been minimized.

@Oneirical
Copy link
Contributor Author

Oneirical commented May 21, 2024

Feel free to ping me if you need any PR CI runs (i.e. try jobs) for various platforms.

@jieyouxu I might need some try jobs for windows-gnu (once CI is green). The description has been changed already.

@rust-log-analyzer

This comment has been minimized.

@Oneirical
Copy link
Contributor Author

@bors try

@bors
Copy link
Contributor

bors commented Jun 11, 2024

⌛ Trying commit 0bb84af with merge 55dde6a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 11, 2024
Migrate `run-make/pgo-branch-weights` to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

This is a scary one and I expect things to break. Set as draft, because this isn't ready.

- [x] There is this comment here, which suggests the test is excluded from the testing process due to a platform specific issue? I can't see anything here that would cause this test to not run...
> // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
// properly. Since we only have GCC on the CI ignore the test for now."

EDIT: This is specific to Windows-gnu.

- [x] The Makefile has this line:
```
ifneq (,$(findstring x86,$(TARGET)))
COMMON_FLAGS=-Clink-args=-fuse-ld=gold
```
I honestly can't tell whether this is checking if the target IS x86, or IS NOT. EDIT: It's checking if it IS x86.

- [x] I don't know why the Makefile was trying to pass an argument directly in the Makefile instead of setting that "aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc" input as a variable in the Rust program directly. I changed that, let me know if that was wrong.

- [x] Trying to rewrite `cat "$(TMPDIR)/interesting.ll" | "$(LLVM_FILECHECK)" filecheck-patterns.txt` resulted in some butchery. For starters, in `tools.mk`, LLVM_FILECHECK corrects its own backslashes on Windows distributions, but there is no further mention of it, so I assume this is a preset environment variable... but is it really? Then, the command itself uses a Standard Input and a passed input file as an argument simultaneously, according to the [documentation](https://llvm.org/docs/CommandGuide/FileCheck.html#synopsis).

try-job: aarch64-gnu
@bors
Copy link
Contributor

bors commented Jun 11, 2024

☀️ Try build successful - checks-actions
Build commit: 55dde6a (55dde6a6ff40e83623f3ce7ae7f38dc65332cb17)

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor nits, but otherwise looks good

src/tools/run-make-support/src/llvm.rs Show resolved Hide resolved
src/tools/run-make-support/src/llvm.rs Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/pgo-branch-weights/rmake.rs Outdated Show resolved Hide resolved
@Oneirical
Copy link
Contributor Author

Changes implemented. I'm slightly worried that the bors try success was not real and was caused by the CI outage of yesterday, but I suppose we're about to find out.

@jieyouxu
Copy link
Member

We'll see in full CI.
@bors rollup=iffy

@jieyouxu
Copy link
Member

@bors delegate+ (r=me after CI is green)

@bors
Copy link
Contributor

bors commented Jun 12, 2024

✌️ @Oneirical, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@Oneirical
Copy link
Contributor Author

@bors r=@jieyouxu

@bors
Copy link
Contributor

bors commented Jun 12, 2024

📌 Commit 17b0771 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 12, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jun 13, 2024
…eyouxu

Migrate `run-make/pgo-branch-weights` to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

This is a scary one and I expect things to break. Set as draft, because this isn't ready.

- [x] There is this comment here, which suggests the test is excluded from the testing process due to a platform specific issue? I can't see anything here that would cause this test to not run...
> // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
// properly. Since we only have GCC on the CI ignore the test for now."

EDIT: This is specific to Windows-gnu.

- [x] The Makefile has this line:
```
ifneq (,$(findstring x86,$(TARGET)))
COMMON_FLAGS=-Clink-args=-fuse-ld=gold
```
I honestly can't tell whether this is checking if the target IS x86, or IS NOT. EDIT: It's checking if it IS x86.

- [x] I don't know why the Makefile was trying to pass an argument directly in the Makefile instead of setting that "aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc" input as a variable in the Rust program directly. I changed that, let me know if that was wrong.

- [x] Trying to rewrite `cat "$(TMPDIR)/interesting.ll" | "$(LLVM_FILECHECK)" filecheck-patterns.txt` resulted in some butchery. For starters, in `tools.mk`, LLVM_FILECHECK corrects its own backslashes on Windows distributions, but there is no further mention of it, so I assume this is a preset environment variable... but is it really? Then, the command itself uses a Standard Input and a passed input file as an argument simultaneously, according to the [documentation](https://llvm.org/docs/CommandGuide/FileCheck.html#synopsis).

try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 13, 2024
…kingjubilee

Rollup of 11 pull requests

Successful merges:

 - rust-lang#125165 (Migrate `run-make/pgo-branch-weights` to `rmake`)
 - rust-lang#125674 (Rewrite `symlinked-extern`, `symlinked-rlib` and `symlinked-libraries` `run-make` tests in `rmake.rs` format)
 - rust-lang#125688 (Walk into alias-eq nested goals even if normalization fails)
 - rust-lang#126142 (Harmonize using root or leaf obligation in trait error reporting)
 - rust-lang#126303 (Urls to docs in rust_hir)
 - rust-lang#126328 (Add Option::is_none_or)
 - rust-lang#126337 (Add test for walking order dependent opaque type behaviour)
 - rust-lang#126351 (std::unix::fs::link using direct linkat call for Solaris.)
 - rust-lang#126353 (Move `MatchAgainstFreshVars` to old solver)
 - rust-lang#126356 (docs(rustc): Improve discoverable of Cargo docs)
 - rust-lang#126362 (Make `try_from_target_usize` method public)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jun 13, 2024

⌛ Testing commit 17b0771 with merge f6b4b71...

@bors
Copy link
Contributor

bors commented Jun 13, 2024

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

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

Finished benchmarking commit (f6b4b71): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 1.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)
3.2% [2.3%, 4.7%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.9% [-2.3%, 4.7%] 4

Cycles

Results (secondary -2.1%)

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)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 672.648s -> 671.891s (-0.11%)
Artifact size: 320.29 MiB -> 320.29 MiB (0.00%)

@Oneirical Oneirical deleted the pgo-branch-weights branch June 13, 2024 13:41
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 16, 2024
… r=jieyouxu

Remove unused `llvm_readobj.rs` in `run-make-support`

`llvm_readobj.rs` seems unused from the migration to `llvm.rs` in rust-lang#125165.
Also, `llvm.rs` was missing the drop bombs (rust-lang#125752) in `llvm_readobj.rs`.

Part of rust-lang#121876.

r? `@jieyouxu`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 16, 2024
Rollup merge of rust-lang#126536 - Rejyr:remove-unused-run-make-file, r=jieyouxu

Remove unused `llvm_readobj.rs` in `run-make-support`

`llvm_readobj.rs` seems unused from the migration to `llvm.rs` in rust-lang#125165.
Also, `llvm.rs` was missing the drop bombs (rust-lang#125752) in `llvm_readobj.rs`.

Part of rust-lang#121876.

r? `@jieyouxu`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

10 participants