From 1ad4d1aafde97f0d0ef0f80ccf12b32f3a2e5329 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 16 Aug 2016 20:32:18 +0200 Subject: [PATCH 1/4] Require Go 1.6 or greater --- .travis.yml | 12 +++--------- README.md | 2 +- appveyor.yml | 4 ++-- build.go | 4 ++++ 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8fb856614..ca30a0443 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,8 @@ language: go sudo: false go: - - 1.3.3 - - 1.4.3 - - 1.5.4 - - 1.6.2 + - 1.6.3 + - 1.7 os: - linux @@ -14,11 +12,7 @@ os: matrix: exclude: - os: osx - go: 1.3.3 - - os: osx - go: 1.4.3 - - os: osx - go: 1.5.4 + go: 1.6.3 notifications: irc: diff --git a/README.md b/README.md index 5a90d0c17..2f40c4335 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ latest released version. Build restic ============ -Install Go/Golang (at least version 1.3), then run `go run build.go`, +Install Go/Golang (at least version 1.6), then run `go run build.go`, afterwards you'll find the binary in the current directory: $ go run build.go diff --git a/appveyor.yml b/appveyor.yml index 7b2720df0..b7f50492d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,8 +13,8 @@ init: install: - rmdir c:\go /s /q - - appveyor DownloadFile https://storage.googleapis.com/golang/go1.6.1.windows-amd64.msi - - msiexec /i go1.6.1.windows-amd64.msi /q + - appveyor DownloadFile https://storage.googleapis.com/golang/go1.7.windows-amd64.msi + - msiexec /i go1.7.windows-amd64.msi /q - go version - go env - appveyor DownloadFile http://sourceforge.netcologne.de/project/gnuwin32/tar/1.13-1/tar-1.13-1-bin.zip -FileName tar.zip diff --git a/build.go b/build.go index 9e9e595cd..166aee384 100644 --- a/build.go +++ b/build.go @@ -278,6 +278,10 @@ func (cs Constants) LDFlags() string { } func main() { + if runtime.Version() < "go1.6" { + fmt.Fprintf(os.Stderr, "old version of Go detected (%v), I'll try but no guarantees\n", runtime.Version()) + } + buildTags := []string{} skipNext := false From 2fa93b291a40a782ae10b5b7f5fb42be0f6c98e9 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 16 Aug 2016 20:51:31 +0200 Subject: [PATCH 2/4] Update default Go version in Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c3f40bcbf..b7035f842 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ FROM ubuntu:14.04 -ARG GOVERSION=1.6 +ARG GOVERSION=1.7 ARG GOARCH=amd64 # install dependencies From c88c48a29f68f1fbe245e1304df6e3a708ea2db0 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 16 Aug 2016 20:51:46 +0200 Subject: [PATCH 3/4] Do not build toolchain with gox for Go >= 1.5 --- run_integration_tests.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/run_integration_tests.go b/run_integration_tests.go index 7c727d743..3f98c64cd 100644 --- a/run_integration_tests.go +++ b/run_integration_tests.go @@ -191,8 +191,7 @@ func (env *TravisEnvironment) Prepare() error { msg("gox: OS/ARCH %v\n", env.goxOSArch) - v := runtime.Version() - if !strings.HasPrefix(v, "go1.5") && !strings.HasPrefix(v, "go1.6") { + if runtime.Version() < "go1.5" { err := run("gox", "-build-toolchain", "-osarch", strings.Join(env.goxOSArch, " ")) From 043424824c0616a30209518461e9fcd3b95f388f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 16 Aug 2016 21:02:30 +0200 Subject: [PATCH 4/4] Only test cross-compilation on Go 1.7 --- run_integration_tests.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_integration_tests.go b/run_integration_tests.go index 3f98c64cd..528d91917 100644 --- a/run_integration_tests.go +++ b/run_integration_tests.go @@ -168,7 +168,7 @@ func (env *TravisEnvironment) Prepare() error { } } - if *runCrossCompile { + if *runCrossCompile && !(runtime.Version() < "go1.7") { // only test cross compilation on linux with Travis if err := run("go", "get", "github.com/mitchellh/gox"); err != nil { return err @@ -317,7 +317,7 @@ func (env *TravisEnvironment) RunTests() error { env.env["GOPATH"] = cwd + ":" + filepath.Join(cwd, "vendor") - if *runCrossCompile { + if *runCrossCompile && !(runtime.Version() < "go1.7") { // compile for all target architectures with tags for _, tags := range []string{"release", "debug"} { runWithEnv(env.env, "gox", "-verbose",