[opensuse-packaging] how to use SOURCE_DATE_EPOCH
How is SOURCE_DATE_EPOCH supposed to be used? Is it required to patch each pkg, or should rather the thing which tweaks Release: during build also inject a "export SOURCE_DATE_EPOCH=∞" right after the %build/%install lines? Olaf
On Wednesday 2016-06-29 15:02, Olaf Hering wrote:
How is SOURCE_DATE_EPOCH supposed to be used? Is it required to patch each pkg, or should rather the thing which tweaks Release: during build also inject a "export SOURCE_DATE_EPOCH=∞" right after the %build/%install lines?
gcc defaults to -DSOURCE_DATE_EPOCH=$(date +%s) -D__DATE__=$(prettyprint SOURCE_DATE_EPOCH) -D__TIME__=$(prettyprint SOURCE_DATE_EPOCH) And you can override the former. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wednesday 2016-06-29 15:26, Jan Engelhardt wrote:
On Wednesday 2016-06-29 15:02, Olaf Hering wrote:
How is SOURCE_DATE_EPOCH supposed to be used? Is it required to patch each pkg, or should rather the thing which tweaks Release: during build also inject a "export SOURCE_DATE_EPOCH=∞" right after the %build/%install lines?
gcc defaults to -DSOURCE_DATE_EPOCH=$(date +%s) -D__DATE__=$(prettyprint SOURCE_DATE_EPOCH) -D__TIME__=$(prettyprint SOURCE_DATE_EPOCH)
And you can override the former.
Gah, not a macro. An environment variable. printf("%s\n", __DATE__) >>test.c $ SOURCE_DATE_EPOCH=0 gcc-6 test.c && ./a.out Jan 1 1970 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 29.06.2016 15:02, Olaf Hering wrote:
How is SOURCE_DATE_EPOCH supposed to be used? Is it required to patch each pkg, or should rather the thing which tweaks Release: during build also inject a "export SOURCE_DATE_EPOCH=∞" right after the %build/%install lines?
https://github.com/openSUSE/obs-build/pull/249 is Bernhard's attempt. As this is an environment variable, I don't think you need to touch the spec file at all, but you have to make sure to export it before we start rpmbuild. Greetings, Stephan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, Jun 29, Stephan Kulow wrote:
As this is an environment variable, I don't think you need to touch the spec file at all, but you have to make sure to export it before we start rpmbuild.
I think the %build/%install section would be the natural place for such an export to make sure the very same value is used by a manual rpmbuild. If we indeed aim for this bit-by-bit thing. If we dont, then something has to set it during build. Will this be done automatically by "the build service"? At least right now it appearently is not the case. Olaf
On 29.06.2016 17:33, Olaf Hering wrote:
On Wed, Jun 29, Stephan Kulow wrote:
As this is an environment variable, I don't think you need to touch the spec file at all, but you have to make sure to export it before we start rpmbuild.
I think the %build/%install section would be the natural place for such an export to make sure the very same value is used by a manual rpmbuild. If we indeed aim for this bit-by-bit thing. If we dont, then something has to set it during build. Will this be done automatically by "the build service"? At least right now it appearently is not the case.
Having an explicit export in the source rpm sounds like a good idea, but I don't really want to touch that script rewriting the specs :) Greetings, Stephan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wed, Jun 29, Stephan Kulow wrote:
Having an explicit export in the source rpm sounds like a good idea, but I don't really want to touch that script rewriting the specs :)
Where is that script? I think there is also code to redo some of the BuildRequires: strings. Will such a change automatically be used for building released products? There are many packages doing a manual 'date -r %{name}.changes', or grep the first timestamp out of that file in creative ways. I think having SOURCE_DATE_EPOCH available in each spec file would give us the chance to remove such code. Olaf
Am 29.06.2016 um 17:59 schrieb Olaf Hering:
On Wed, Jun 29, Stephan Kulow wrote:
Having an explicit export in the source rpm sounds like a good idea, but I don't really want to touch that script rewriting the specs :)
Where is that script? I think there is also code to redo some of the BuildRequires: strings.
Oh, that script is a joy to read :) https://github.com/openSUSE/obs-build/blob/master/substitutedeps
Will such a change automatically be used for building released products? There are many packages doing a manual 'date -r %{name}.changes', or grep the first timestamp out of that file in creative ways. I think having SOURCE_DATE_EPOCH available in each spec file would give us the chance to remove such code.
The build script is universal for the OBS - so if you change it, it will be in all distributions including maintenance. Greetings, Stephan -- Ma muaß weiterkämpfen, kämpfen bis zum Umfalln, a wenn die ganze Welt an Arsch offen hat, oder grad deswegn.
participants (3)
-
Jan Engelhardt
-
Olaf Hering
-
Stephan Kulow