From 59e555622eb173f15fa9476d3922e3bb4b82a166 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 8 Mar 2024 15:10:09 -0800 Subject: [PATCH] fix: ensure we can access git information from within Docker --- docker_build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker_build.sh b/docker_build.sh index 38845277f..2907ecaeb 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -1,7 +1,14 @@ #!/bin/sh set -ex + echo "Building the docker image" docker build -t wasi-sdk-builder:latest . + +if ! git config safe.directory | grep --quiet /workspace; then + echo "Setting up Git safe directory" + git config --global --add safe.directory /workspace +fi + echo "Building the package in docker image" mkdir -p ~/.ccache docker run --rm -v "$PWD":/workspace -v ~/.ccache:/root/.ccache -e NINJA_FLAGS=-v --workdir /workspace --tmpfs /tmp:exec wasi-sdk-builder:latest make package LLVM_CMAKE_FLAGS=-DLLVM_CCACHE_BUILD=ON