From bb9280ef9d5df4efc3c1cedebf98df27c2a73a41 Mon Sep 17 00:00:00 2001 From: Zhenyu Zheng Date: Thu, 2 Jun 2022 06:13:29 +0000 Subject: [PATCH] Remove gox usage Remove gox usage and add CGO_ENABLED=0 in Makefile Signed-off-by: Zhenyu Zheng --- Makefile | 17 ++--------------- README.md | 6 +++--- script/check_formatting.sh | 0 script/package.sh | 0 script/test_all.sh | 0 script/test_cockroach.sh | 0 script/update_homebrew.sh | 0 7 files changed, 5 insertions(+), 18 deletions(-) mode change 100644 => 100755 script/check_formatting.sh mode change 100644 => 100755 script/package.sh mode change 100644 => 100755 script/test_all.sh mode change 100644 => 100755 script/test_cockroach.sh mode change 100644 => 100755 script/update_homebrew.sh diff --git a/Makefile b/Makefile index e01e364..2e180c2 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,6 @@ usage: @echo "make setup : Install all necessary dependencies" @echo "make dev : Generate development build" @echo "make build : Generate production build for current OS" - @echo "make bootstrap : Install cross-compilation toolchain" @echo "make release : Generate binaries for all supported OSes" @echo "make test : Execute test suite" @echo "make test-all : Execute test suite on multiple PG versions" @@ -43,24 +42,12 @@ release: LDFLAGS += -X $(PKG)/pkg/command.GitCommit=$(GIT_COMMIT) release: LDFLAGS += -X $(PKG)/pkg/command.BuildTime=$(BUILD_TIME) release: LDFLAGS += -X $(PKG)/pkg/command.GoVersion=$(GO_VERSION) release: - @echo "Building binaries..." - @gox \ - -osarch "$(TARGETS)" \ - -ldflags "$(LDFLAGS)" \ - -output "./bin/openGauss-webclient_{{.OS}}_{{.Arch}}" - - @echo "Building ARM binaries..." - GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "$(LDFLAGS)" -o "./bin/openGauss-webclient_linux_arm_v5" - - @echo "Building ARM64 binaries..." - GOOS=linux GOARCH=arm64 GOARM=7 go build -ldflags "$(LDFLAGS)" -o "./bin/openGauss-webclient_linux_arm64_v7" + @echo "Building amd64 binaries..." + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o "./bin/openGauss-webclient_linux_amd64" @echo "\nPackaging binaries...\n" @./script/package.sh -bootstrap: - gox -build-toolchain - setup: go install github.com/mitchellh/gox@v1.0.1 diff --git a/README.md b/README.md index 4088604..c4264d0 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,10 @@ SESSIONS=1 openGauss-webclient ## Build from source -Go 1.7 is required. You can install Go with honebrew: +Go 1.7 is required. You can install Go with `DNF`: ``` -brew install go +dnf install -y golang ``` To compile source code run the following command: @@ -83,7 +83,7 @@ There's also a task to compile banaries for other operating system: make release ``` -Under the hood it uses gox. Compiled binaries will be stored into ./bin directory. +Compiled binaries will be stored into ./bin directory. ## Testing diff --git a/script/check_formatting.sh b/script/check_formatting.sh old mode 100644 new mode 100755 diff --git a/script/package.sh b/script/package.sh old mode 100644 new mode 100755 diff --git a/script/test_all.sh b/script/test_all.sh old mode 100644 new mode 100755 diff --git a/script/test_cockroach.sh b/script/test_cockroach.sh old mode 100644 new mode 100755 diff --git a/script/update_homebrew.sh b/script/update_homebrew.sh old mode 100644 new mode 100755 -- Gitee