2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 21:05:10 +00:00

Merge pull request #2852 from MichaelEischer/drop-go-1.11

Drop support for Go version 1.11
This commit is contained in:
rawtaz 2020-07-25 01:17:36 +02:00 committed by GitHub
commit 5d8d70542f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 71 deletions

View File

@ -3,14 +3,6 @@ sudo: false
matrix: matrix:
include: include:
- os: linux
go: "1.11.x"
env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
- os: linux - os: linux
go: "1.12.x" go: "1.12.x"
env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0 env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0

View File

@ -60,16 +60,11 @@ uploading it somewhere or post only the parts that are really relevant.
Development Environment Development Environment
======================= =======================
The repository contains several sets of directories with code: `cmd/` and The repository contains the code written for restic in the directories
`internal/` contain the code written for restic, whereas `vendor/` contains `cmd/` and `internal/`.
copies of libraries restic depends on. The libraries are managed with the
command `go mod vendor`.
Go >= 1.11 Restic requires Go version 1.12 or later for compiling. Clone the repo (without
---------- having `$GOPATH` set) and `cd` into the directory:
For Go version 1.11 or later, you should clone the repo (without having
`$GOPATH` set) and `cd` into the directory:
$ unset GOPATH $ unset GOPATH
$ git clone https://github.com/restic/restic $ git clone https://github.com/restic/restic
@ -79,40 +74,12 @@ Then use the `go` tool to build restic:
$ go build ./cmd/restic $ go build ./cmd/restic
$ ./restic version $ ./restic version
restic 0.9.2-dev (compiled manually) compiled with go1.11 on linux/amd64 restic 0.9.6-dev (compiled manually) compiled with go1.14 on linux/amd64
You can run all tests with the following command: You can run all tests with the following command:
$ go test ./... $ go test ./...
Go < 1.11
---------
In order to compile restic with Go before 1.11, it needs to be checked out at
the right path within a `GOPATH`. The concept of a `GOPATH` is explained in
["How to write Go code"](https://golang.org/doc/code.html).
If you do not have a directory with Go code yet, executing the following
instructions in your shell will create one for you and check out the restic
repo:
$ export GOPATH="$HOME/go"
$ mkdir -p "$GOPATH/src/github.com/restic"
$ cd "$GOPATH/src/github.com/restic"
$ git clone https://github.com/restic/restic
$ cd restic
You can then build restic as follows:
$ go build ./cmd/restic
$ ./restic version
restic compiled manually
compiled with go1.8.3 on linux/amd64
The following commands can be used to run all the tests:
$ go test ./...
Providing Patches Providing Patches
================= =================

View File

@ -3,7 +3,7 @@
// This program aims to make building Go programs for end users easier by just // This program aims to make building Go programs for end users easier by just
// calling it with `go run`, without having to setup a GOPATH. // calling it with `go run`, without having to setup a GOPATH.
// //
// This program needs Go >= 1.11. It'll use Go modules for compilation. It // This program needs Go >= 1.12. It'll use Go modules for compilation. It
// builds the package configured as Main in the Config struct. // builds the package configured as Main in the Config struct.
// BSD 2-Clause License // BSD 2-Clause License
@ -327,8 +327,8 @@ func (v GoVersion) String() string {
} }
func main() { func main() {
if !goVersion.AtLeast(GoVersion{1, 11, 0}) { if !goVersion.AtLeast(GoVersion{1, 12, 0}) {
die("Go version (%v) is too old, Go <= 1.11 does not support Go Modules\n", goVersion) die("Go version (%v) is too old, restic requires Go >= 1.12\n", goVersion)
} }
if !goVersion.AtLeast(config.MinVersion) { if !goVersion.AtLeast(config.MinVersion) {

View File

@ -1,6 +1,7 @@
Change: Require Go >= 1.11 Change: Require Go >= 1.12
Restic now requires Go to be at least 1.11. This allows simplifications in the Restic now requires Go to be at least 1.12. This allows simplifications in the
build process and removing workarounds. build process and removing workarounds.
https://github.com/restic/restic/pull/2600 https://github.com/restic/restic/pull/2600
https://github.com/restic/restic/pull/2852

View File

@ -245,7 +245,7 @@ From Source
*********** ***********
restic is written in the Go programming language and you need at least restic is written in the Go programming language and you need at least
Go version 1.11. Building restic may also work with older versions of Go, Go version 1.12. Building restic may also work with older versions of Go,
but that's not supported. See the `Getting but that's not supported. See the `Getting
started <https://golang.org/doc/install>`__ guide of the Go project for started <https://golang.org/doc/install>`__ guide of the Go project for
instructions how to install Go. instructions how to install Go.

View File

@ -1,4 +1,4 @@
// +build freebsd,go1.12 // +build freebsd
package restic package restic

View File

@ -1,17 +0,0 @@
// +build freebsd,!go1.12
package restic
import "syscall"
func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespec) error {
return nil
}
func (node Node) device() int {
return int(node.Device)
}
func (s statUnix) atim() syscall.Timespec { return s.Atimespec }
func (s statUnix) mtim() syscall.Timespec { return s.Mtimespec }
func (s statUnix) ctim() syscall.Timespec { return s.Ctimespec }

View File

@ -362,7 +362,7 @@ func (env *TravisEnvironment) RunTests() error {
return err return err
} }
} else { } else {
msg("Skipping gofmt and module vendor check for %v\n", v) msg("Skipping gofmt and mod tidy check for %v\n", v)
} }
if err = runGlyphcheck(); err != nil { if err = runGlyphcheck(); err != nil {