From f74a7d9ca9c817e4d222a33cac0913442b88d9b1 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 3 May 2021 21:44:48 +0200 Subject: [PATCH 1/9] Add GO111MODULE=off to build.sh --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index b5d465935..d6389a418 100755 --- a/build.sh +++ b/build.sh @@ -23,10 +23,11 @@ function build { exit 1 fi + # TODO: remove GO111MODULE once gh-ost uses Go modules echo "Building ${osname} binary" export GOOS export GOARCH - go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go + GO111MODULE=off go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go if [ $? -ne 0 ]; then echo "Build failed for ${osname}" From f5fa97c0b89c4ad71c9b7e2880b0c7adb31e4df6 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 3 May 2021 21:52:56 +0200 Subject: [PATCH 2/9] Use golang 1.16 --- .github/workflows/ci.yml | 4 ++-- Dockerfile.packaging | 2 +- Dockerfile.test | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf518ee57..84e8c043e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Go 1.15 + - name: Set up Go 1.16 uses: actions/setup-go@v1 with: - go-version: 1.15 + go-version: 1.16 - name: Build run: script/cibuild diff --git a/Dockerfile.packaging b/Dockerfile.packaging index 092fadee8..5252f67b9 100644 --- a/Dockerfile.packaging +++ b/Dockerfile.packaging @@ -1,6 +1,6 @@ # -FROM golang:1.15.6 +FROM golang:1.16 RUN apt-get update RUN apt-get install -y ruby ruby-dev rubygems build-essential diff --git a/Dockerfile.test b/Dockerfile.test index ceb46bf63..85e95d92c 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -FROM golang:1.15.6 +FROM golang:1.16 LABEL maintainer="github@github.com" RUN apt-get update From 857f030460dc1c943957ae46a1253fbda18823cc Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 3 May 2021 21:53:59 +0200 Subject: [PATCH 3/9] Update go version in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d496e08ac..c759c56a1 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d [Download latest release here](https://github.com/github/gh-ost/releases/latest) -`gh-ost` is a Go project; it is built with Go `1.14` and above. To build on your own, use either: +`gh-ost` is a Go project; it is built with Go `1.15` and above. To build on your own, use either: - [script/build](https://github.com/github/gh-ost/blob/master/script/build) - this is the same build script used by CI hence the authoritative; artifact is `./bin/gh-ost` binary. - [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost` From 39a82d6e94be6fd3a6aed4ab347d62097b033dc0 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 3 May 2021 21:56:30 +0200 Subject: [PATCH 4/9] Add missing GO111MODULE=off --- localtests/test.sh | 5 ++++- script/build | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/localtests/test.sh b/localtests/test.sh index d4b3f1723..aa0dc38dd 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -229,7 +229,10 @@ build_binary() { echo "Using binary: $ghost_binary" return 0 fi - go build -o $ghost_binary go/cmd/gh-ost/main.go + + # TODO: remove GO111MODULE once gh-ost uses Go modules + GO111MODULE=off go build -o $ghost_binary go/cmd/gh-ost/main.go + if [ $? -ne 0 ] ; then echo "Build failure" exit 1 diff --git a/script/build b/script/build index 24be5d17f..710748348 100755 --- a/script/build +++ b/script/build @@ -17,4 +17,5 @@ export GOPATH="$PWD/.gopath" cd .gopath/src/github.com/github/gh-ost # We put the binaries directly into the bindir, because we have no need for shim wrappers -go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go +# TODO: remove GO111MODULE once gh-ost uses Go modules +GO111MODULE=off go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go From 279822c56a1bafb208e465450cd245257fc1a2ae Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 3 May 2021 21:58:11 +0200 Subject: [PATCH 5/9] Add missing GO111MODULE=off again --- script/test | 3 ++- test.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/script/test b/script/test index 7e757b516..38e750553 100755 --- a/script/test +++ b/script/test @@ -13,5 +13,6 @@ script/build cd .gopath/src/github.com/github/gh-ost +# TODO: remove GO111MODULE once gh-ost uses Go modules echo "Running unit tests" -go test ./go/... +GO111MODULE=off go test ./go/... diff --git a/test.sh b/test.sh index ff514fa15..16095bf8f 100755 --- a/test.sh +++ b/test.sh @@ -5,7 +5,10 @@ retval=0 for testsuite in base mysql sql do pushd go/${testsuite} > /dev/null; - go test $*; + + # TODO: remove GO111MODULE once gh-ost uses Go modules + GO111MODULE=off go test $*; + [ $? -ne 0 ] && retval=1 popd > /dev/null; done From 084d3d0a36c02addeb1fbd8d7b7a111041f78dab Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 3 May 2021 22:12:50 +0200 Subject: [PATCH 6/9] Use go1.16.3 explicitly --- Dockerfile.packaging | 2 +- Dockerfile.test | 2 +- script/ensure-go-installed | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.packaging b/Dockerfile.packaging index 5252f67b9..3998d2c8b 100644 --- a/Dockerfile.packaging +++ b/Dockerfile.packaging @@ -1,6 +1,6 @@ # -FROM golang:1.16 +FROM golang:1.16.3 RUN apt-get update RUN apt-get install -y ruby ruby-dev rubygems build-essential diff --git a/Dockerfile.test b/Dockerfile.test index 85e95d92c..e0a18d1c4 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -FROM golang:1.16 +FROM golang:1.16.3 LABEL maintainer="github@github.com" RUN apt-get update diff --git a/script/ensure-go-installed b/script/ensure-go-installed index baa5bd7e6..5d03d9102 100755 --- a/script/ensure-go-installed +++ b/script/ensure-go-installed @@ -1,7 +1,7 @@ #!/bin/bash -PREFERRED_GO_VERSION=go1.14.7 -SUPPORTED_GO_VERSIONS='go1.1[456]' +PREFERRED_GO_VERSION=go1.16.3 +SUPPORTED_GO_VERSIONS='go1.1[56]' GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg GO_PKG_DARWIN_SHA=0f215de06019a054a3da46a0722989986c956d719c7a0a8fc38a5f3c216d6f6b From 8b2927a6bd549aa407ffdf2da17db714fa6a0c9d Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 24 May 2021 20:48:16 +0200 Subject: [PATCH 7/9] Use 1.16 for CI test --- .github/workflows/replica-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/replica-tests.yml b/.github/workflows/replica-tests.yml index bbc53a5f0..f1c887c18 100644 --- a/.github/workflows/replica-tests.yml +++ b/.github/workflows/replica-tests.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Go 1.14 + - name: Set up Go 1.16 uses: actions/setup-go@v1 with: - go-version: 1.14 + go-version: 1.16 - name: migration tests env: From abfa258d193ec4cc0ef04bea2ffdefbded009d8b Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 24 May 2021 20:50:17 +0200 Subject: [PATCH 8/9] Update min go version --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index bbd2571b0..ef24e81f4 100755 --- a/build.sh +++ b/build.sh @@ -18,8 +18,8 @@ function build { GOOS=$3 GOARCH=$4 - if ! go version | egrep -q 'go(1\.1[456])' ; then - echo "go version must be 1.14 or above" + if ! go version | egrep -q 'go(1\.1[56])' ; then + echo "go version must be 1.15 or above" exit 1 fi From 44c489eb6a1371c880ef8c4e4bf3d99c5691dca2 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Mon, 24 May 2021 20:53:35 +0200 Subject: [PATCH 9/9] Use go 1.16.4 --- Dockerfile.packaging | 4 +--- Dockerfile.test | 2 +- script/ensure-go-installed | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile.packaging b/Dockerfile.packaging index 3998d2c8b..64036b18e 100644 --- a/Dockerfile.packaging +++ b/Dockerfile.packaging @@ -1,6 +1,4 @@ -# - -FROM golang:1.16.3 +FROM golang:1.16.4 RUN apt-get update RUN apt-get install -y ruby ruby-dev rubygems build-essential diff --git a/Dockerfile.test b/Dockerfile.test index e0a18d1c4..3ba01267f 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -FROM golang:1.16.3 +FROM golang:1.16.4 LABEL maintainer="github@github.com" RUN apt-get update diff --git a/script/ensure-go-installed b/script/ensure-go-installed index 5d03d9102..473ba3828 100755 --- a/script/ensure-go-installed +++ b/script/ensure-go-installed @@ -1,6 +1,6 @@ #!/bin/bash -PREFERRED_GO_VERSION=go1.16.3 +PREFERRED_GO_VERSION=go1.16.4 SUPPORTED_GO_VERSIONS='go1.1[56]' GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg