Skip to content

Commit

Permalink
Auto merge of rust-lang#114206 - sethp:patch-1, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
bors committed Aug 7, 2023
2 parents 2aae331 + fff66a9 commit 9fca8e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi

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

Expand Down

0 comments on commit 9fca8e7

Please sign in to comment.