Skip to content

Commit 1aec8f4

Browse files
committed
Update free-disk-space.sh
1 parent 09b3a79 commit 1aec8f4

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ jobs:
123123
echo "disk usage:"
124124
df -h
125125
126-
# Free up disk space on Linux by removing preinstalled components that
126+
# Free up disk space on Linux and Windows by removing preinstalled components that
127127
# we do not need. We do this to enable some of the less resource
128128
# intensive jobs to run on free runners, which however also have
129129
# less disk space.
130-
- name: free up disk space
131-
run: src/ci/scripts/free-disk-space.sh
130+
- name: free up disk space start
131+
run: RUNNER_TRACKING_ID="" src/ci/scripts/free-disk-space.sh start
132132
if: matrix.free_disk
133133

134134
# Rust Log Analyzer can't currently detect the PR number of a GitHub
@@ -229,6 +229,10 @@ jobs:
229229
run: |
230230
cd src/ci/citool
231231
CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build
232+
233+
- name: free up disk space report
234+
run: src/ci/scripts/free-disk-space.sh report
235+
if: matrix.free_disk
232236

233237
- name: run the build
234238
run: |

src/bootstrap/download-ci-llvm-stamp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Change this file to make users of the `download-ci-llvm` configuration download
22
a new version of LLVM from CI, even if the LLVM submodule hasn’t changed.
33

4-
Last change is for: ????
4+
Last change is for: https://github.com/rust-lang/rust/pull/120761

src/ci/github-actions/jobs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ runners:
3232

3333
- &job-windows
3434
os: windows-2025
35+
free_disk: true
3536
<<: *base-job
3637

3738
# NOTE: windows-2025 has less disk space available than windows-2022,
3839
# because the D drive is missing.
3940
- &job-windows-25
4041
os: windows-2025
42+
free_disk: true
4143
<<: *base-job
4244

4345
- &job-windows-8c

src/ci/scripts/free-disk-space-linux.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ AVAILABLE_INITIAL=$(getAvailableSpace)
250250

251251
printDF "BEFORE CLEAN-UP:"
252252
echo ""
253-
253+
exit 1
254254
execAndMeasureSpaceChange cleanPackages "Unused packages"
255255
execAndMeasureSpaceChange cleanDocker "Docker images"
256256
execAndMeasureSpaceChange cleanSwap "Swap storage"

src/ci/scripts/free-disk-space.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
#!/bin/bash
22
set -euo pipefail
33

4+
script_dir=$(dirname "$0")
45
log=/tmp/free-disk-space.log
56

6-
if [[ "$1" == "start"]]; then
7+
if [[ "$1" == "start" ]]; then
78
# Run scripts in the background.
89
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
9-
pwsh free-disk-space-windows.ps1 &> $log &
10+
pwsh $script_dir/free-disk-space-windows.ps1 &> $log &
1011
else
11-
free-disk-space-linux.sh &> $log &
12+
$script_dir/free-disk-space-linux.sh &> $log &
1213
fi
13-
elif [[ "$1" == "report"]]; then
14-
exit_code=wait
14+
echo "FREE_DISK_SPACE_PID=$!" >> $GITHUB_ENV
15+
elif [[ "$1" == "report" ]]; then
16+
wait $FREE_DISK_SPACE_PID
17+
exit_code=$?
1518
cat $log
1619
exit $exit_code
1720
else

0 commit comments

Comments
 (0)