From c0373cd307d3be88e4e5e99e31214625b18e1725 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 1 Mar 2020 11:32:36 +0100 Subject: [PATCH] Remove -mod=vendor from all documentation and code --- CONTRIBUTING.md | 5 +---- appveyor.yml | 2 +- doc/020_installation.rst | 8 ++++---- doc/090_participating.rst | 4 +--- doc/developer_information.rst | 8 ++++---- helpers/build-release-binaries/main.go | 1 - helpers/prepare-release/main.go | 2 +- 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f0a105ca1..c80567eae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/appveyor.yml b/appveyor.yml index e4a412439..7b8ca7a79 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/doc/020_installation.rst b/doc/020_installation.rst index 005e44d32..8262daaea 100644 --- a/doc/020_installation.rst +++ b/doc/020_installation.rst @@ -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. diff --git a/doc/090_participating.rst b/doc/090_participating.rst index c909dd4a3..3dd59294d 100644 --- a/doc/090_participating.rst +++ b/doc/090_participating.rst @@ -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.: diff --git a/doc/developer_information.rst b/doc/developer_information.rst index f962863e7..04282f4af 100644 --- a/doc/developer_information.rst +++ b/doc/developer_information.rst @@ -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. diff --git a/helpers/build-release-binaries/main.go b/helpers/build-release-binaries/main.go index 404527507..aa3de8f90 100644 --- a/helpers/build-release-binaries/main.go +++ b/helpers/build-release-binaries/main.go @@ -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", diff --git a/helpers/prepare-release/main.go b/helpers/prepare-release/main.go index e42e0e8e6..82b2ed7a2 100644 --- a/helpers/prepare-release/main.go +++ b/helpers/prepare-release/main.go @@ -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) }