Skip to content

ci(free-disk-space): remove more tools and fix warnings#155958

Open
marcoieni wants to merge 1 commit intorust-lang:mainfrom
marcoieni:ci-remove-edge-chrome-and-more
Open

ci(free-disk-space): remove more tools and fix warnings#155958
marcoieni wants to merge 1 commit intorust-lang:mainfrom
marcoieni:ci-remove-edge-chrome-and-more

Conversation

@marcoieni
Copy link
Copy Markdown
Member

@marcoieni marcoieni commented Apr 29, 2026

With this PR I remove more space and improve the free-disk-space-linux script.
If you prefer me to split this PR into multiple ones, let me know.

Discussed in #t-infra > some jobs running out of disk space

Test

I tested this change in marcoieni/actions-test@196ce70. As you can see the workflows run without warnings, which ensures that we can remove all the space possible from the arm runners.

I also tested this change in this repository, by commenting out the mechanism to skip disk cleanup in case there is sufficient available disk space. ( see 86529fb )
If I don't comment out the code, it can happen that the CI skips the code I edited because there's enough disk space in the runners that this CI is running.

Here's the change of that commit:

# sufficientSpaceEarlyExit
# checkAlternative

Storage saved

In that temporary commit, I measured how much we are saving. It looks like this PR saves ~2GB:

@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 Apr 29, 2026
# Remove Docker images.
# Ubuntu 22 runners have docker images already installed.
# They aren't present in ubuntu 24 runners.
# Remove preinstalled Docker images.
Copy link
Copy Markdown
Member Author

@marcoieni marcoieni Apr 29, 2026

Choose a reason for hiding this comment

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

Removed this comment because there are some docker images in ubuntu 24 as well.

View changes since the review

@marcoieni marcoieni changed the title ci: remove edge, chrome and other tools to free disk space ci(free-disk-space): remove more tools and fix warnings Apr 29, 2026
@marcoieni marcoieni force-pushed the ci-remove-edge-chrome-and-more branch from 5a7dd95 to e5493ea Compare April 29, 2026 08:22
)

# Paths only present in x86 runners
local github_runner_x86_paths=(
Copy link
Copy Markdown
Member Author

@marcoieni marcoieni Apr 29, 2026

Choose a reason for hiding this comment

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

I extracted these paths from the array above because they are not present in arm. Trying to remove them was emitting a warning.

View changes since the review

)
local x86_only_packages=(
'google-chrome-stable'
'microsoft-edge-stable'
Copy link
Copy Markdown
Member Author

@marcoieni marcoieni Apr 29, 2026

Choose a reason for hiding this comment

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

edge and the new packages from temurin to skopeo are new (they weren't removed before)

View changes since the review

Comment on lines +136 to +140
# Microsoft Edge and powershell
"/opt/microsoft"

"/opt/pipx"
"/opt/pipx_bin"
Copy link
Copy Markdown
Member Author

@marcoieni marcoieni Apr 29, 2026

Choose a reason for hiding this comment

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

These paths are new

View changes since the review

if [ -z "$images" ]; then
echo "=> No docker images to remove."
return
fi
Copy link
Copy Markdown
Member Author

@marcoieni marcoieni Apr 29, 2026

Choose a reason for hiding this comment

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

Attempting to remove all docker images when there were none, produced a warning (because the measured saved space was less than zero)

View changes since the review

sufficientSpaceEarlyExit() {
local available_space_kb=$(df -k . --output=avail | tail -n 1)
local available_space_kb
available_space_kb=$(df -k . --output=avail | tail -n 1)
Copy link
Copy Markdown
Member Author

@marcoieni marcoieni Apr 29, 2026

Choose a reason for hiding this comment

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

here and below I fixed a shellcheck lint that suggested to declare the variable before assigning it

View changes since the review

@marcoieni marcoieni marked this pull request as ready for review April 29, 2026 08:37
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 29, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 29, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: infra-ci
  • infra-ci expanded to Kobzol, Mark-Simulacrum, jdno, jieyouxu, marcoieni
  • Random selection from Mark-Simulacrum, jdno, jieyouxu

@marcoieni marcoieni marked this pull request as draft April 29, 2026 08:46
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2026
@marcoieni
Copy link
Copy Markdown
Member Author

marcoieni commented Apr 29, 2026

image The CI was successful, I'm reverting the commit 86529fb

@marcoieni marcoieni force-pushed the ci-remove-edge-chrome-and-more branch from 86529fb to e5493ea Compare April 29, 2026 10:54
@marcoieni marcoieni marked this pull request as ready for review April 29, 2026 10:55
@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 Apr 29, 2026
Copy link
Copy Markdown
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

📌 Commit e5493ea has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Apr 29, 2026
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.

3 participants