-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
compiletest: split rmake.rs executable from scratch directory #125827
Conversation
rustbot has assigned @albertlarsan68. Use |
@bors try |
This comment was marked as resolved.
This comment was marked as resolved.
…try> compiletest: split rmake.rs executable from scratch directory When implementing support for rmake.rs, I copied over the `$TMPDIR` directory logic from the legacy Makefile setup. In doing so, I also compiled recipe `rmake.rs` into executables which unfortunately are placed into `$TMPDIR` as well. This causes a problem on Windows (as observed in PRs like rust-lang#125752 (comment)) where: - The `rmake.exe` executable is placed in `$TMPDIR`. - We run the `rmake.exe` as a process. - The process uses `rmake.exe` inside `$TMPDIR`. - Windows prevents the .exe file from being deleted when the process is still alive. - The recipe test code tries to `remove_dir_all($TMPDIR)`, which fails with access denied because `rmake.exe` is still being used. We fix this by separating the recipe executable and the scratch directory: ``` base_dir/ rmake.exe scratch/ ``` We construct a base directory, unique to each run-make test, under which we place rmake.exe alongside a `scratch/` directory. This `scratch/` directory is what is passed to rmake.rs tests as `$TMPDIR`, so now `remove_dir_all($TMPDIR)` has a chance to succeed because it no longer contains `rmake.exe`. This wasn't a problem for Makefile tests because there's no exe file under `$TMPDIR` whose process is still running when `rm -rf $TMPDIR` is called. try-job: x86_64-msvc
This comment was marked as resolved.
This comment was marked as resolved.
☀️ Try build successful - checks-actions |
r? onur-ozkan |
When implementing support for rmake.rs, I copied over the `$TMPDIR` directory logic from the legacy Makefile setup. In doing so, I also compiled recipe `rmake.rs` into executables which unfortunately are placed into `$TMPDIR` as well. This causes a problem on Windows where: - The `rmake.exe` executable is placed in `$TMPDIR`. - We run the `rmake.exe` as a process. - The process uses `rmake.exe` inside `$TMPDIR`. - Windows prevents the .exe file from being deleted when the process is still alive. - The recipe test code tries to `remove_dir_all($TMPDIR)`, which fails with access denied because `rmake.exe` is still being used. We fix this by separating the recipe executable and the sratch directory: ``` base_dir/ rmake.exe scratch/ ``` We construct a base directory, unique to each run-make test, under which we place rmake.exe alongside a `scratch/` directory. This `scratch/` directory is what is passed to rmake.rs tests as `$TMPDIR`, so now `remove_dir_all($TMPDIR)` has a chance to succeed because it no longer contains `rmake.exe`. Oops. This was a fun one to try figure out.
2163e31
to
4562245
Compare
Changes since last reviewed:
@rustbot ready |
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!
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (13e2d72): 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)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary -3.4%)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.268s -> 666.563s (-0.11%) |
// ``` | ||
// base_dir/ | ||
// rmake.exe | ||
// scratch/ |
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.
looks like this comment is out of date now with the rmake_out change?
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 updated the PR description but I forgor to update the comment, thanks, I'll send a follow-up PR.
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.
Opened #125896
…, r=compiler-errors compiletest: fix outdated rmake.rs comment Noticed in rust-lang#125827 (comment). I fixed the PR description but forgot to update the comment.
…, r=compiler-errors compiletest: fix outdated rmake.rs comment Noticed in rust-lang#125827 (comment). I fixed the PR description but forgot to update the comment.
Rollup merge of rust-lang#125896 - jieyouxu:compiletest-rmake-comment, r=compiler-errors compiletest: fix outdated rmake.rs comment Noticed in rust-lang#125827 (comment). I fixed the PR description but forgot to update the comment.
When implementing support for rmake.rs, I copied over the
$TMPDIR
directory logic from the legacy Makefile setup. In doing so, I also compiled recipermake.rs
into executables which unfortunately are placed into$TMPDIR
as well.This causes a problem on Windows (as observed in PRs like #125752 (comment)) where:
rmake.exe
executable is placed in$TMPDIR
.rmake.exe
as a process.rmake.exe
inside$TMPDIR
.remove_dir_all($TMPDIR)
, which fails with access denied becausermake.exe
is still being used.We fix this by separating the recipe executable and the output artifacts directory:
We construct a base directory, unique to each run-make test, under which we place rmake.exe alongside a
rmake_out/
directory. Thisrmake_out/
directory is what is passed to rmake.rs tests as$TMPDIR
, so nowremove_dir_all($TMPDIR)
has a chance to succeed because it no longer containsrmake.exe
.This wasn't a problem for Makefile tests because there's no exe file under
$TMPDIR
whose process is still running whenrm -rf $TMPDIR
is called.try-job: x86_64-msvc