Skip to content

Commit 8f42ded

Browse files
Add GO111MODULE=off to build.sh, use Golang 1.16 (#966)
* Add GO111MODULE=off to build.sh * Use golang 1.16 * Update go version in README.md * Add missing GO111MODULE=off * Add missing GO111MODULE=off again * Use go1.16.3 explicitly * Use 1.16 for CI test * Update min go version * Use go 1.16.4
1 parent 36c669d commit 8f42ded

File tree

11 files changed

+25
-18
lines changed

11 files changed

+25
-18
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212

13-
- name: Set up Go 1.15
13+
- name: Set up Go 1.16
1414
uses: actions/setup-go@v1
1515
with:
16-
go-version: 1.15
16+
go-version: 1.16
1717

1818
- name: Build
1919
run: script/cibuild

.github/workflows/replica-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515

16-
- name: Set up Go 1.14
16+
- name: Set up Go 1.16
1717
uses: actions/setup-go@v1
1818
with:
19-
go-version: 1.14
19+
go-version: 1.16
2020

2121
- name: migration tests
2222
env:

Dockerfile.packaging

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#
2-
3-
FROM golang:1.15.6
1+
FROM golang:1.16.4
42

53
RUN apt-get update
64
RUN apt-get install -y ruby ruby-dev rubygems build-essential

Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.15.6
1+
FROM golang:1.16.4
22
LABEL maintainer="[email protected]"
33

44
RUN apt-get update

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d
9595

9696
[Download latest release here](https://github.com/github/gh-ost/releases/latest)
9797

98-
`gh-ost` is a Go project; it is built with Go `1.14` and above. To build on your own, use either:
98+
`gh-ost` is a Go project; it is built with Go `1.15` and above. To build on your own, use either:
9999
- [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.
100100
- [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost`
101101

build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ function build {
1818
GOOS=$3
1919
GOARCH=$4
2020

21-
if ! go version | egrep -q 'go(1\.1[456])' ; then
22-
echo "go version must be 1.14 or above"
21+
if ! go version | egrep -q 'go(1\.1[56])' ; then
22+
echo "go version must be 1.15 or above"
2323
exit 1
2424
fi
2525

26+
# TODO: remove GO111MODULE once gh-ost uses Go modules
2627
echo "Building ${osname} binary"
2728
export GOOS
2829
export GOARCH
29-
go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go
30+
GO111MODULE=off go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go
3031

3132
if [ $? -ne 0 ]; then
3233
echo "Build failed for ${osname}"

localtests/test.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ build_binary() {
242242
echo "Using binary: $ghost_binary"
243243
return 0
244244
fi
245-
go build -o $ghost_binary go/cmd/gh-ost/main.go
245+
246+
# TODO: remove GO111MODULE once gh-ost uses Go modules
247+
GO111MODULE=off go build -o $ghost_binary go/cmd/gh-ost/main.go
248+
246249
if [ $? -ne 0 ] ; then
247250
echo "Build failure"
248251
exit 1

script/build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export GOPATH="$PWD/.gopath"
1717
cd .gopath/src/github.com/github/gh-ost
1818

1919
# We put the binaries directly into the bindir, because we have no need for shim wrappers
20-
go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go
20+
# TODO: remove GO111MODULE once gh-ost uses Go modules
21+
GO111MODULE=off go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go

script/ensure-go-installed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
PREFERRED_GO_VERSION=go1.14.7
4-
SUPPORTED_GO_VERSIONS='go1.1[456]'
3+
PREFERRED_GO_VERSION=go1.16.4
4+
SUPPORTED_GO_VERSIONS='go1.1[56]'
55

66
GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg
77
GO_PKG_DARWIN_SHA=0f215de06019a054a3da46a0722989986c956d719c7a0a8fc38a5f3c216d6f6b

script/test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ script/build
1313

1414
cd .gopath/src/github.com/github/gh-ost
1515

16+
# TODO: remove GO111MODULE once gh-ost uses Go modules
1617
echo "Running unit tests"
17-
go test ./go/...
18+
GO111MODULE=off go test ./go/...

0 commit comments

Comments
 (0)