New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: actually create deterministic release archives #4879
Conversation
Seems like I got somewhat different results as the manifest file's contents are:
|
Hmmm... interesting, the builds from GitHub also don't match mine. At least the hashes of the extracted binaries seem to match, so it's still a packaging issue. |
3a06fab
to
843963c
Compare
This was harder than I expected.
Got it fully working now, though: https://github.com/guggero/lnd/releases/download/v0.12.0-beta.rc3-testbuild1/manifest-v0.12.0-beta.rc3-testbuild1.txt |
6eda5d4
to
df7cd40
Compare
To make sure git has the full history, including all annotated tags, we need to explicitly fetch everything on checkout.
@bhandras I pushed up a new tag with the latest changes, it's ready to be re-tested (see updated instructions in PR description). |
@guggero Still not getting same hashes one macOS:
|
c225be9
to
89a6a46
Compare
21067f3
to
ba3bffe
Compare
A number of tricks need to be applied to the tar and zip commands respectively to make sure they always produce deterministic archives. This includes setting the file timestamps to a fixed date and setting specific ownership attributes (tar) or no attributes at all (zip).
Manifest matches (although I had to sort the file first).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, very nice work @guggero 🥇
@@ -10,13 +10,11 @@ defaults: | |||
shell: bash | |||
|
|||
env: | |||
DOCKER_REPO: lightninglabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleared up offline: these env variables were never even used in the first place!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🥽
Fixes a number of small issues that lead to the release artifact hashes not matching up with local builds.
git describe
works correctly.git describe --tags
to identify the commit name compiled into the binaries..tar.gz
and.zip
files.A test run is in progress on GitHub: https://github.com/guggero/lnd/runs/1669502010?check_suite_focus=true
Will validate against my local build and report back on it.
Anyone trying to reproduce the same hashes can do the following (using
go 1.15.6
!):This results in the following hashes: manifest-v0.12.0-beta.rc3-testbuild7.txt (on my local machine).
MacOS users:
There is now a docker image that helps you create reproducible builds. please run the same steps as above but replace
make release
withmake docker-release
!