Skip to content

Commit

Permalink
Ensure perms get fixed on crash too
Browse files Browse the repository at this point in the history
  • Loading branch information
supermario committed Oct 9, 2023
1 parent ef5dad3 commit b1f6fb5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion distribution/build-linux-arm64-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ build_binary_docker() {
local compilerRoot="/root/compiler"
cd $compilerRoot

cleanup() {
# Work around ownership issues that prevent GH actions from managing the files later
[ "$actions" == "true" ] && chown -R "$userId:$groupId" ./* || true
}
trap cleanup EXIT

git config --global --add safe.directory /root/compiler

# GOAL: get the cabal caches into the mounted folder so they persist outside the Docker run lifetime and we don't needlessly rebuild hundreds of super expensive deps repeatedly forever
Expand Down Expand Up @@ -83,7 +89,7 @@ build_binary_docker() {
strip "$bin"

# Work around ownership issues that prevent GH actions from managing the files later
[ "$actions" == "true" ] && chown -R "$userId:$groupId" ./*
[ "$actions" == "true" ] && chown -R "$userId:$groupId" ./* || true
}
declare -f build_binary_docker

Expand Down

0 comments on commit b1f6fb5

Please sign in to comment.