mirror of
https://github.com/octoleo/restic.git
synced 2024-11-16 10:05:25 +00:00
Merge pull request #2600 from restic/update-go
Update Go version to >= 1.11, add Go 1.14
This commit is contained in:
commit
616f9499ae
20
.travis.yml
20
.travis.yml
@ -3,14 +3,6 @@ sudo: false
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
|
||||||
go: "1.10.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.11.x"
|
go: "1.11.x"
|
||||||
env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0
|
env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0
|
||||||
@ -27,9 +19,17 @@ matrix:
|
|||||||
- $HOME/.cache/go-build
|
- $HOME/.cache/go-build
|
||||||
- $HOME/gopath/pkg/mod
|
- $HOME/gopath/pkg/mod
|
||||||
|
|
||||||
# only run fuse and cloud backends tests on Travis for the latest Go on Linux
|
|
||||||
- os: linux
|
- os: linux
|
||||||
go: "1.13.x"
|
go: "1.13.x"
|
||||||
|
env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.cache/go-build
|
||||||
|
- $HOME/gopath/pkg/mod
|
||||||
|
|
||||||
|
# only run fuse and cloud backends tests on Travis for the latest Go on Linux
|
||||||
|
- os: linux
|
||||||
|
go: "1.14.x"
|
||||||
sudo: true
|
sudo: true
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
@ -37,7 +37,7 @@ matrix:
|
|||||||
- $HOME/gopath/pkg/mod
|
- $HOME/gopath/pkg/mod
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
go: "1.13.x"
|
go: "1.14.x"
|
||||||
env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0
|
env: RESTIC_TEST_FUSE=0 RESTIC_TEST_CLOUD_BACKENDS=0
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
@ -20,8 +20,8 @@ init:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- rmdir c:\go /s /q
|
- rmdir c:\go /s /q
|
||||||
- appveyor DownloadFile https://dl.google.com/go/go1.13.4.windows-amd64.msi
|
- appveyor DownloadFile https://dl.google.com/go/go1.14.windows-amd64.msi
|
||||||
- msiexec /i go1.13.4.windows-amd64.msi /q
|
- msiexec /i go1.14.windows-amd64.msi /q
|
||||||
- go version
|
- go version
|
||||||
- go env
|
- go env
|
||||||
- appveyor DownloadFile http://sourceforge.netcologne.de/project/gnuwin32/tar/1.13-1/tar-1.13-1-bin.zip -FileName tar.zip
|
- appveyor DownloadFile http://sourceforge.netcologne.de/project/gnuwin32/tar/1.13-1/tar-1.13-1-bin.zip -FileName tar.zip
|
||||||
|
2
build.go
2
build.go
@ -65,7 +65,7 @@ var config = Config{
|
|||||||
Main: "./cmd/restic", // package name for the main package
|
Main: "./cmd/restic", // package name for the main package
|
||||||
DefaultBuildTags: []string{"selfupdate"}, // specify build tags which are always used
|
DefaultBuildTags: []string{"selfupdate"}, // specify build tags which are always used
|
||||||
Tests: []string{"./..."}, // tests to run
|
Tests: []string{"./..."}, // tests to run
|
||||||
MinVersion: GoVersion{Major: 1, Minor: 10, Patch: 0}, // minimum Go version supported
|
MinVersion: GoVersion{Major: 1, Minor: 11, Patch: 0}, // minimum Go version supported
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config configures the build.
|
// Config configures the build.
|
||||||
|
6
changelog/unreleased/pull-2600
Normal file
6
changelog/unreleased/pull-2600
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Change: Require Go >= 1.11
|
||||||
|
|
||||||
|
Restic now requires Go to be at least 1.11. This allows simplifications in the
|
||||||
|
build process and removing workarounds.
|
||||||
|
|
||||||
|
https://github.com/restic/restic/pull/2600
|
@ -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.9. Building restic may also work with older versions of Go,
|
Go version 1.11. 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.
|
||||||
@ -261,13 +261,6 @@ In order to build restic from source, execute the following steps:
|
|||||||
|
|
||||||
$ go run -mod=vendor build.go
|
$ go run -mod=vendor build.go
|
||||||
|
|
||||||
For Go versions < 1.11, the option ``-mod=vendor`` needs to be removed, like
|
|
||||||
this:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ go run build.go
|
|
||||||
|
|
||||||
You can easily cross-compile restic for all supported platforms, just
|
You can easily cross-compile restic for all supported platforms, just
|
||||||
supply the target OS and platform via the command-line options like this
|
supply the target OS and platform via the command-line options like this
|
||||||
(for Windows and FreeBSD respectively):
|
(for Windows and FreeBSD respectively):
|
||||||
@ -280,8 +273,6 @@ supply the target OS and platform via the command-line options like this
|
|||||||
|
|
||||||
$ go run -mod=vendor build.go --goos linux --goarch arm --goarm 6
|
$ go run -mod=vendor build.go --goos linux --goarch arm --goarm 6
|
||||||
|
|
||||||
Again, for Go < 1.11 ``-mod=vendor`` needs to be removed.
|
|
||||||
|
|
||||||
The resulting binary is statically linked and does not require any
|
The resulting binary is statically linked and does not require any
|
||||||
libraries.
|
libraries.
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/debug"
|
"github.com/restic/restic/internal/debug"
|
||||||
)
|
)
|
||||||
@ -58,6 +59,26 @@ func (s *StdioConn) RemoteAddr() net.Addr {
|
|||||||
return Addr{}
|
return Addr{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetDeadline sets the read/write deadline.
|
||||||
|
func (s *StdioConn) SetDeadline(t time.Time) error {
|
||||||
|
err1 := s.stdin.SetReadDeadline(t)
|
||||||
|
err2 := s.stdout.SetWriteDeadline(t)
|
||||||
|
if err1 != nil {
|
||||||
|
return err1
|
||||||
|
}
|
||||||
|
return err2
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetReadDeadline sets the read/write deadline.
|
||||||
|
func (s *StdioConn) SetReadDeadline(t time.Time) error {
|
||||||
|
return s.stdin.SetReadDeadline(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetWriteDeadline sets the read/write deadline.
|
||||||
|
func (s *StdioConn) SetWriteDeadline(t time.Time) error {
|
||||||
|
return s.stdout.SetWriteDeadline(t)
|
||||||
|
}
|
||||||
|
|
||||||
// make sure StdioConn implements net.Conn
|
// make sure StdioConn implements net.Conn
|
||||||
var _ net.Conn = &StdioConn{}
|
var _ net.Conn = &StdioConn{}
|
||||||
|
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
// +build go1.10
|
|
||||||
|
|
||||||
package rclone
|
|
||||||
|
|
||||||
import "time"
|
|
||||||
|
|
||||||
// SetDeadline sets the read/write deadline.
|
|
||||||
func (s *StdioConn) SetDeadline(t time.Time) error {
|
|
||||||
err1 := s.stdin.SetReadDeadline(t)
|
|
||||||
err2 := s.stdout.SetWriteDeadline(t)
|
|
||||||
if err1 != nil {
|
|
||||||
return err1
|
|
||||||
}
|
|
||||||
return err2
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetReadDeadline sets the read/write deadline.
|
|
||||||
func (s *StdioConn) SetReadDeadline(t time.Time) error {
|
|
||||||
return s.stdin.SetReadDeadline(t)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetWriteDeadline sets the read/write deadline.
|
|
||||||
func (s *StdioConn) SetWriteDeadline(t time.Time) error {
|
|
||||||
return s.stdout.SetWriteDeadline(t)
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
// +build !go1.10
|
|
||||||
|
|
||||||
package rclone
|
|
||||||
|
|
||||||
import "time"
|
|
||||||
|
|
||||||
// On Go < 1.10, it's not possible to set read/write deadlines on files, so we just ignore that.
|
|
||||||
|
|
||||||
// SetDeadline sets the read/write deadline.
|
|
||||||
func (s *StdioConn) SetDeadline(t time.Time) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetReadDeadline sets the read/write deadline.
|
|
||||||
func (s *StdioConn) SetReadDeadline(t time.Time) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetWriteDeadline sets the read/write deadline.
|
|
||||||
func (s *StdioConn) SetWriteDeadline(t time.Time) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
@ -1,5 +1,3 @@
|
|||||||
// +build go1.9
|
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
// +build !go1.9
|
|
||||||
|
|
||||||
package test
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
// Helperer marks the current function as a test helper.
|
|
||||||
type Helperer interface {
|
|
||||||
Helper()
|
|
||||||
}
|
|
||||||
|
|
||||||
type fakeHelper struct{}
|
|
||||||
|
|
||||||
func (fakeHelper) Helper() {}
|
|
||||||
|
|
||||||
// Helper returns a function that marks the current function as a helper function.
|
|
||||||
func Helper(t testing.TB) Helperer {
|
|
||||||
return fakeHelper{}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user