Skip to content

Commit 9fca8e7

Browse files
committed
Auto merge of rust-lang#114206 - sethp:patch-1, r=Mark-Simulacrum
fix(ci): Ensure idempotence of user creation Previously, re-running `run.sh` in the same container would fail at the useradd step, because the user already exists. Instead, change that step to "create if not exists" semantics to ease interactive debugging of CI failures. Split out from rust-lang#111891 per request by `@jackh726`
2 parents 2aae331 + fff66a9 commit 9fca8e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88

99
if [ "$NO_CHANGE_USER" = "" ]; then
1010
if [ "$LOCAL_USER_ID" != "" ]; then
11-
useradd --shell /bin/bash -u $LOCAL_USER_ID -o -c "" -m user
11+
id -u user &>/dev/null || useradd --shell /bin/bash -u $LOCAL_USER_ID -o -c "" -m user
1212
export HOME=/home/user
1313
unset LOCAL_USER_ID
1414

0 commit comments

Comments
 (0)