-
Notifications
You must be signed in to change notification settings - Fork 122
Docker release #1007
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
Docker release #1007
Conversation
|
"make docker-release tag=..." produces the same binaries regardless on the platform and the installed Go version, because it uses Docker.
Previous version produces escapped sequnces as text (Debian 12).
To test "make docker-release" it is convenient to pass a regular commit to it (an output of `git describe`). In this commit release.sh is changed to detect such "tags" and skip tag signature verification for it. Also if release.sh is used without an argument, a unique directory name is generated from the current time.
Create a temporary directory inside loop/ directory and make a clone of Git repo to that dir. This ensures that the version built is exactly what is committed without any unstaged files and not dirty.
Took the code for reproducible packing from LND.
Added -trimpath to remove absolute paths from the binary.
Collect artifacts in "tmp-..." instead of final place. If build fails in the middle, we don't want to leave the artifacts directory with partial result. Also remove the build directory (with Git clone) in the end.
When doing git-clone to a subdir, do not keep tags, since there can be local tags affecting `git describe` and buildvcs info. Instead pull the tags from upstream.
Without --abbrev flag it may produce different number of hash characters on different instances. It depends on the state of Git repo itself.
6402a76
to
2464e94
Compare
Otherwise it asks confirmation to remove tmp-.../.git dir.
So the length of this hash depends on the state of the Git repo. I updated the PR, replaced Please try again! |
Make sure we use GNU gzip. Mac by default uses BSD gzip.
@hieblmi Thanks for reporting! I updated brew install gnu-tar gzip Note that you also need to install (GNU) gzip from brew. I found the root cause of the discrepancies: GNU and BSD versions of I updated the script to find the correct tool similar to how it finds GNU Tar. I updated the hashes. Could you rebuilt it both on Docker and using Another thing. I copy-pasted the code for reproducible tar_gz packing from LND. I suspect that LND's release script might have the same issue on Mac. Could you try to build LND release using |
Thanks for the investigation! Now it all checks out. The docker release produces:
The
|
If Go binary itself comes from `go install golang.org/dl/go1.24.6@latest` it embeds a different BuildID. We unset BuildID to enforce reproducibility.
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!
docker-release and release.sh produce the same output for me, matching you current pr description
f3cad408a41a04035dfbc0bda14be51ca33019356008c96eac5f554489ce65e9 manifest-v0.31.2-beta-141-gaec03c1e0b.txt
This pull request introduces a new
make docker-release
target to enable reproducible builds of Loop releases. The goal is to ensure that anyone can build the same binaries from the same source code.Key Changes:
Reproducible Builds:
release.sh
script has been updated to produce reproducible artifacts. This includes:.zip
and.tar.gz
archives.docker-release
Target:docker-release
target has been added to theMakefile
.Makefile Improvements:
print
function in theMakefile
has been fixed to work correctly on all platforms.Documentation:
docker-release
target and the reproducible build process are now documented.Reproducible builds
I propose the reviewers to build the PR and compare hashes with me.
The following command assumes
git describe --abbrev=10
producesv0.31.2-beta-141-gaec03c1e0b
. If this is not true for you, rungit pull --tags https://github.com/lightninglabs/loop
.I built the commit of the PR using:
Also built without Docker. Remember to move output dir
v0.31.2-beta-141-gaec03c1e0b
if you already built with Docker, otherwise it will. Also remember to install Go 1.24.6 and GPG key of Alex Bosworth (gpg --keyserver keys.openpgp.org --recv-keys DE23E73BFA8A0AD5587D2FCDE80D2F3F311FD87E
).Output of both approaches is the same:
I checked this on multiple machines with amd64 and arm64 architectures and Debian and Ubuntu OS and used both
make docker-release
andrelease.sh
directly. Outputs are exactly the same!v0.31.3-beta tag
Tag
v0.31.3-beta
doesn't have a description, sogit describe
ignores it. Also the tag is not signed:IMHO we should remove
v0.31.3-beta
and make a signed tagv0.31.4-beta
with a description and make it a release.Pull Request Checklist
release_notes.md
if your PR contains major features, breaking changes or bugfixes