Skip to content

ci: clean windows disk space in background#145311

Merged
bors merged 1 commit into
rust-lang:masterfrom
marcoieni:clean-disk-in-background-windows
Aug 15, 2025
Merged

ci: clean windows disk space in background#145311
bors merged 1 commit into
rust-lang:masterfrom
marcoieni:clean-disk-in-background-windows

Conversation

@marcoieni

@marcoieni marcoieni commented Aug 12, 2025

Copy link
Copy Markdown
Member

Speed up cleaning up disk space by launching the process in the background.
We wait for it to finish before running the build.
The con of this PR is that it adds extra complexity. However, cleaning up disk space on windows can take a lot of time (in the latest auto build I saw one job taking 8 minutes for example).

Context

The disk space cleanup was introduced in #144305

Test

I tested that the waiting mechanism works in https://github.com/marcoieni/actions-test/actions/runs/16935555049/job/47991148801:
image

Overall speed

I compared the duration of the jobs of the try build with the latest auto build and I noticed a speed up in most of the jobs. Some jobs are slower but that's probably because of unrelated CI reasons.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 12, 2025
@marcoieni

Copy link
Copy Markdown
Member Author

@bors try jobs=msvc,mingw

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Aug 12, 2025
…=<try>

ci: clean windows disk space in background

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

rust-bors Bot commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

💔 Test for 8cf61b6 failed: CI. Failed jobs:

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@marcoieni marcoieni force-pushed the clean-disk-in-background-windows branch from d3be181 to 2290350 Compare August 13, 2025 08:50
@rust-log-analyzer

This comment has been minimized.

@marcoieni marcoieni force-pushed the clean-disk-in-background-windows branch from 2290350 to 2434d72 Compare August 13, 2025 10:06
@rust-log-analyzer

This comment has been minimized.

@marcoieni marcoieni force-pushed the clean-disk-in-background-windows branch from 2434d72 to ee2962a Compare August 13, 2025 10:18
@marcoieni

Copy link
Copy Markdown
Member Author

@bors try jobs=msvc,mingw

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Aug 13, 2025
…=<try>

ci: clean windows disk space in background

try-job: *msvc*
try-job: *mingw*
@marcoieni

marcoieni commented Aug 13, 2025

Copy link
Copy Markdown
Member Author

Now cleaning the disk space takes 0 seconds. Nice.
image
image

@rust-bors

rust-bors Bot commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6b1a678 (6b1a678eb596a5f39faa335cd0805108e3416c3e, parent: 1c9952f4dd6e0947ee91f07130c03813a088a894)

@marcoieni marcoieni force-pushed the clean-disk-in-background-windows branch from ee2962a to 2c2dcda Compare August 14, 2025 09:58
Comment thread .github/workflows/ci.yml
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build

- name: wait for Windows disk cleanup to finish
if: ${{ matrix.free_disk && startsWith(matrix.os, 'windows-') }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

later, if we want to do the same for linux, we can remove startsWith(matrix.os, 'windows-')

@marcoieni marcoieni force-pushed the clean-disk-in-background-windows branch 6 times, most recently from 8b30259 to addc8ba Compare August 14, 2025 10:20
@marcoieni

Copy link
Copy Markdown
Member Author

@bors try jobs=msvc,mingw

@rust-bors

This comment has been minimized.

@marcoieni marcoieni force-pushed the clean-disk-in-background-windows branch from addc8ba to 75b7d24 Compare August 14, 2025 10:38
@marcoieni

Copy link
Copy Markdown
Member Author

@bors try cancel

@rust-bors

rust-bors Bot commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

@marcoieni

Copy link
Copy Markdown
Member Author

@bors try jobs=msvc,mingw

@rust-bors

This comment has been minimized.

rust-bors Bot added a commit that referenced this pull request Aug 14, 2025
…=<try>

ci: clean windows disk space in background

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

rust-bors Bot commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 5c220ab (5c220ab091d3a4c34a51e2c4a2900699f653522a, parent: 2c1ac85679678dfe5cce7ea8037735b0349ceaf3)

@marcoieni marcoieni marked this pull request as ready for review August 14, 2025 13:53
@rustbot

rustbot commented Aug 14, 2025

Copy link
Copy Markdown
Collaborator

r? @Kobzol

rustbot has assigned @Kobzol.
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 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 Aug 14, 2025

@Kobzol Kobzol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@Kobzol

Kobzol commented Aug 15, 2025

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Aug 15, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 75b7d24 has been approved by Kobzol

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 Aug 15, 2025
@Kobzol

Kobzol commented Aug 15, 2025

Copy link
Copy Markdown
Member

@bors rollup

bors added a commit that referenced this pull request Aug 15, 2025
Rollup of 11 pull requests

Successful merges:

 - #144210 (std: thread: Return error if setting thread stack size fails)
 - #145310 (Reduce usage of `compiler_for` in bootstrap)
 - #145311 (ci: clean windows disk space in background)
 - #145340 (Split codegen backend check step into two and don't run it with `x check compiler`)
 - #145408 (Deduplicate -L search paths)
 - #145412 (Windows: Replace `GetThreadId`+`GetCurrentThread` with `GetCurrentThreadId`)
 - #145413 (bootstrap: Reduce dependencies)
 - #145426 (Fix typos in bootstrap.example.toml)
 - #145430 (Fix wrong spans with external macros in the `dropping_copy_types` lint)
 - #145431 (Enhance UI test output handling for runtime errors)
 - #145448 (Autolabel `src/tools/{rustfmt,rust-analyzer}` changes with `T-{rustfmt,rust-analyzer}`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b474f89 into rust-lang:master Aug 15, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 15, 2025
rust-timer added a commit that referenced this pull request Aug 15, 2025
Rollup merge of #145311 - marcoieni:clean-disk-in-background-windows, r=Kobzol

ci: clean windows disk space in background
@Zalathar

Copy link
Copy Markdown
Member

In #145478 (comment), a CI job ended up waiting forever for the disk cleanup to finish.

I suspect this was just some general Windows CI flakiness that happened to strike the cleanup task, but I wanted to note it here for reference in case it turns out to be a recurring problem.

@Kobzol

Kobzol commented Aug 18, 2025

Copy link
Copy Markdown
Member

Ok yeah that's not great, thanks for letting us know! @marcoieni Could you please send a PR where you add some timeout (e.g. 5 minutes) for waiting for the disk space cleanup?

@marcoieni

marcoieni commented Aug 18, 2025

Copy link
Copy Markdown
Member Author

opened #145559
Thanks for reporting this!

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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants