From 2a6d2c3d516ad6103be8aa515513910420844d66 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 22 Sep 2022 14:38:58 +0200 Subject: [PATCH] Build hub without cgo --- cmds/hub/build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmds/hub/build b/cmds/hub/build index e73c3e7..055874e 100755 --- a/cmds/hub/build +++ b/cmds/hub/build @@ -43,16 +43,18 @@ if [[ "$BUILD_SOURCE" == "" ]]; then exit 1 fi -echo "Please notice, that this build script includes metadata into the build." -echo "This information is useful for debugging and license compliance." -echo "Run the compiled binary with the -version flag to see the information included." - +# set build options +export CGO_ENABLED=0 if [[ $1 == "dev" ]]; then shift export CGO_ENABLED=1 DEV="-race" fi +echo "Please notice, that this build script includes metadata into the build." +echo "This information is useful for debugging and license compliance." +echo "Run the compiled binary with the -version flag to see the information included." + # build BUILD_PATH="github.com/safing/portbase/info" go build $DEV -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $*