diff --git a/.travis.yml b/.travis.yml index 971e0285b6..0c29ac594a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,23 +5,27 @@ matrix: include: - os: linux dist: trusty - go: 1.5.4 - env: - - GO15VENDOREXPERIMENT=1 + go: 1.7.5 + + # These are the latest Go versions, only run go vet and misspell on these - os: linux dist: trusty - go: 1.6.2 - - os: linux - dist: trusty - go: 1.7.4 + go: 1.8 + script: + - go run build/ci.go install + - go run build/ci.go test -coverage -vet -misspell + - os: osx - go: 1.7.4 + go: 1.8 + script: + - go run build/ci.go install + - go run build/ci.go test -coverage -vet -misspell # This builder does the Ubuntu PPA and Linux Azure uploads - os: linux dist: trusty sudo: required - go: 1.7.4 + go: 1.8 env: - ubuntu-ppa - azure-linux @@ -90,7 +94,7 @@ matrix: # This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads - os: osx - go: 1.7.4 + go: 1.8 env: - azure-osx - azure-ios diff --git a/README.md b/README.md index e7e88468f1..347ac0c631 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ For prerequisites and detailed build instructions please read the [Ethereum's In *Note*: Keep in mind that Ubiq aims to be 100% compatible with Ethereum, so mostly all the documentation you can find on Ethereum wiki, will apply for sure to Ubiq. -Building gubiq requires both a Go and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run +Building gubiq requires both a Go and a C compiler (version 1.7 or later). You can install them using your favourite package manager. Once the dependencies are installed, run make gubiq diff --git a/build/ci.go b/build/ci.go index 578c7b27ee..b9872b51bd 100644 --- a/build/ci.go +++ b/build/ci.go @@ -157,11 +157,17 @@ func doInstall(cmdline []string) { // Check Go version. People regularly open issues about compilation // failure with outdated Go. This should save them the trouble. - if runtime.Version() < "go1.4" && !strings.HasPrefix(runtime.Version(), "devel") { - log.Println("You have Go version", runtime.Version()) - log.Println("go-ubiq requires at least Go version 1.4 and cannot") - log.Println("be compiled with an earlier version. Please upgrade your Go installation.") - os.Exit(1) + if !strings.Contains(runtime.Version(), "devel") { + // Figure out the minor version number since we can't textually compare (1.10 < 1.7) + var minor int + fmt.Sscanf(strings.TrimPrefix(runtime.Version(), "go1."), "%d", &minor) + + if minor < 7 { + log.Println("You have Go version", runtime.Version()) + log.Println("go-ethereum requires at least Go version 1.7 and cannot") + log.Println("be compiled with an earlier version. Please upgrade your Go installation.") + os.Exit(1) + } } // Compile packages given as arguments, or everything if there are no arguments. packages := []string{"./..."} @@ -214,16 +220,9 @@ func buildFlags(env build.Environment) (flags []string) { flags = append(flags, "-tags", "opencl") } - // Since Go 1.5, the separator char for link time assignments - // is '=' and using ' ' prints a warning. However, Go < 1.5 does - // not support using '='. - sep := " " - if runtime.Version() > "go1.5" || strings.Contains(runtime.Version(), "devel") { - sep = "=" - } // Set gitCommit constant via link-time assignment. if env.Commit != "" { - flags = append(flags, "-ldflags", "-X main.gitCommit"+sep+env.Commit) + flags = append(flags, "-ldflags", "-X main.gitCommit="+env.Commit) } return flags } @@ -240,14 +239,14 @@ func goToolArch(arch string, subcmd string, args ...string) *exec.Cmd { if subcmd == "build" || subcmd == "install" || subcmd == "test" { // Go CGO has a Windows linker error prior to 1.8 (https://github.com/golang/go/issues/8756). // Work around issue by allowing multiple definitions for <1.8 builds. - if runtime.GOOS == "windows" && runtime.Version() < "go1.8" { + var minor int + fmt.Sscanf(strings.TrimPrefix(runtime.Version(), "go1."), "%d", &minor) + + if runtime.GOOS == "windows" && minor < 8 { cmd.Args = append(cmd.Args, []string{"-ldflags", "-extldflags -Wl,--allow-multiple-definition"}...) } } - cmd.Env = []string{ - "GO15VENDOREXPERIMENT=1", - "GOPATH=" + build.GOPATH(), - } + cmd.Env = []string{"GOPATH=" + build.GOPATH()} if arch == "" || arch == runtime.GOARCH { cmd.Env = append(cmd.Env, "GOBIN="+GOBIN) } else { diff --git a/build/env.sh b/build/env.sh index 089ca1c2a2..31f171d39d 100755 --- a/build/env.sh +++ b/build/env.sh @@ -20,8 +20,7 @@ fi # Set up the environment to use the workspace. GOPATH="$workspace" -GO15VENDOREXPERIMENT=1 -export GOPATH GO15VENDOREXPERIMENT +export GOPATH # Run the command inside the workspace. cd "$ethdir/go-ubiq"