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

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 14:00:10 PST 2024


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

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.

>From 2f27ace11567ffe335c58297a766876f373db43f Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sat, 14 Dec 2024 21:58:15 +0000
Subject: [PATCH] [Github] Default to non-root user in linux CI container

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.
---
 .github/workflows/containers/github-action-ci/Dockerfile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/.github/workflows/containers/github-action-ci/Dockerfile b/.github/workflows/containers/github-action-ci/Dockerfile
index da11803cad1042..dbace84447b4af 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 -s /bin/bash
+USER gha
+



More information about the llvm-commits mailing list