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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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
Contributor

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
Contributor

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
Contributor

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.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 4, 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 4, 2024

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2024
@bors
Copy link
Contributor

bors commented Jun 4, 2024

☔ The latest upstream changes (presumably #125989) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Contributor

jieyouxu commented Jun 5, 2024

This PR's associated CI runs are kinda cursed
ferrisExorcism

@jieyouxu
Copy link
Contributor

jieyouxu commented Jun 5, 2024

We could give it another try after fixing the merge conflict.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 5, 2024
@rust-log-analyzer

This comment has been minimized.

@Oneirical
Copy link
Contributor Author

Oneirical commented Jun 5, 2024

@rustbot review

Conflict resolved, though, while running around and removing conflicts, I noticed that there used to be a silent fail here:

let llvm_bin_dir = env::var("LLVM_BIN_DIR");

This is really strange, since I would have expected this to cause a compilation error from the unexpected Result type then getting passed around.

This could explain why the test job is getting stuck. Maybe we'll get a different error message this time.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 5, 2024
@rust-log-analyzer

This comment has been minimized.

@Oneirical
Copy link
Contributor Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 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 5, 2024

⌛ Trying commit fdd3967 with merge 30cb27a...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jun 5, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 5, 2024
@rustbot rustbot added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants