Skip to content

Commit fdd6c20

Browse files
committed
ci: drop --user on musl docker build (caused /root/.cargo permission denied)
The messense/rust-musl-cross images expect to run as root so cargo can write to /root/.cargo. Overriding the container user to match the host UID broke cargo's registry cache with 'Permission denied' before a single file compiled. Drop the flag and chown the target/ tree after the build instead.
1 parent 6c5b62e commit fdd6c20

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,18 @@ jobs:
9696
- name: Build CLI (musl via docker)
9797
if: matrix.target == 'x86_64-unknown-linux-musl'
9898
run: |
99-
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD":/src -w /src \
99+
docker run --rm -v "$PWD":/src -w /src \
100100
messense/rust-musl-cross:x86_64-musl \
101101
cargo build --release --target x86_64-unknown-linux-musl --bin mhrv-rs
102+
sudo chown -R "$(id -u):$(id -g)" target
102103
103104
- name: Build CLI (musl via docker, arm64)
104105
if: matrix.target == 'aarch64-unknown-linux-musl'
105106
run: |
106-
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD":/src -w /src \
107+
docker run --rm -v "$PWD":/src -w /src \
107108
messense/rust-musl-cross:aarch64-musl \
108109
cargo build --release --target aarch64-unknown-linux-musl --bin mhrv-rs
110+
sudo chown -R "$(id -u):$(id -g)" target
109111
110112
# UI build: we try to build the UI binary on every platform. If it fails
111113
# on cross-compile for linux-arm64 (missing arm64 system libs cross),

0 commit comments

Comments
 (0)