2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

Require Go 1.14 to build

This commit is contained in:
greatroar 2021-09-19 15:57:43 +02:00
parent 8d2996eaaa
commit 8b758c78a3
6 changed files with 12 additions and 19 deletions

View File

@ -45,11 +45,6 @@ jobs:
os: ubuntu-latest os: ubuntu-latest
test_fuse: true test_fuse: true
- job_name: Linux
go: 1.13.x
os: ubuntu-latest
test_fuse: true
name: ${{ matrix.job_name }} Go ${{ matrix.go }} name: ${{ matrix.job_name }} Go ${{ matrix.go }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

View File

@ -66,7 +66,7 @@ Development Environment
The repository contains the code written for restic in the directories The repository contains the code written for restic in the directories
`cmd/` and `internal/`. `cmd/` and `internal/`.
Restic requires Go version 1.13 or later for compiling. Clone the repo (without Restic requires Go version 1.14 or later for compiling. Clone the repo (without
having `$GOPATH` set) and `cd` into the directory: having `$GOPATH` set) and `cd` into the directory:
$ unset GOPATH $ unset GOPATH

View File

@ -35,6 +35,7 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//go:build ignore_build_go
// +build ignore_build_go // +build ignore_build_go
package main package main
@ -123,17 +124,8 @@ func printEnv(env []string) {
// build runs "go build args..." with GOPATH set to gopath. // build runs "go build args..." with GOPATH set to gopath.
func build(cwd string, env map[string]string, args ...string) error { func build(cwd string, env map[string]string, args ...string) error {
a := []string{"build"} // -trimpath removes all absolute paths from the binary.
a := []string{"build", "-trimpath"}
// try to remove all absolute paths from resulting binary
if goVersion.AtLeast(GoVersion{1, 13, 0}) {
// use the new flag introduced by Go 1.13
a = append(a, "-trimpath")
} else {
// otherwise try to trim as many paths as possible
a = append(a, "-asmflags", fmt.Sprintf("all=-trimpath=%s", cwd))
a = append(a, "-gcflags", fmt.Sprintf("all=-trimpath=%s", cwd))
}
if enablePIE { if enablePIE {
a = append(a, "-buildmode=pie") a = append(a, "-buildmode=pie")

View File

@ -0,0 +1,6 @@
Change: Require Go 1.14 or newer
Restic now requires Go 1.14 to build. This allows it to use new
standard library features instead of an external dependency.
https://github.com/restic/restic/issues/3519

View File

@ -255,7 +255,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.13. Building restic may also work with older versions of Go, Go version 1.14. 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.

2
go.mod
View File

@ -36,4 +36,4 @@ require (
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
) )
go 1.13 go 1.14