Skip to content

Free disk space on Windows 2025 runners #144305

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

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

Conversation

ChrisDenton
Copy link
Member

@ChrisDenton ChrisDenton commented Jul 22, 2025

I've managed to reduce the time deletion takes by:

  • Using powershell, which is generally faster for filesystem operations than msys2
  • Disabling defender's realtime protection
  • Performing deletions concurrently then waiting for them all to complete

It still takes 2-10 mins but that's not too bad.

@rustbot
Copy link
Collaborator

rustbot commented Jul 22, 2025

r? @jdno

rustbot has assigned @jdno.
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-CI Area: Our Github Actions CI 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jul 22, 2025
@ChrisDenton
Copy link
Member Author

@bors try jobs=x86_64-msvc-1

rust-bors bot added a commit that referenced this pull request Jul 22, 2025
Free disk space on Windows 2025 runners

try-job: x86_64-msvc-1
@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

⌛ Trying commit e635015 with merge 0c11125

To cancel the try build, run the command @bors try cancel.

@ChrisDenton ChrisDenton force-pushed the win-free-disk-space branch from e635015 to 9e95a28 Compare July 22, 2025 13:35
@marcoieni
Copy link
Member

I'll review this since I have a lot of context.

r? marcoieni

@rustbot rustbot assigned marcoieni and unassigned jdno Jul 22, 2025
@ChrisDenton
Copy link
Member Author

@bors try jobs=msvc,mingw

@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

⌛ Trying commit 96ed33f with merge 8d49646

(The previously running try build was automatically cancelled.)

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 22, 2025
Free disk space on Windows 2025 runners

try-job: *msvc*
try-job: *mingw*
@ChrisDenton ChrisDenton force-pushed the win-free-disk-space branch from 96ed33f to 7685c91 Compare July 22, 2025 14:04
@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

☀️ Try build successful (CI)
Build commit: 8d49646 (8d496467c43f870fb6ca9724ba0cb278e746927d, parent: c0b282f0ccdab7523cdb8dfa41b23bed5573da76)

@ChrisDenton ChrisDenton force-pushed the win-free-disk-space branch from 7685c91 to 5f662d5 Compare July 22, 2025 19:17
@ChrisDenton
Copy link
Member Author

@bors try jobs=x86_64-msvc-1

@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

⌛ Trying commit 5f662d5 with merge 9937cf4

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 22, 2025
Free disk space on Windows 2025 runners

try-job: x86_64-msvc-1
@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

💔 Test failed (CI). Failed job:

@ChrisDenton
Copy link
Member Author

@bors try jobs=x86_64-msvc-1

@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

⌛ Trying commit 6616372 with merge 1644c53

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 22, 2025
Free disk space on Windows 2025 runners

try-job: x86_64-msvc-1
@ChrisDenton
Copy link
Member Author

@bors try cancel

@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

Try build cancelled. Cancelled workflows:

@ChrisDenton ChrisDenton force-pushed the win-free-disk-space branch from 6616372 to c88ff50 Compare July 22, 2025 19:56
@ChrisDenton
Copy link
Member Author

@bors try jobs=x86_64-msvc-1

@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

⌛ Trying commit c88ff50 with merge a21d02a

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 22, 2025
Free disk space on Windows 2025 runners

try-job: x86_64-msvc-1
@ChrisDenton
Copy link
Member Author

@bors try cancel

@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

Try build was cancelled. It was not possible to cancel some workflows.

@ChrisDenton ChrisDenton force-pushed the win-free-disk-space branch from c88ff50 to 25281c5 Compare July 22, 2025 20:01
@ChrisDenton
Copy link
Member Author

@bors try jobs=x86_64-msvc-1

rust-bors bot added a commit that referenced this pull request Jul 22, 2025
Free disk space on Windows 2025 runners

try-job: x86_64-msvc-1
@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

⌛ Trying commit 25281c5 with merge 543c1a0

To cancel the try build, run the command @bors try cancel.

@ChrisDenton ChrisDenton force-pushed the win-free-disk-space branch from 25281c5 to 2054f20 Compare July 22, 2025 20:11
@rust-bors
Copy link

rust-bors bot commented Jul 22, 2025

☀️ Try build successful (CI)
Build commit: 543c1a0 (543c1a0c837a9512fbb972b85e2b2bc5ae5aaed0, parent: 2e5367566819ca7878baa9600ae7a93eb0e37bbf)

'C:\Strawberry', 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk'

foreach ($dir in $dirs) {
Start-ThreadJob -InputObject $dir {
Copy link
Member Author

Choose a reason for hiding this comment

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

I switched to use threads as spawning a shell for each job is quite heavy weight on Windows.

Copy link
Member

Choose a reason for hiding this comment

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

feel free to write this as a comment in the code if you think it's useful 👍

@marcoieni
Copy link
Member

I tested this in https://github.com/marcoieni/actions-test and it works great! Can you squash the commit history?

@marcoieni
Copy link
Member

After that you squashed the commits and solved the last comment, let's try it one more time on all windows jobs to see how much space is left on every job

@ChrisDenton
Copy link
Member Author

Squished!

@bors try jobs=msvc,mingw

rust-bors bot added a commit that referenced this pull request Jul 23, 2025
Free disk space on Windows 2025 runners

try-job: *msvc*
try-job: *mingw*
@rust-bors
Copy link

rust-bors bot commented Jul 23, 2025

⌛ Trying commit cc46ba4 with merge 65a1769

To cancel the try build, run the command @bors try cancel.

@rust-bors
Copy link

rust-bors bot commented Jul 23, 2025

☀️ Try build successful (CI)
Build commit: 65a1769 (65a17699f066f1c32926ae51ab519347eec4cc42, parent: 5a30e4307f0506bed87eeecd171f8366fdbda1dc)

@marcoieni
Copy link
Member

The commit history doesn't look clean:
image

@marcoieni
Copy link
Member

try - dist-x86_64-mingw is the job with the lowest available disk space at 18G. So I think the script is removing enough disk space 🥳

Unfortunately in some jobs freeing the disk space takes up to 10 minutes. I think it's fine for now, but in the future we might want to try to make this step faster somehow 🤔

You can r=me once you clean the commit history 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI Area: Our Github Actions CI 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-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.

5 participants