Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GO111MODULE=off to build.sh, use Golang 1.16 #966

Merged
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/replica-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile.packaging
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#

FROM golang:1.15.6
FROM golang:1.16.4

RUN apt-get update
RUN apt-get install -y ruby ruby-dev rubygems build-essential
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15.6
FROM golang:1.16.4
LABEL maintainer="[email protected]"

RUN apt-get update
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
7 changes: 4 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ 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

# 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}"
Expand Down
5 changes: 4 additions & 1 deletion localtests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,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
Expand Down
3 changes: 2 additions & 1 deletion script/build
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions script/ensure-go-installed
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

PREFERRED_GO_VERSION=go1.14.7
SUPPORTED_GO_VERSIONS='go1.1[456]'
PREFERRED_GO_VERSION=go1.16.4
SUPPORTED_GO_VERSIONS='go1.1[56]'

GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg
GO_PKG_DARWIN_SHA=0f215de06019a054a3da46a0722989986c956d719c7a0a8fc38a5f3c216d6f6b
Expand Down
3 changes: 2 additions & 1 deletion script/test
Original file line number Diff line number Diff line change
Expand Up @@ -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/...
5 changes: 4 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down