[llvm] [Github] Default to non-root user in linux CI container (PR #119987)

via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 14:32:50 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-github-workflow

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

This patch sets the default user in the linux CI container to a non-root user, which enables properly testing a couple of features, particularly in libcxx.

---
Full diff: https://github.com/llvm/llvm-project/pull/119987.diff


1 Files Affected:

- (modified) .github/workflows/containers/github-action-ci/Dockerfile (+7) 


``````````diff
diff --git a/.github/workflows/containers/github-action-ci/Dockerfile b/.github/workflows/containers/github-action-ci/Dockerfile
index da11803cad1042..0e560f6bfc5fff 100644
--- a/.github/workflows/containers/github-action-ci/Dockerfile
+++ b/.github/workflows/containers/github-action-ci/Dockerfile
@@ -60,3 +60,10 @@ RUN apt-get update && \
 
 ENV LLVM_SYSROOT=$LLVM_SYSROOT
 ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
+
+# Create a new user to avoid test failures related to a lack of expected
+# permissions issues in some tests. Set the user id to 1001 as that is the
+# user id that Github Actions uses to perform the checkout action.
+RUN useradd gha -u 1001 -m -s /bin/bash
+USER gha
+

``````````

</details>


https://github.com/llvm/llvm-project/pull/119987


More information about the llvm-commits mailing list