-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use rmake
for windows-
run-make tests
#125613
Conversation
Some changes occurred in run-make tests. cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
e71d23b
to
dabfbe9
Compare
The run-make-support library was changed cc @jieyouxu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test comments, they are very informative :3
I left two suggestions, r=me with or without addressing them.
da5deed
to
f705a22
Compare
rustc().input("empty.rs").run(); | ||
let empty = tmp_dir().join("empty.exe"); | ||
let output = llvm_readobj().input(empty).coff_imports().command_output(); | ||
assert!(output.status.success()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder for myself: cc #125617 we should add run() that asserts success for llvm-readobj as well, so it's less of a footgun to forgor checking cmd status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wait there is a run I think. I missed that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we probably need to un-provide the command_output
helper because it's probably almost never the right helper to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds helpful. I should probably also read the docs for the support lib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it wasn't mentioned explicitly in command_output
, I'll clean it up soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that gives me a thought: it might be nice to make ./x doc run-make-support --open
work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would indeed be very useful
dc0843c
to
ad5dce5
Compare
Ok, I'll stop fiddling now 😛There are maybe some more improvements to be made but I'll leave that to follow-ups. Like, maybe it would make sense to use the @bors r=jieyouxu |
…youxu Use `rmake` for `windows-` run-make tests Convert some Makefile tests to recipes. I renamed "issue-85441" to "windows-ws2_32" as I think it's slightly more descriptive. EDIT: `llvm-readobj` seems to work for reading DLL imports so I've used that instead of `objdump`. cc rust-lang#121876
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#125339 (The number of tests does not depend on the architecture's pointer width) - rust-lang#125539 (crashes: increment the number of tracked ones) - rust-lang#125542 (Migrate rustdoc verify output files) - rust-lang#125613 (Use `rmake` for `windows-` run-make tests) - rust-lang#125616 (MIR validation: ensure that downcast projection is followed by field projection) Failed merges: - rust-lang#125573 (Migrate `run-make/allow-warnings-cmdline-stability` to `rmake.rs`) r? `@ghost` `@rustbot` modify labels: rollup
…youxu Use `rmake` for `windows-` run-make tests Convert some Makefile tests to recipes. I renamed "issue-85441" to "windows-ws2_32" as I think it's slightly more descriptive. EDIT: `llvm-readobj` seems to work for reading DLL imports so I've used that instead of `objdump`. cc rust-lang#121876
Rollup of 4 pull requests Successful merges: - rust-lang#125411 (check host's libstdc++ version when using ci llvm) - rust-lang#125598 (Make `ProofTreeBuilder` actually generic over `Interner`) - rust-lang#125609 (Always use the general case char count with `optimize_for_size`) - rust-lang#125613 (Use `rmake` for `windows-` run-make tests) r? `@ghost` `@rustbot` modify labels: rollup
i686-windows-gnu funtimes ahead? @bors rollup=iffy |
Use `rmake` for `windows-` run-make tests Convert some Makefile tests to recipes. I renamed "issue-85441" to "windows-ws2_32" as I think it's slightly more descriptive. EDIT: `llvm-readobj` seems to work for reading DLL imports so I've used that instead of `objdump`. cc rust-lang#121876
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Ok so the no external deps test is failing on mingw due to a missing dll (but it succeeds for msvc). The weird thing is it was obviously succeeding in the Makefile version. Which perhaps suggest make or mingw bash is doing something behind our backs so we weren't testing what we thought we were testing. Either that or I missed something else. I'll investigate tomorrow. |
rust/src/tools/run-make-support/src/run.rs Lines 27 to 34 in 7516912
maybe that is why in the original Makefile they used $(TMPDIR)/hello.exe instead of $(call RUN,hello) Not entirely sure. |
☔ The latest upstream changes (presumably #125691) made this pull request unmergeable. Please resolve the merge conflicts. |
I had a look at the original issue that provoked adding this test. It seems we only need to be testing the final binary, not rustc itself. That does make things easier. I still need to rebase and squish. And while I'm at it, I might rewrite the |
0034ce5
to
f34bbde
Compare
I've rebased and made the commits easier to navigate. There are two changed tests. 5ec0c00 fixes the failure as discussed above by only setting For f08e00f I switched to using |
if !status.success() { | ||
panic!("Command failed!\noutput status: `{status}`"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remark (to myself): we should probably expose the handle_failed_output
helper to make this less repetitive.
let binary_data = fs::read(path).unwrap(); | ||
let file = object::File::parse(&*binary_data).unwrap(); | ||
for import in file.imports().unwrap() { | ||
if import.library().eq_ignore_ascii_case(b"WS2_32.dll") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how this test reads :3
Thanks! |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e9b7aa0): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -0.8%, secondary -3.6%)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.
CyclesResults (primary -2.5%, secondary -3.0%)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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.715s -> 667.139s (-0.09%) |
Convert some Makefile tests to recipes.
I renamed "issue-85441" to "windows-ws2_32" as I think it's slightly more descriptive. EDIT:
llvm-readobj
seems to work for reading DLL imports so I've used that instead ofobjdump
.cc #121876