Skip to content

ci: clean windows disk space in background #145311

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

Merged
merged 1 commit into from
Aug 15, 2025

Conversation

marcoieni
Copy link
Member

@marcoieni marcoieni commented Aug 12, 2025

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
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
Copy link

rust-bors bot commented Aug 12, 2025

💔 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
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
Copy link
Member Author

marcoieni commented Aug 13, 2025

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

@rust-bors
Copy link

rust-bors bot commented Aug 13, 2025

☀️ 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
@@ -223,6 +223,11 @@ jobs:
cd src/ci/citool
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
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
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-log-analyzer

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
Member Author

@bors try cancel

@rust-bors
Copy link

rust-bors bot commented Aug 14, 2025

Try build cancelled. Cancelled workflows:

@marcoieni
Copy link
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
Copy link

rust-bors bot commented Aug 14, 2025

☀️ 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
Copy link
Collaborator

rustbot commented Aug 14, 2025

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
Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

Thanks!

@Kobzol
Copy link
Member

Kobzol commented Aug 15, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 15, 2025

📌 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
Copy link
Member

Kobzol commented Aug 15, 2025

@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
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.

5 participants