Skip to content

Commit 9de0af2

Browse files
committed
fix: remove sudo from Darwin sccache setup
Removes sudo commands from Darwin self-hosted runner sccache configuration. The macOS self-hosted runners don't have sudo available, and the user already has the necessary permissions to create directories under /nix and modify /etc/nix/nix.conf.
1 parent df591de commit 9de0af2

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

.github/workflows/nix-build.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,12 @@ jobs:
139139
if: ${{ matrix.attr != '' && matrix.postgresql_version }}
140140
run: |
141141
# Ensure sccache directory is writable by the build user
142-
sudo mkdir -p /nix/var/cache/sccache
143-
sudo chown -R $(whoami) /nix/var/cache/sccache
144-
sudo chmod -R 755 /nix/var/cache/sccache
142+
mkdir -p /nix/var/cache/sccache
143+
chmod -R 755 /nix/var/cache/sccache
145144
146145
# Update Nix configuration to allow access to sccache directory in sandbox
147146
# Create temporary nix.conf with our additions
148-
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
147+
tee -a /etc/nix/nix.conf > /dev/null <<EOF
149148
extra-sandbox-paths = /nix/var/cache/sccache
150149
EOF
151150
- name: nix build
@@ -181,13 +180,12 @@ jobs:
181180
if: ${{ matrix.attr != '' && matrix.postgresql_version }}
182181
run: |
183182
# Ensure sccache directory is writable by the build user
184-
sudo mkdir -p /nix/var/cache/sccache
185-
sudo chown -R $(whoami) /nix/var/cache/sccache
186-
sudo chmod -R 755 /nix/var/cache/sccache
183+
mkdir -p /nix/var/cache/sccache
184+
chmod -R 755 /nix/var/cache/sccache
187185
188186
# Update Nix configuration to allow access to sccache directory in sandbox
189187
# Create temporary nix.conf with our additions
190-
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
188+
tee -a /etc/nix/nix.conf > /dev/null <<EOF
191189
extra-sandbox-paths = /nix/var/cache/sccache
192190
EOF
193191
- name: nix build

0 commit comments

Comments
 (0)