Commit Graph

56 Commits

Author SHA1 Message Date
Alexander Neumann 604b18aa74 build: Fix building in ~/go
Before, build.go only unset GO111MODULE and GOPATH, so the Go compiler
did not see either and worked in Module mode. But if the code is checked
out below ~/go (the default GOPATH), it will detect that the source is
within GOPATH and switch to non-Module mode. Now we're setting
GO111MODULE to "on" explicitly.
2019-07-29 09:22:22 +02:00
Simon Beck cc8b690b52 Restore whole folder to sdtout as tar
With this change it is possible to dump a folder to stdout as a tar. The

It can be used just like the normal dump command:

`./restic dump fa97e6e1 "/data/test/" > test.tar`

Where `/data/test/` is a a folder instead of a file.
2019-04-22 20:44:33 +02:00
Alexander Neumann 0cb241b7d3 Remove build tag `release` 2018-10-11 19:40:38 +02:00
Alexander Neumann 4734056583 build.go: Major rework, support Go modules 2018-08-31 22:00:47 +02:00
Alexander Neumann 16e20676b6 build.go: Set GOPROXY=off 2018-08-31 21:10:26 +02:00
Alexander Neumann d31666d332 build.go: Don't ignore error 2018-08-31 19:51:48 +02:00
Alexander Neumann 6e1a3987b7 Add 'self-update' command
This commit adds a command called `self-update` which downloads the
latest released version of restic from GitHub and replacing the current
binary with it. It does not rely on any external program (so it'll work
everywhere), but still verifies the GPG signature using the embedded GPG
public key.

By default, the `self-update` command is hidden behind the `selfupdate`
built tag, which is only set when restic is built using `build.go`. The
reason for this is that downstream distributions will then not include
the command by default, so users are encouraged to use the
platform-specific distribution mechanism.
2018-08-12 23:34:47 +02:00
Alexander Neumann 77a8d931b8 Update build.go 2018-08-12 15:44:13 +02:00
Alexander Neumann 20bfed5985 Update build.go 2018-05-21 20:31:19 +02:00
Alexander Neumann fcfa6f0355 build: Add option to enable PIE build mode 2018-05-11 09:50:10 +02:00
Alexander Neumann 6793300850 Raise minimum Go version to 1.9
The golang.org/sys/crypto library uses math/bits, which was only
introduced in Go 1.9.
2018-05-07 23:28:48 +02:00
Alexander Neumann ab7a3a803d Update build.go from github.com/fd0/build-go 2018-02-28 21:19:28 +01:00
Alexander Neumann 1e868933c5 build.go: Allow specifying the temp dir to use 2018-02-27 21:56:42 +01:00
Alexander Neumann 54c0794cf3 Merge pull request #1603 from jfparis/master
Add support for GOARM parameter when cross compiling
2018-02-11 21:03:29 +01:00
Alexander Neumann 7f0d964a05 Update build.go 2018-02-11 11:34:03 +01:00
Jean-François Paris e86fb5eedd Add support for GOARM parameter when cross compiling
Go can cross compile to older ARM architectures (e.g. v5). In order to
do so one needs to use the GOARM parameter as documented in
https://github.com/golang/go/wiki/GoArm
2018-02-04 14:15:12 +00:00
Alexander Neumann 02f4f5dc66 Update build.go, correct version detection 2018-01-12 22:06:42 +01:00
Alexander Neumann d00fe95f10 Upgrade min Go version to 1.8 2017-08-06 21:47:04 +02:00
Alexander Neumann 59e18bce0a Fix build.go 2017-07-23 14:25:39 +02:00
Alexander Neumann 9cd422791a Update build.go 2017-07-23 14:25:38 +02:00
Fabian Wickborn 52004cdde8 Allow absolute target path in build.go
Fixes #1099.
2017-07-14 11:54:46 +02:00
Alexander Neumann de48a5ac9c build.go: Strip temporary path, allow reproducible builds 2017-05-29 23:27:25 +02:00
Alexander Neumann c49da4c6f7 build.go: Add --enable-cgo 2017-05-25 11:03:29 +02:00
Pauline Middelink 971ecee171 Fix ineffassign mistakes 2017-05-17 01:25:52 +02:00
Alexander Neumann e6ca604d24 build.go: Also copy header files 2017-04-19 17:31:07 +02:00
Alexander Neumann f8dd5d5088 Check version in build.go
Print a sensible error for Go < 1.7 (the "context" package is missing
there)
2017-03-09 11:29:24 +01:00
Alexander Neumann 7e0a4c66e7 build.go: Make binaries completely static (disables cgo) 2017-01-12 19:51:26 +01:00
Alexander Neumann 62b1056860 build.go: Allow setting the output file name 2017-01-12 19:51:08 +01:00
Alexander Neumann 166d1811a1 Remove timestamp from `version` command
This enables reproducible builds, for details see
https://reproducible-builds.org/docs/timestamps/
2016-12-19 21:14:12 +01:00
Alexander Neumann 1815536534 Update build.go 2016-12-03 11:14:30 +01:00
Zlatko Čalušić 7e66b73ce0 Stop trying to detect Go version
It fails on pre-release versions, anyway.  It's enough to mention the oldest
supported version in README.md.  Anything older than two latest Go releases
is bad idea, anyway, 'cause it's unsupported by Go development team.

Closes #680
2016-12-01 20:06:23 +01:00
Alexander Neumann 1ad4d1aafd Require Go 1.6 or greater 2016-08-16 20:32:58 +02:00
Alexander Neumann 68ec29e7ec Invert go version test for ldflags 2016-08-03 22:04:03 +02:00
Vincent Rischmann d2834b61fb Detect a devel version correctly in LDFlags() 2016-08-01 20:47:33 +02:00
mappu 983e509388 build.go: gofmt 2016-07-16 10:14:41 +12:00
mappu c9400d5c61 build.go: Support cross-compilation via new `--goos` and `--goarch` flags 2016-07-16 09:42:41 +12:00
mappu f967e90a96 build.go: Strip harder (add `-w` flag) 2016-07-16 09:42:22 +12:00
mappu 38d4522ea5 build.go: Add go1.7 to list of linkers requiring `-Xfoo=bar` syntax 2016-07-16 09:42:02 +12:00
Fabian Wickborn ee494ab939 Use relocated command folders in build.go and run_integration_tests.go
The resulting command structure is almost compatible to that of that gb
reference project (example-gsftp), as the subfolder for commands is
'cmds' instead of 'cmd'.
2016-02-23 09:18:09 +01:00
Alexander Neumann 96e66bb3e9 Update build.go and run_integration_tests.go 2016-02-20 17:31:22 +01:00
Alexander Neumann 841326d713 Move build.go and run_integration_tests.go to root 2016-02-20 17:31:21 +01:00
Alexander Neumann b63399d606 Move things around for gb
This moves all restic source files to src/, and all vendored
dependencies to vendor/src.
2016-02-20 17:31:20 +01:00
Alexander Neumann 2499bbb09d Also specify new `-X` syntax for go1.6 2016-01-16 14:08:13 +01:00
Alexander Neumann 9aefc2b7a6 Merge pull request #281 from restic/version-with-git
build.go: use new combined version string
2015-08-26 20:53:24 +02:00
Alexander Neumann 39a82d951b Refactor getVersion(), address code review comments 2015-08-26 20:17:51 +02:00
Alexander Neumann a54f9715b1 Add "build: " prefix to verbose messages 2015-08-26 20:03:26 +02:00
Alexander Neumann 4c47c2b2c9 Address code review comments 2015-08-26 20:03:16 +02:00
Alexander Neumann f3c64d0740 build.go: use new combined version string
Previously, when a VERSION file exists it takes precendence over the
git version. This is unfortunate because all restic binaries compiled
from a git checkout will just identify as the latest release (e.g.
'0.1.0'), regardeless of any commits on top of it.

This commit adds a combined version string by using the contents of
the VERSION file, and append the current git version returned by `git
describe` if available, e.g.:

    0.1.0 (v0.1.0-6-gb188217-dirty).
2015-08-25 22:20:53 +02:00
Alexander Neumann dca200c2e9 build.go: Make `-ldflags` compatible to Go 1.5
This change uses the old syntax (-ldflags "-X foo bar") for Go <= 1.4
and the new syntax for (-ldflags "-X foo=bar") for Go 1.5 (without a
warning).
2015-08-25 22:07:52 +02:00
Alexander Neumann 10232155ef build.go: make sure to exit 1 on error 2015-08-19 21:40:36 +02:00