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

Allow to override build date with SOURCE_DATE_EPOCH #3221

Merged
merged 1 commit into from
Oct 15, 2018

Conversation

bmwiedemann
Copy link
Contributor

@bmwiedemann bmwiedemann commented Oct 14, 2018

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated master/src/CHANGES.txt directory (and read the README.txt in that directory)
  • I have updated the appropriate documentation

Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Also consistently use ISO 8601 date format
to be understood everywhere.
Also use gmtime to be independent of timezone.

@bdbaddog
Copy link
Contributor

Please update CHANGES.txt

So if SOURCE_DATE_EPOCH is not set, this is still changing the default format of the time/datestamp in the distibuted code right?

@bdbaddog
Copy link
Contributor

Also, am I understanding the motivation correctly.
That since binary distributions are produced that setting SOURCE_DATE_EPOCH you can eliminate any datestamps from being changes and so a simple (binary?) diff of packages could ensure that the package hasn't been altered

@bmwiedemann
Copy link
Contributor Author

The results should be bit-identical, so you can just compare the hash/digest of the resulting packages. We are nearly there (e.g. it is working for 95% of 11000 openSUSE packages already)

Yes, it would change the date format. If there are many parsers around, we could leave the SConstruct version as is, but I guess, few people care about the man-page header.

@bdbaddog
Copy link
Contributor

o.k. I'm going to leave this up for a few days and float the PR to our users mailing list.
I can't think of any good reason not to merge this though, but I like to give our users a heads up.
Maybe add in the CHANGES.txt that the effect will be datestamps in docs and embedded in code will change format even when SOURCE_DATE_EPOCH is not specified?

@bmwiedemann
Copy link
Contributor Author

The man-page format is also particularly hard to understand (without looking at the source) - e.g. is 01/02/2018 January or February?

Will add a CHANGES.txt entry.

@bdbaddog
Copy link
Contributor

US date formatting so January.

@bmwiedemann
Copy link
Contributor Author

In Germany, 01.02.2018 is the first of February and I don't want to know how many other variants exist around the world.

@bdbaddog
Copy link
Contributor

bdbaddog commented Oct 14, 2018

Indeed. One of many locale based date/time/etc variations.

@coveralls
Copy link

coveralls commented Oct 14, 2018

Coverage Status

Coverage remained the same at 79.953% when pulling a61f52d on bmwiedemann:date into 0c20ae2 on SCons:master.

src/CHANGES.txt Outdated
@@ -162,6 +162,10 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
Three uses of variables not defined are changed.
- Some script changes in trying to find scons engine

From Bernhard M. Wiedemann:
- Allow to override build date with SOURCE_DATE_EPOCH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a note that this is only about building SCons packages and not universal to builds done by scons when building other software.

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Also consistently use ISO 8601 date format
to be understood everywhere.
Also use gmtime to be independent of timezone.
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.

3 participants