script/release.sh: make builds reproducible#3099
Merged
cyphar merged 2 commits intoopencontainers:masterfrom Jul 29, 2021
Merged
script/release.sh: make builds reproducible#3099cyphar merged 2 commits intoopencontainers:masterfrom
cyphar merged 2 commits intoopencontainers:masterfrom
Conversation
Contributor
Author
|
CI failure in centos 7 is a glitch (hope we'll merge #3088 soon and see less of those failures). CI restarted. |
a351a3c to
b1f95ae
Compare
This patch * drops the default `-w` flag for `make static`, which helps with debugging the static runc binary; * adds `EXTRA_LDFLAGS="-w -s"` to `script/release.sh` to disable DWARF generation and symbol table for the release runc binary; * adds strip in `script/release.sh` for a further size-optimized release runc binary. Signed-off-by: Kailun Qin <kailun.qin@intel.com>
What it takes is add an empty buildid, which, together with previously added strip invocation, results in reproducible build! NB: earlier versions of this patch also added the following: 1. non-random libseccomp install $prefix; 2. "objcopy --enable-deterministic-archives $prefix/lib/libseccomp.a" to strip ar dates and UIDs/GIDs; 3. "-B=0x00" to EXTRA_LDFLAGS to have non-variable NT_GNU_BUILD_ID. Apparently, all this is not needed with strip. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
b1f95ae to
18f434e
Compare
AkihiroSuda
approved these changes
Jul 28, 2021
Member
|
This might be nice to backport to 1.0.x if we plan to do another release, just to make sure all future releases are reproducible. |
Contributor
Author
Done: #3142 |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries #3054 (thanks to @kailun-qin).
What it takes is add an empty buildid, which, together with previously
added
stripinvocation, results in reproducible build!NB: earlier versions of this patch also added the following:
$prefix;objcopy --enable-deterministic-archives $prefix/lib/libseccomp.ato strip ar dates and UIDs/GIDs;
-B=0x00toEXTRA_LDFLAGSto have non-variable NT_GNU_BUILD_ID.Apparently, all this is not needed with
stripin place.Fixes: #2947.
Closes: #3054.
1.0 backport: #3142