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

Make the build reproducible #68

Conversation

lamby
Copy link

@lamby lamby commented Apr 18, 2018

Whilst working on the Reproducible Builds effort, we noticed that strace could not be built reproducibly. This is due to the documentation encodes a timezone-varying date in the manpages.

(This was originally filed in Debian as #896016.)

Whilst working on the Reproducible Builds effort [0], we noticed
that strace could not be built reproducibly.

This is due to the documentation encodes a timezone-varying date
in the manpages.

This was originally filed in Debian as #896016 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/896016

Signed-off-by: Chris Lamb <lamby@debian.org>
@codecov-io
Copy link

Codecov Report

Merging #68 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
- Coverage   83.66%   83.65%   -0.01%     
==========================================
  Files         221      221              
  Lines       13711    13711              
  Branches      580      580              
==========================================
- Hits        11471    11470       -1     
- Misses       2107     2108       +1     
  Partials      133      133
Impacted Files Coverage Δ
xmalloc.c 65.95% <0%> (-2.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee2c065...a87b8ea. Read the comment docs.

@ldv-alt
Copy link
Member

ldv-alt commented Apr 19, 2018

I'm sorry but your proposed commit just breaks the script it was supposed to fix:

+# Use SOURCE_DATE_EPOCH if it exists.
+# <https://reproducible-builds.org/specs/source-date-epoch/>
+[ -n "${SOURCE_DATE_EPOCH}" ] ||
+ date="@${SOURCE_DATE_EPOCH}"

Contrary to the comment, it ignores SOURCE_DATE_EPOCH if the latter exists, and it makes the script issue an error and print nothing if SOURCE_DATE_EPOCH does not exist.

Besides that, it was wrong to override DATE_FILE and "git log" with SOURCE_DATE_EPOCH.

@ldv-alt ldv-alt closed this in 31ce194 Apr 19, 2018
@lamby
Copy link
Author

lamby commented Apr 20, 2018

Besides that, it was wrong to override DATE_FILE and "git log" with SOURCE_DATE_EPOCH.

Can you elaborate why? That's somewhat the point of this environment variable. :)

I can fix the technical aspects of this bug but we might as well agree first on the philosophy!

@esyr
Copy link
Member

esyr commented Apr 20, 2018

Because both of them are reproducible sources of the file date and make more sense than an arbitrary SOURCE_DATE_EPOCH.

I think that the only problems you actually had are lack of UTC option in date invocations and absence of LC_DATE reset, as .strace.1.in.date file used for identifying strace.1.in file date (the only one for which the script is used so far) is generated during build (and goes into the distribution tarball), and builds from git tree use git commit timestamps as a reference.

@ldv-alt
Copy link
Member

ldv-alt commented Apr 20, 2018

SOURCE_DATE_EPOCH is not expected to override timestamps written in the source code.

@lamby
Copy link
Author

lamby commented Apr 20, 2018

Ah, I see our disconnect now.. so in Debian we try and rebuild everything and — as we don't have your .git tree at that point as we build from tarballs — we don't have a date.

Updated patch attached that prefers the git tree so the release behaviour is unchanged and also doesn't break if SOURCE_DATE_EPOCH is undefined.

:)

@ldv-alt
Copy link
Member

ldv-alt commented Apr 20, 2018

Looks like you build from git snapshots (produced by git archive --format=tar) instead of released tarballs (produced by make-dist script), otherwise SOURCE_DATE_EPOCH wouldn't make any difference.

Anyway, please have a look at the current master branch, I suppose it addresses the issue.

ldv-alt added a commit that referenced this pull request Apr 20, 2018
* Makefile.am (today): Consistently print the UTC date in C locale.
* configure.ac (RPM_CHANGELOGTIME, DEB_CHANGELOGTIME): Likewise.
* maint/update_copyright_years.sh: Likewise.
* copyright-year-gen: Likewise.  When $SOURCE_DATE_EPOCH is non-empty,
use it as fallback date before the current system date.

References: #68
@lamby
Copy link
Author

lamby commented Apr 21, 2018

(Commented on that commit)

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

Successfully merging this pull request may close these issues.

None yet

4 participants