Conversation

mzf-guest

Hello,

here the from the Debian package that fixes reproducibility issues:

(This pull request invalidates the previous one, based on master instead of develop. Sorry for the noise.)

Best,

François

@prj-

@mzf-guest, should we close this, or could you address my prior point?

@mzf-guest

@prj- I've just updated the problematic file to remove the tab to white-space modification. I've also rebased to recent developbranch, so it should be ready to merge. If not, just let me know and I'll update accordingly.

Thanks!

@prj-

Sorry, I just realised that my comment back from August 2021 was pending and that I did not submit my review...

strversionnumber.cpp: $(libff_a_SOURCES2) ../../Makefile
m4 -DVersionFreeFemDate="`date`" -DGitVersion="`git describe --tags 2>/dev/null|| echo 'no git'`" strversionnumber.m4 > $@
m4 -DVersionFreeFemDate="$(BUILD_DATE)" -DGitVersion="`git describe --tags 2>/dev/null|| echo 'no git'`" strversionnumber.m4 > $@
Copy link
Member

Choose a reason for hiding this comment

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

This does not work on even on Debian.

$ make strversionnumber.cpp
m4 -DVersionFreeFemDate="""" -DGitVersion="`git describe --tags 2>/dev/null|| echo 'no git'`" strversionnumber.m4 > strversionnumber.cpp

Any suggestion @mzf-guest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed! This code does not work when SOURCE_DATE_EPOCH is not defined by the build chain. Good catch! and sorry the miss.

The Makefile example from this page seems to work better, at least in a minimal test. But I can't make it work from the Makefile.am file. When running autoreconf -i, the ifeq is recognized as a AM command instead of copying it verbatim in the Makefile.

DATE_FMT = +%Y-%m-%d
ifdef SOURCE_DATE_EPOCH
    BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
else
    BUILD_DATE ?= $(shell date "$(DATE_FMT)")
endif

Unfortunately, I'm not very skilled with autotools. Do you have any hints?

Copy link
Member

Choose a reason for hiding this comment

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

Ahah, no, I faced the exact same issue. Maybe this should be put a static makefile, like Makefile.date. And then we'd replace date by make -f Makefile.date date with

$ cat Makefile.date
DATE_FMT = +%Y-%m-%d
ifdef SOURCE_DATE_EPOCH
    BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
else
    BUILD_DATE ?= $(shell date "$(DATE_FMT)")
endif

date:
    echo $(BUILD_DATE)

Copy link
Member

Choose a reason for hiding this comment

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

Any update about this @mzf-guest?

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

Successfully merging this pull request may close these issues.