From 087c2917aaa6e3ac4c8b07591c2f398a75d8f2cc Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 9 Mar 2017 11:29:24 +0100 Subject: [PATCH 1/3] Check version in build.go Print a sensible error for Go < 1.7 (the "context" package is missing there) --- build.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.go b/build.go index ec5566093..8a041df94 100644 --- a/build.go +++ b/build.go @@ -291,6 +291,12 @@ func (cs Constants) LDFlags() string { } func main() { + ver := runtime.Version() + if strings.HasPrefix(ver, "go1") && ver < "go1.7" { + fmt.Fprintf(os.Stderr, "Go version %s detected, restic requires at least Go 1.7\n", ver) + os.Exit(1) + } + buildTags := []string{} skipNext := false From 7635feb5910e6308e532345173c7c6ee7a028859 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 9 Mar 2017 11:37:06 +0100 Subject: [PATCH 2/3] Add cross-compilation to README and Manual --- README.md | 10 ++++++++++ doc/Manual.md | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fe4c0edb..69811582a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,16 @@ afterwards you'll find the binary in the current directory: restic [OPTIONS] [...] +You can easily cross-compile restic for all supported platforms, just supply +the target OS and platform via the command-line options like this (for Windows +and FreeBSD respectively): + + $ go run build.go --goos windows --goarch amd64 + + $ go run build.go --goos freebsd --goarch 386 + +The resulting binary is statically linked and does not require any libraries. + More documentation can be found in the [user manual](doc/Manual.md). At the moment, the only tested compiler for restic is the official Go compiler. diff --git a/doc/Manual.md b/doc/Manual.md index 5f2a470ff..603640035 100644 --- a/doc/Manual.md +++ b/doc/Manual.md @@ -1,4 +1,4 @@ -Thanks for using restic. This document will give you an overview of the basic +nhanks for using restic. This document will give you an overview of the basic functionality provided by restic. # Installing restic @@ -43,6 +43,16 @@ $ cd restic $ go run build.go ``` +You can easily cross-compile restic for all supported platforms, just supply +the target OS and platform via the command-line options like this (for Windows +and FreeBSD respectively): + + $ go run build.go --goos windows --goarch amd64 + + $ go run build.go --goos freebsd --goarch 386 + +The resulting binary is statically linked and does not require any libraries. + At the moment, the only tested compiler for restic is the official Go compiler. Building restic with gccgo may work, but is not supported. From f678c9734655c140e0e2dbf184eb86379e888a0d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 11 Mar 2017 12:34:27 +0100 Subject: [PATCH 3/3] Add VERSION file for 0.5.0 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ebce39f53..8f0916f76 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.0-rc.1 +0.5.0