set SOURCE_DATE_EPOCH from changelog #143

Merged
merged 1 commit into from Feb 1, 2017

Projects

None yet

2 participants

@ffesti
Contributor
ffesti commented Feb 1, 2017

Alternative implementation for #141

It sets the environment variable during the build stage and not while parsing the spec which should be free from side effects.

@bmwiedemann @ffesti bmwiedemann set SOURCE_DATE_EPOCH from changelog
if requested by macro
to allow for more reproducible builds of packages.

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.
0e87aed
@ffesti
Contributor
ffesti commented Feb 1, 2017

@bmwiedemann would this work for you?
I left you as author of the patch but I can reset it if you wish.

@bmwiedemann
Contributor

change looks reasonable. I am giving it a round of testing.
Under what condition would headerGet return false here? OOM? no changelog entry found?

@bmwiedemann
Contributor

test looks good.

@ffesti ffesti merged commit 0e87aed into rpm-software-management:master Feb 1, 2017

1 check passed

Jenkins (Red Hat) 153/153 normal + 0/4 xfail
Details
@ffesti ffesti deleted the ffesti:SOURCE_DATE_EPOCH branch Feb 1, 2017
@ffesti
Contributor
ffesti commented Feb 2, 2017

Hmm, I am wondering if the
getenv("SOURCE_DATE_EPOCH") == NULL
condition is really correct here. The problem is that rpmbuild might be used to build multiple packages in one go. But even if that was not possible someone using the API could.
Do we really need to give precedence of an already set SOURCE_DATE_EPOCH environment variable over %source_date_epoch_from_changelog ?

@bmwiedemann
Contributor

I put it there because the spec says:

Build systems MUST NOT overwrite this variable for child processes to consume if it is already present.

But then, it probably does not apply if we had set it ourselves (and not the user) for the previous rpm to build.

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