forked from TrueCloudLab/restic
Remove -mod=vendor from all documentation and code
This commit is contained in:
parent
28121090c2
commit
c0373cd307
7 changed files with 12 additions and 18 deletions
|
@ -46,15 +46,12 @@ Remember, the easier it is for us to reproduce the bug, the earlier it will be
|
|||
corrected!
|
||||
|
||||
In addition, you can compile restic with debug support by running
|
||||
`go run -mod=vendor build.go -tags debug` and instructing it to create a debug
|
||||
`go run build.go -tags debug` and instructing it to create a debug
|
||||
log by setting the environment variable `DEBUG_LOG` to a file, e.g. like this:
|
||||
|
||||
$ export DEBUG_LOG=/tmp/restic-debug.log
|
||||
$ restic backup ~/work
|
||||
|
||||
For Go < 1.11, you need to remove the `-mod=vendor` option from the build
|
||||
command.
|
||||
|
||||
Please be aware that the debug log file will contain potentially sensitive
|
||||
things like file and directory names, so please either redact it before
|
||||
uploading it somewhere or post only the parts that are really relevant.
|
||||
|
|
|
@ -29,4 +29,4 @@ install:
|
|||
- set PATH=bin/;%PATH%
|
||||
|
||||
build_script:
|
||||
- go run -mod=vendor run_integration_tests.go
|
||||
- go run run_integration_tests.go
|
||||
|
|
|
@ -259,7 +259,7 @@ In order to build restic from source, execute the following steps:
|
|||
|
||||
$ cd restic
|
||||
|
||||
$ go run -mod=vendor build.go
|
||||
$ 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
|
||||
|
@ -267,11 +267,11 @@ supply the target OS and platform via the command-line options like this
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
$ go run -mod=vendor build.go --goos windows --goarch amd64
|
||||
$ go run build.go --goos windows --goarch amd64
|
||||
|
||||
$ go run -mod=vendor build.go --goos freebsd --goarch 386
|
||||
$ go run build.go --goos freebsd --goarch 386
|
||||
|
||||
$ go run -mod=vendor build.go --goos linux --goarch arm --goarm 6
|
||||
$ go run build.go --goos linux --goarch arm --goarm 6
|
||||
|
||||
The resulting binary is statically linked and does not require any
|
||||
libraries.
|
||||
|
|
|
@ -22,9 +22,7 @@ The program can be built with debug support like this:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
$ go run build.go -mod=vendor -tags debug
|
||||
|
||||
For Go < 1.11, the option ``-mod=vendor`` needs to be removed.
|
||||
$ go run build.go -tags debug
|
||||
|
||||
Afterwards, extensive debug messages are written to the file in
|
||||
environment variable ``DEBUG_LOG``, e.g.:
|
||||
|
|
|
@ -47,10 +47,10 @@ In the following example, we'll use the file ``restic-0.9.3.tar.gz`` and Go
|
|||
$ go version
|
||||
go version go1.11.1 linux/amd64
|
||||
|
||||
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -mod=vendor -ldflags "-s -w" -tags selfupdate -o restic_linux_amd64 ./cmd/restic
|
||||
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w" -tags selfupdate -o restic_linux_amd64 ./cmd/restic
|
||||
$ bzip2 restic_linux_amd64
|
||||
|
||||
$ GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -mod=vendor -ldflags "-s -w" -tags selfupdate -o restic_windows_amd64.exe ./cmd/restic
|
||||
$ GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w" -tags selfupdate -o restic_windows_amd64.exe ./cmd/restic
|
||||
$ touch --reference VERSION restic_windows_amd64.exe
|
||||
$ TZ=Europe/Berlin zip -q -X restic_windows_amd64.zip restic_windows_amd64.exe
|
||||
|
||||
|
@ -105,7 +105,7 @@ The following steps are necessary to build the binaries:
|
|||
--volume "$PWD/restic-0.9.3:/restic" \
|
||||
--volume "$PWD/output:/output" \
|
||||
restic/builder \
|
||||
go run -mod=vendor helpers/build-release-binaries/main.go --verbose
|
||||
go run helpers/build-release-binaries/main.go --verbose
|
||||
|
||||
Prepare a New Release
|
||||
*********************
|
||||
|
@ -118,6 +118,6 @@ required argument is the new version number (in `Semantic Versioning
|
|||
|
||||
.. code::
|
||||
|
||||
go run -mod=vendor helpers/prepare-release/main.go 0.9.3
|
||||
go run helpers/prepare-release/main.go 0.9.3
|
||||
|
||||
Checks can be skipped on demand via flags, please see ``--help`` for details.
|
||||
|
|
|
@ -96,7 +96,6 @@ func build(sourceDir, outputDir, goos, goarch string) (filename string) {
|
|||
outputFile := filepath.Join(outputDir, filename)
|
||||
|
||||
c := exec.Command("go", "build",
|
||||
"-mod=vendor",
|
||||
"-o", outputFile,
|
||||
"-ldflags", "-s -w",
|
||||
"-tags", "selfupdate",
|
||||
|
|
|
@ -345,7 +345,7 @@ func runBuild(sourceDir, outputDir, version string) {
|
|||
"--volume", sourceDir+":/restic",
|
||||
"--volume", outputDir+":/output",
|
||||
"restic/builder",
|
||||
"go", "run", "-mod=vendor", "helpers/build-release-binaries/main.go",
|
||||
"go", "run", "helpers/build-release-binaries/main.go",
|
||||
"--version", version)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue