Skip to content

Commit 793100e

Browse files
committed
Auto merge of #140383 - marcoieni:codebuild-gnu-distcheck, r=<try>
ci: use codebuild for `x86_64-gnu-distcheck` job try-job: x86_64-gnu-distcheck
2 parents a932eb3 + b081163 commit 793100e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/ci/github-actions/jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ auto:
309309
<<: *job-linux-4c
310310

311311
- name: x86_64-gnu-distcheck
312-
<<: *job-linux-8c
312+
<<: *job-linux-36c-codebuild
313313

314314
# The x86_64-gnu-llvm-20 job is split into multiple jobs to run tests in parallel.
315315
# x86_64-gnu-llvm-20-1 skips tests that run in x86_64-gnu-llvm-20-{2,3}.

src/ci/run.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
set -e
44

5+
# Change ownership of the given path to the user if the filesystem is writable
6+
change_ownership_if_writable() {
7+
local path=$1
8+
local owner="user:user"
9+
local current_owner
10+
current_owner=$(stat -f "%Su:%Sg" "$path" 2>/dev/null)
11+
12+
local test_file="$path/.write_test"
13+
# Test if filesystem is writable by attempting to touch a temporary file
14+
if touch "$test_file" 2>/dev/null; then
15+
# We wrote the file just for testing. We can remove it now.
16+
rm "$test_file"
17+
if [ "$current_owner" != "$owner" ]; then
18+
chown -R $owner "$path"
19+
fi
20+
else
21+
echo "$path is read-only, skipping ownership change"
22+
fi
23+
}
24+
525
if [ -n "$CI_JOB_NAME" ]; then
626
echo "[CI_JOB_NAME=$CI_JOB_NAME]"
727
fi
@@ -16,6 +36,12 @@ if [ "$NO_CHANGE_USER" = "" ]; then
1636
export HOME=/home/user
1737
unset LOCAL_USER_ID
1838

39+
# Give ownership of necessary directories to the user
40+
change_ownership_if_writable .
41+
mkdir -p /cargo
42+
change_ownership_if_writable /cargo
43+
change_ownership_if_writable /checkout
44+
1945
# Ensure that runners are able to execute git commands in the worktree,
2046
# overriding the typical git protections. In our docker container we're running
2147
# as root, while the user owning the checkout is not root.

0 commit comments

Comments
 (0)