Merge pull request #2964 from MichaelEischer/fix-repro-instructions
Fix instructions to reproduce the release binaries
This commit is contained in:
commit
2f3eeff2e7
1 changed files with 25 additions and 21 deletions
|
@ -5,8 +5,9 @@ Reproducible Builds
|
||||||
*******************
|
*******************
|
||||||
|
|
||||||
This section describes how to reproduce the official released binaries for
|
This section describes how to reproduce the official released binaries for
|
||||||
restic for version 0.9.3 and later. The binary produced depends on the
|
restic for version 0.10.0 and later. For restic versions down to 0.9.3 please
|
||||||
following things:
|
refer to the documentation for the respective version. The binary produced
|
||||||
|
depends on the following things:
|
||||||
|
|
||||||
* The source code for the release
|
* The source code for the release
|
||||||
* The exact version of the official `Go compiler <https://golang.org>`__ used to produce the binaries (running ``restic version`` will print this)
|
* The exact version of the official `Go compiler <https://golang.org>`__ used to produce the binaries (running ``restic version`` will print this)
|
||||||
|
@ -17,19 +18,21 @@ following things:
|
||||||
* The environment variables (mostly ``$GOOS``, ``$GOARCH``, ``$CGO_ENABLED``)
|
* The environment variables (mostly ``$GOOS``, ``$GOARCH``, ``$CGO_ENABLED``)
|
||||||
|
|
||||||
In addition, The compressed ZIP files for Windows depends on the modification
|
In addition, The compressed ZIP files for Windows depends on the modification
|
||||||
timestamp of the binary contained in it. In order to reproduce the exact same
|
timestamp and filename of the binary contained in it. In order to reproduce the
|
||||||
ZIP file every time, we update the timestamp of the file ``VERSION`` in the
|
exact same ZIP file every time, we update the timestamp of the file ``VERSION``
|
||||||
source code archive and set the timezone to Europe/Berlin.
|
in the source code archive and set the timezone to Europe/Berlin.
|
||||||
|
|
||||||
In the following example, we'll use the file ``restic-0.9.3.tar.gz`` and Go
|
In the following example, we'll use the file ``restic-0.10.0.tar.gz`` and Go
|
||||||
1.11.1 to reproduce the released binaries.
|
1.15.2 to reproduce the released binaries.
|
||||||
|
|
||||||
1. Download and extract the Go compiler into ``/usr/local/go``:
|
1. Determine the Go compiler version used to build the released binaries, then download and extract the Go compiler into ``/usr/local/go``:
|
||||||
|
|
||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
|
$ restic version
|
||||||
|
restic 0.10.0 compiled with go1.15.2 on linux/amd64
|
||||||
$ cd /usr/local
|
$ cd /usr/local
|
||||||
$ curl -L https://dl.google.com/go/go1.11.1.linux-amd64.tar.gz | tar xz
|
$ curl -L https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz | tar xz
|
||||||
|
|
||||||
2. Extract the restic source code into ``/restic``
|
2. Extract the restic source code into ``/restic``
|
||||||
|
|
||||||
|
@ -37,7 +40,7 @@ In the following example, we'll use the file ``restic-0.9.3.tar.gz`` and Go
|
||||||
|
|
||||||
$ mkdir /restic
|
$ mkdir /restic
|
||||||
$ cd /restic
|
$ cd /restic
|
||||||
$ TZ=Europe/Berlin curl -L https://github.com/restic/restic/releases/download/v0.9.3/restic-0.9.3.tar.gz | tar xz --strip-components=1
|
$ TZ=Europe/Berlin curl -L https://github.com/restic/restic/releases/download/v0.10.0/restic-0.10.0.tar.gz | tar xz --strip-components=1
|
||||||
|
|
||||||
3. Build the binaries for Windows and Linux:
|
3. Build the binaries for Windows and Linux:
|
||||||
|
|
||||||
|
@ -45,14 +48,14 @@ In the following example, we'll use the file ``restic-0.9.3.tar.gz`` and Go
|
||||||
|
|
||||||
$ export PATH=/usr/local/go/bin:$PATH
|
$ export PATH=/usr/local/go/bin:$PATH
|
||||||
$ go version
|
$ go version
|
||||||
go version go1.11.1 linux/amd64
|
go version go1.15.2 linux/amd64
|
||||||
|
|
||||||
$ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -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
|
$ bzip2 restic_linux_amd64
|
||||||
|
|
||||||
$ GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -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_0.10.0_windows_amd64.exe ./cmd/restic
|
||||||
$ touch --reference VERSION restic_windows_amd64.exe
|
$ touch --reference VERSION restic_0.10.0_windows_amd64.exe
|
||||||
$ TZ=Europe/Berlin zip -q -X restic_windows_amd64.zip restic_windows_amd64.exe
|
$ TZ=Europe/Berlin zip -q -X restic_0.10.0_windows_amd64.zip restic_0.10.0_windows_amd64.exe
|
||||||
|
|
||||||
Building the Official Binaries
|
Building the Official Binaries
|
||||||
******************************
|
******************************
|
||||||
|
@ -80,7 +83,7 @@ The following steps are necessary to build the binaries:
|
||||||
|
|
||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
tar xvzf restic-0.9.3.tar.gz
|
tar xvzf restic-0.10.0.tar.gz
|
||||||
|
|
||||||
3. Create a directory to place the resulting binaries in:
|
3. Create a directory to place the resulting binaries in:
|
||||||
|
|
||||||
|
@ -93,19 +96,20 @@ The following steps are necessary to build the binaries:
|
||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--volume "$PWD/restic-0.9.3:/restic" \
|
--volume "$PWD/restic-0.10.0:/restic" \
|
||||||
--volume "$PWD/output:/output" \
|
--volume "$PWD/output:/output" \
|
||||||
restic/builder
|
restic/builder \
|
||||||
|
go run helpers/build-release-binaries/main.go --version 0.10.0
|
||||||
|
|
||||||
4. If anything goes wrong, you can enable debug output by specifying the call to ``helpers/build-release-binaries/main.go`` like this:
|
4. If anything goes wrong, you can enable debug output like this:
|
||||||
|
|
||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--volume "$PWD/restic-0.9.3:/restic" \
|
--volume "$PWD/restic-0.10.0:/restic" \
|
||||||
--volume "$PWD/output:/output" \
|
--volume "$PWD/output:/output" \
|
||||||
restic/builder \
|
restic/builder \
|
||||||
go run helpers/build-release-binaries/main.go --verbose
|
go run helpers/build-release-binaries/main.go --version 0.10.0 --verbose
|
||||||
|
|
||||||
Prepare a New Release
|
Prepare a New Release
|
||||||
*********************
|
*********************
|
||||||
|
@ -118,6 +122,6 @@ required argument is the new version number (in `Semantic Versioning
|
||||||
|
|
||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
go run helpers/prepare-release/main.go 0.9.3
|
go run helpers/prepare-release/main.go 0.10.0
|
||||||
|
|
||||||
Checks can be skipped on demand via flags, please see ``--help`` for details.
|
Checks can be skipped on demand via flags, please see ``--help`` for details.
|
||||||
|
|
Loading…
Add table
Reference in a new issue