Skip to content

MAINT: Make f2py generated file not contain the (local) date. #9780

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

Merged
merged 2 commits into from
Sep 27, 2017

Conversation

bmwiedemann
Copy link
Contributor

@bmwiedemann bmwiedemann commented Sep 27, 2017

While working on the reproducible builds effort, I found that when building the python-scipy package for openSUSE Linux, there were slight differences between each build that can be avoided with this patch to
Allow to override build date
and use gmtime in order to be independent of timezone
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.

@bashtage
Copy link
Contributor

You need to change your PR title.

@charris
Copy link
Member

charris commented Sep 27, 2017

The lines with "Revision" and "Date" were for subversion. I'd just remove all of them, including also the time and the outdated link.

@charris
Copy link
Member

charris commented Sep 27, 2017

And you need to completely redo your commit message. See doc/source/dev/gitwash/development_workflow.rst.

@bmwiedemann bmwiedemann changed the title While working on the reproducible builds effort, I found that when building the python-scipy package for openSUSE Linux, there were slight differences between each build that can be avoided with this patch to Allow to override build date Sep 27, 2017
@@ -114,7 +114,7 @@
* f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
* written by Pearu Peterson <[email protected]>.
* See http://cens.ioc.ee/projects/f2py2e/
* Generation date: """ + time.asctime(time.localtime(time.time())) + """
* Generation date: """ + time.asctime(time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))) + """
* $R""" + """evision:$
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove this line and the one below?

@@ -114,7 +114,7 @@
* f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
* written by Pearu Peterson <[email protected]>.
* See http://cens.ioc.ee/projects/f2py2e/
Copy link
Member

Choose a reason for hiding this comment

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

Remove this line also.

@@ -114,7 +114,7 @@
* f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
* written by Pearu Peterson <[email protected]>.
* See http://cens.ioc.ee/projects/f2py2e/
* Generation date: """ + time.asctime(time.localtime(time.time())) + """
* Generation date: """ + time.asctime(time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))) + """
Copy link
Member

Choose a reason for hiding this comment

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

If you are going to keep this, could you break it so that the line length is < 80 chars?

and use gmtime in order to be independent of timezone
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.
because svn is not used anymore
@charris
Copy link
Member

charris commented Sep 27, 2017

I note that f2py is now released together with NumPy, so its own version number no longer tracks changes. If reproducibility requires a known version something more might be required.

@charris charris changed the title Allow to override build date MAINT: Make f2py generated file not contain the (local) date. Sep 27, 2017
@charris charris merged commit 1e45fd9 into numpy:master Sep 27, 2017
@charris
Copy link
Member

charris commented Sep 27, 2017

Merged, thanks @bmwiedemann.

There may be more work needed here, but I don't know the precise aims that you have in the reproducibile build project.

@bmwiedemann
Copy link
Contributor Author

For now, my goal is for all 11800 openSUSE source packages to be able to build twice and produce identical binary packages (which was not the case for python-scipy before this patch, because of the timestamps).
Version numbers usually do not matter there, because they do not vary between builds.

@bmwiedemann bmwiedemann deleted the date branch July 30, 2023 15:47
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.

3 participants