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

Fix switch_stdout_to on Windows7 #117386

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Conversation

roblabla
Copy link
Contributor

The switch_stdout_to test was broken on Windows7, as deleting the temporary test folder would fail since the switch-stdout-output file we redirected the stdout to is never closed, and it's impossible on Win7 to delete an opened file.

To fix this issue, we make switch_stdout_to return the previous handle. Using this, we add a new switch_stdout_to call at the end of the test to return the stdio handles to their original state, and recover the handle to the file we opened. This handle is automatically closed at the end of the function, which should allow the temporary test folder to be deleted properly.

@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 30, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

The switch_stdout_to test was broken on Windows7, as the test
infrastructure would refuse to delete the temporary test folder because
the switch-stdout-output file we redirected the stdout to was still
opened.

To fix this issue, we make switch_stdout_to return the previous handle,
and add a new switch_stdout_to call at the end of the test to return the
stdio handles to their original state. The handle the second
switch_stdout_to returns will be automatically closed, which should
allow the temporary test folder to be deleted properly.
@roblabla roblabla marked this pull request as ready for review October 31, 2023 09:58
@ChrisDenton
Copy link
Contributor

Looks good to me, thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 2, 2023

📌 Commit 4971e99 has been approved by ChrisDenton

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 Nov 2, 2023
@bors
Copy link
Contributor

bors commented Nov 2, 2023

⌛ Testing commit 4971e99 with merge 46455dc...

@bors
Copy link
Contributor

bors commented Nov 2, 2023

☀️ Test successful - checks-actions
Approved by: ChrisDenton
Pushing 46455dc to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 2, 2023
@bors bors merged commit 46455dc into rust-lang:master Nov 2, 2023
12 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Nov 2, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (46455dc): 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

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.9% [-2.9%, -2.9%] 1
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 636.991s -> 639.997s (0.47%)
Artifact size: 304.51 MiB -> 304.49 MiB (-0.00%)

bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Nov 3, 2023
82: Automated pull from upstream `master` r=tshepang a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#117313
* rust-lang/rust#117131
* rust-lang/rust#117134
* rust-lang/rust#117471
* rust-lang/rust#117521
* rust-lang/rust#117513
  * rust-lang/rust#117512
  * rust-lang/rust#117509
  * rust-lang/rust#117495
  * rust-lang/rust#117394
* rust-lang/rust#117466
* rust-lang/rust#117204
* rust-lang/rust#117386
* rust-lang/rust#117506



Co-authored-by: Nicholas Nethercote <n.nethercote@gmail.com>
Co-authored-by: roblabla <unfiltered@roblab.la>
Co-authored-by: Michael Goulet <michael@errs.io>
Co-authored-by: massivebird <gdrakemail@gmail.com>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: Zalathar <Zalathar@users.noreply.github.com>
Co-authored-by: lcnr <rust@lcnr.de>
Co-authored-by: Joshua Liebow-Feeser <joshlf@users.noreply.github.com>
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-libs Relevant to the library 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

7 participants