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:
parent
8d2996eaaa
commit
8b758c78a3
5
.github/workflows/tests.yml
vendored
5
.github/workflows/tests.yml
vendored
@ -45,11 +45,6 @@ jobs:
|
||||
os: ubuntu-latest
|
||||
test_fuse: true
|
||||
|
||||
- job_name: Linux
|
||||
go: 1.13.x
|
||||
os: ubuntu-latest
|
||||
test_fuse: true
|
||||
|
||||
name: ${{ matrix.job_name }} Go ${{ matrix.go }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
@ -66,7 +66,7 @@ Development Environment
|
||||
The repository contains the code written for restic in the directories
|
||||
`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:
|
||||
|
||||
$ unset GOPATH
|
||||
|
14
build.go
14
build.go
@ -35,6 +35,7 @@
|
||||
// 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.
|
||||
|
||||
//go:build ignore_build_go
|
||||
// +build ignore_build_go
|
||||
|
||||
package main
|
||||
@ -123,17 +124,8 @@ func printEnv(env []string) {
|
||||
|
||||
// build runs "go build args..." with GOPATH set to gopath.
|
||||
func build(cwd string, env map[string]string, args ...string) error {
|
||||
a := []string{"build"}
|
||||
|
||||
// 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))
|
||||
}
|
||||
// -trimpath removes all absolute paths from the binary.
|
||||
a := []string{"build", "-trimpath"}
|
||||
|
||||
if enablePIE {
|
||||
a = append(a, "-buildmode=pie")
|
||||
|
6
changelog/unreleased/pull-3519
Normal file
6
changelog/unreleased/pull-3519
Normal 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
|
@ -255,7 +255,7 @@ From Source
|
||||
***********
|
||||
|
||||
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
|
||||
started <https://golang.org/doc/install>`__ guide of the Go project for
|
||||
instructions how to install Go.
|
||||
|
Loading…
Reference in New Issue
Block a user