From 7b6c0d11ad15a240885bc62ffc3aa784c30214b8 Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Sun, 13 Oct 2019 16:39:38 -0700 Subject: [PATCH 1/7] Disable modules, run on osx --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d46e9a..b28e1e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,16 @@ git: env: - GO111MODULE=on - GO111MODULE=off -go: [ 1.11.x, 1.12.x, 1.13.x ] -os: [ linux, osx ] +go: [1.11.x, 1.12.x, 1.13.x] +os: [linux, osx] matrix: exclude: + - go: 1.11.x + env: GO111MODULE=off - go: 1.12.x env: GO111MODULE=off - - go: 1.11.x - os: osx + - go: 1.13.x + env: GO111MODULE=off install: - ./travis/install.sh - if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi From d30efdb30d2e4f712eafaba4c33f952d084e6720 Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Sun, 13 Oct 2019 16:39:54 -0700 Subject: [PATCH 2/7] go mod verify; go mod tidy --- go.mod | 3 ++- go.sum | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 12fdf98..9ea6e84 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,8 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/objx v0.1.1 // indirect github.com/stretchr/testify v1.2.2 golang.org/x/sys v0.0.0-20190422165155-953cdadca894 ) + +go 1.13 diff --git a/go.sum b/go.sum index 596c318..95a3f07 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= -github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 8ec9a493ec1b609038df0e3ecbae99540ee74fe3 Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Sun, 13 Oct 2019 16:47:33 -0700 Subject: [PATCH 3/7] Enable all of these to see what fails --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index b28e1e2..7fb79ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,14 +7,6 @@ env: - GO111MODULE=off go: [1.11.x, 1.12.x, 1.13.x] os: [linux, osx] -matrix: - exclude: - - go: 1.11.x - env: GO111MODULE=off - - go: 1.12.x - env: GO111MODULE=off - - go: 1.13.x - env: GO111MODULE=off install: - ./travis/install.sh - if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi From 75440f2ebeaade97af7e2cdc272dc9fde03f1f5b Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Sun, 13 Oct 2019 16:51:57 -0700 Subject: [PATCH 4/7] get some other deps --- .travis.yml | 7 ++++++- travis/cross_build.sh | 2 +- travis/install.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7fb79ff..02f520b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,12 @@ os: [linux, osx] install: - ./travis/install.sh - if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi - - if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi + - if [[ "$GO111MODULE" == "off" ]]; then go get \ + github.com/stretchr/testify/assert \ + golang.org/x/sys/unix \ + github.com/konsorten/go-windows-terminal-sequences \ + github.com/hashicorp/go-version \ + github.com/hashicorp/go-version; fi script: - ./travis/cross_build.sh - export GOMAXPROCS=4 diff --git a/travis/cross_build.sh b/travis/cross_build.sh index 545d8c3..1ba63ab 100755 --- a/travis/cross_build.sh +++ b/travis/cross_build.sh @@ -1,5 +1,5 @@ #!/bin/bash -if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then +if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then /tmp/gox/gox -build-lib -all fi diff --git a/travis/install.sh b/travis/install.sh index 07f4532..51b62a9 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -2,7 +2,7 @@ set -e -if [[ "$TRAVIS_GO_VERSION" =~ ^1.\12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then +if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git clone https://github.com/dgsb/gox.git /tmp/gox pushd /tmp/gox git checkout new_master From ad9f41a0cdcd21cf4238468bee74b9da7e103ef5 Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Sun, 13 Oct 2019 16:56:28 -0700 Subject: [PATCH 5/7] pull all the install into a single location --- .travis.yml | 7 ------- travis/install.sh | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 02f520b..8e24070 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,13 +9,6 @@ go: [1.11.x, 1.12.x, 1.13.x] os: [linux, osx] install: - ./travis/install.sh - - if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi - - if [[ "$GO111MODULE" == "off" ]]; then go get \ - github.com/stretchr/testify/assert \ - golang.org/x/sys/unix \ - github.com/konsorten/go-windows-terminal-sequences \ - github.com/hashicorp/go-version \ - github.com/hashicorp/go-version; fi script: - ./travis/cross_build.sh - export GOMAXPROCS=4 diff --git a/travis/install.sh b/travis/install.sh index 51b62a9..eaa511a 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -9,3 +9,12 @@ if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; go build ./ popd fi + +if [[ "$GO111MODULE" == "on" ]]; then + go mod download +fi + +if [[ "$GO111MODULE" == "off" ]]; then + go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences + go get github.com/hashicorp/go-version github.com/hashicorp/go-version +fi From 08cf62cb808b9359a35cd5fac4ee648c9ef836f6 Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Sun, 13 Oct 2019 17:02:25 -0700 Subject: [PATCH 6/7] This should make gox a little nicer --- travis/cross_build.sh | 2 +- travis/install.sh | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/travis/cross_build.sh b/travis/cross_build.sh index 1ba63ab..824b4ee 100755 --- a/travis/cross_build.sh +++ b/travis/cross_build.sh @@ -1,5 +1,5 @@ #!/bin/bash if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - /tmp/gox/gox -build-lib -all + $(go env GOPATH)/bin/gox -build-lib fi diff --git a/travis/install.sh b/travis/install.sh index eaa511a..70aa0a4 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -3,11 +3,7 @@ set -e if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - git clone https://github.com/dgsb/gox.git /tmp/gox - pushd /tmp/gox - git checkout new_master - go build ./ - popd + GO111MODULE=off go get github.com/dgsb/gox fi if [[ "$GO111MODULE" == "on" ]]; then @@ -16,5 +12,4 @@ fi if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences - go get github.com/hashicorp/go-version github.com/hashicorp/go-version fi From 68e6dbbcb759e28b9277cfcbe620bf2f25ab0d0c Mon Sep 17 00:00:00 2001 From: Edward Muller Date: Sun, 13 Oct 2019 17:25:32 -0700 Subject: [PATCH 7/7] Exclude go1.13.x from modules off, only build all on go1.13 modules on --- .travis.yml | 4 ++++ travis/cross_build.sh | 2 +- travis/install.sh | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e24070..8bfc4f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,10 @@ env: - GO111MODULE=off go: [1.11.x, 1.12.x, 1.13.x] os: [linux, osx] +matrix: + exclude: + - go: 1.13.x + env: GO111MODULE=off ## Modules are the default now. install: - ./travis/install.sh script: diff --git a/travis/cross_build.sh b/travis/cross_build.sh index 824b4ee..5254435 100755 --- a/travis/cross_build.sh +++ b/travis/cross_build.sh @@ -1,5 +1,5 @@ #!/bin/bash -if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then +if [[ "$TRAVIS_GO_VERSION" =~ ^1\.13\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$GO111MODULE" == "on" ]]; then $(go env GOPATH)/bin/gox -build-lib fi diff --git a/travis/install.sh b/travis/install.sh index 70aa0a4..127ac8b 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -2,7 +2,8 @@ set -e -if [[ "$TRAVIS_GO_VERSION" =~ ^1\.12\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then +# Only do this for go1.12 when modules are on so that it doesn't need to be done when modules are off as well. +if [[ "$TRAVIS_GO_VERSION" =~ ^1\.13\. ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$GO111MODULE" == "on" ]]; then GO111MODULE=off go get github.com/dgsb/gox fi @@ -11,5 +12,6 @@ if [[ "$GO111MODULE" == "on" ]]; then fi if [[ "$GO111MODULE" == "off" ]]; then - go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences + # Should contain all regular (not indirect) modules from go.mod + go get github.com/stretchr/testify golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences fi