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
allow reproducible builds #2
Conversation
siproxd sets the current time as BUILDDATE, but then it cannot be built reproducibly. This commit adds a configure arg that will forces BUILDDATE to "unknown", allowing builds to be reproducible. Default is no, so status quo remains unchanged. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
|
Hello! We have an open issue at OpenWrt about siproxd not building reproducibly with the SDKs. Kindly check this pull request if it's acceptable. Happy to make changes to it. Thanks! |
|
Here's what it looks like when built with |
|
Filed https://sourceforge.net/p/siproxd/bugs/65/ I just made two alternate patches: --- siproxd-0.8.3.orig/src/Makefile.am
+++ siproxd-0.8.3/src/Makefile.am
@@ -22,7 +22,7 @@
AM_CFLAGS = -D_GNU_SOURCE $(LTDLDEF) \
-Werror-implicit-function-declaration \
-DBUILDSTR="\"`cat .buildno`\"" \
- -DBUILDDATE="\"`date -u '+%Y-%m-%dT%H:%M:%S'`\""
+ -DBUILDDATE="\"`date -r ../ChangeLog -u '+%Y-%m-%dT%H:%M:%S'`\""
#&&&INCLUDES = $(LTDLINCL)
AM_CPPFLAGS = $(LTDLINCL)
and --- siproxd-0.8.3.orig/src/Makefile.am
+++ siproxd-0.8.3/src/Makefile.am
@@ -22,7 +22,7 @@
AM_CFLAGS = -D_GNU_SOURCE $(LTDLDEF) \
-Werror-implicit-function-declaration \
-DBUILDSTR="\"`cat .buildno`\"" \
- -DBUILDDATE="\"`date -u '+%Y-%m-%dT%H:%M:%S'`\""
+ -DBUILDDATE="\"`date -d @$${SOURCE_DATE_EPOCH:-$$(date +%s)} -u '+%Y-%m-%dT%H:%M:%S'`\""
#&&&INCLUDES = $(LTDLINCL)
AM_CPPFLAGS = $(LTDLINCL)
this last one has the disadvantage that it only works with GNU But both have the advantage to be reproducible by default for people who want it and thus set |
|
Thanks! Nice idea taking the date from the Changelog! I guess the Changelog idea would make the BUILDDATE a bit of a misnomer. But for OpenWrt purposes this would be fine. You mentioned that the other patch would depend on GNU date. So I guess that's not very portable. I could understand if you didn't want to incorporate any of this upstream, though. So in that case I'd likely take the "Changelog patch" and keep it locally in our repository. Let me know what you want to do. I'll just follow your lead. Kind regards, |
|
I actually like the first version (using "unknown" datestring for reproducible builds). In addition, it might make sense to also eliminate/ignore the BUILDSTR (build number from .buildno file) when doing reproducible builds. best regards, |
|
I actually like the first version (using "unknown" datestring for reproducible builds). In addition, it might make sense to also eliminate/ignore the BUILDSTR (build number from .buildno file) when doing reproducible builds.
I'll look into it and make the required changes.
One more variation comes to mind. Instead of unknown putting the Changelog date %-)
I think there's something here for everybody ;-)
|
|
Using "unknown" does clearly indicate that the build date has been omitted on purpose. If using the Changelog file date, it is not visible if the BULDDATE does actually contain the real build date, or some estimated/guessed date string that is not related to the time of build at all. |
|
Please check f47a3e0 |
|
check also 4750bea, implements support for SOURCE_DATE_EPOCH |
|
Hello Tom, both commits work fine, siproxd builds are reproducible. Do you want to leave it like this? Then it'd just add the two commits as patches to our package. Thanks! |
|
Hello Seb, Regards, |
|
Thanks for this! Will update OpenWrt package accordingly. |
siproxd sets the current time as BUILDDATE, but then it cannot be built
reproducibly.
This commit adds a configure arg that will forces BUILDDATE to
"unknown", allowing builds to be reproducible.
Default is no, so status quo remains unchanged.
Signed-off-by: Sebastian Kemper sebastian_ml@gmx.net