Skip to content

Commit

Permalink
build: require Go >= 1.7
Browse files Browse the repository at this point in the history
We have decided to bump the requirement to Go 1.7 because it enables
subtests and allows dropping backwards-compatibility code. This is in
line with Go's support policy. Go 1.6 and earlier no longer receive
security updates.
  • Loading branch information
fjl committed Mar 22, 2017
1 parent 6742fc5 commit da7af44
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 25 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ go_import_path: github.com/ethereum/go-ethereum
sudo: false
matrix:
include:
- os: linux
dist: trusty
go: 1.5.4
env:
- GO15VENDOREXPERIMENT=1
- os: linux
dist: trusty
go: 1.6.2
- os: linux
dist: trusty
go: 1.7.5
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For prerequisites and detailed build instructions please read the
[Installation Instructions](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum)
on the wiki.

Building geth requires both a Go and a C compiler.
Building geth requires both a Go (version 1.7 or later) and a C compiler.
You can install them using your favourite package manager.
Once the dependencies are installed, run

Expand Down
18 changes: 4 additions & 14 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ 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") {
if runtime.Version() < "go1.7" && !strings.HasPrefix(runtime.Version(), "devel") {
log.Println("You have Go version", runtime.Version())
log.Println("go-ethereum requires at least Go version 1.4 and cannot")
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)
}
Expand Down Expand Up @@ -219,16 +219,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
}
Expand All @@ -249,10 +242,7 @@ func goToolArch(arch string, subcmd string, args ...string) *exec.Cmd {
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 {
Expand Down
3 changes: 1 addition & 2 deletions build/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-ethereum"
Expand Down

0 comments on commit da7af44

Please sign in to comment.