Skip to content
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

Support reproducible builds. #48

Merged
merged 1 commit into from May 2, 2018
Merged

Support reproducible builds. #48

merged 1 commit into from May 2, 2018

Conversation

eli-schwartz
Copy link
Contributor

@eli-schwartz eli-schwartz commented May 2, 2018

Because b951f62 (from PR #6) tried to add support for this, but it is not actually being used anywhere. The standard environment variable for defining reproducible build environments is SOURCE_DATE_EPOCH, which should be used to derive the BUILD_DATE macro rather than an environment variable matching said internal macro.

This is simplified even more by simply using the compiler's built-in macros for DATE and TIME when the file "about_scr.c" is processed by cpp. This natively supports SOURCE_DATE_EPOCH in the compiler itself.

Because b951f62 (from PR #6) tried to
add support for this, but it is not actually being used anywhere. The
standard environment variable for defining reproducible build
environments is SOURCE_DATE_EPOCH, which should be used to derive the
BUILD_DATE macro rather than an environment variable matching said
internal macro.

This is simplified even more by simply using the compiler's built-in
macros for __DATE__ and __TIME__ when the file "about_scr.c" is
processed by cpp. This natively supports SOURCE_DATE_EPOCH in the
compiler itself.
@eli-schwartz
Copy link
Contributor Author

Note https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e3e8c48c4a494d9da741c1c8ea6c4c0b7c4ff934 is where the builtin macros gained support for reproducible builds. Commit b951f62 predates this, so at the time the macro would not have been able to be used. However it should have still set BUILD_DATE via:

AC_DEFINE_UNQUOTED([BUILD_DATE], ["$(/bin/date --date=@${SOURCE_DATE_EPOCH:-$(date +%s)})"]

@grrtrr grrtrr merged commit 87da339 into uoaerg:master May 2, 2018
@grrtrr
Copy link
Contributor

grrtrr commented May 2, 2018

Thank you, am thinking of maybe removing the 'build date' in a future release, which would simplify this.

@eli-schwartz
Copy link
Contributor Author

Thanks for the rapid response!

I didn't want to remove it because some upstreams like to record this information for a variety of reasons, and from our perspective it truly doesn't matter (and is identical in intent) if we can pin the build date. Fortunately this is now already at zero maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants