Skip to content

Commit 9800e19

Browse files
authored
Merge pull request #13527 from ethereum/git-safe-directory-workaround
Add git `safe.directory` workaround in emscripten build script
2 parents b205fe8 + 9dbc3e0 commit 9800e19

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

scripts/build_emscripten.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ else
3535
fi
3636

3737
# solbuildpackpusher/solidity-buildpack-deps:emscripten-13
38+
# NOTE: Without `safe.directory` git would assume it's not safe to operate on /root/project since it's owned by a different user.
39+
# See https://github.blog/2022-04-12-git-security-vulnerability-announced/
3840
docker run -v "$(pwd):/root/project" -w /root/project \
3941
solbuildpackpusher/solidity-buildpack-deps@sha256:f1c13f3450d1f2e53ea18ac1ac1a17e932573cb9a5ccd0fd9ef6dd44f6402fa9 \
40-
./scripts/ci/build_emscripten.sh "$BUILD_DIR"
42+
/bin/bash -c "git config --global --add safe.directory /root/project && ./scripts/ci/build_emscripten.sh $BUILD_DIR"

scripts/ci/build_emscripten.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ else
4040
BUILD_DIR="$1"
4141
fi
4242

43-
apt-get update
44-
apt-get install lz4 --no-install-recommends
45-
4643
WORKSPACE=/root/project
4744

48-
cd $WORKSPACE
45+
cd "$WORKSPACE"
4946

5047
# shellcheck disable=SC2166
5148
if [[ "$CIRCLE_BRANCH" = release || -n "$CIRCLE_TAG" || -n "$FORCE_RELEASE" || "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]

0 commit comments

Comments
 (0)