From 7c4fc5c9b9ad39167dd31859d832a5c9ff1b5755 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sat, 23 Apr 2022 04:32:37 +0800 Subject: [PATCH] Fixes docker build on Linux Fixes #230 Signed-off-by: Yonggang Luo --- docker_build.sh | 2 ++ version.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/docker_build.sh b/docker_build.sh index e75448f..eab00f3 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -1,4 +1,6 @@ #!/usr/bin/env sh set -e +echo "Building the docker" docker build -t wasi-sdk-builder:latest . +echo "Building the package in docker" docker run --mount type=bind,src=$PWD,target=/workspace -e NINJA_FLAGS=-v --workdir /workspace wasi-sdk-builder:latest make package diff --git a/version.sh b/version.sh index 8e7c44c..35c8a90 100755 --- a/version.sh +++ b/version.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -e +git config --global --add safe.directory "/workspace" GIT_DESCR=$(git describe --long --candidates=999 --match='wasi-sdk-*' --dirty='+m' --abbrev=12) GIT_PACKAGE_VERSION=$(echo $GIT_DESCR | perl -ne 'if(/^wasi-sdk-(\d+)-(\d+)-g([0-9a-f]{7,12})([+]m)?$/) { if($2 == 0) { print "$1.$2$4" } else { print "$1.$2g$3$4" } exit } else { print "could not parse git description"; exit 1 }';) echo $GIT_PACKAGE_VERSION