* [Buildroot] [PATCH] pkg-generic: suppress SOURCE_DATE_EPOCH warning in step_time
@ 2026-03-19 10:42 Nathan Bloch
2026-04-07 18:42 ` Arnout Vandecappelle via buildroot
0 siblings, 1 reply; 4+ messages in thread
From: Nathan Bloch @ 2026-03-19 10:42 UTC (permalink / raw)
To: buildroot; +Cc: Nathan Bloch
From: Nathan Bloch <nblochn@gmail.com>
The step_time hook calls date +%s.%N to measure build step elapsed time.
When SOURCE_DATE_EPOCH is set (for reproducible builds), GNU coreutils date
emits "Warning: using $SOURCE_DATE_EPOCH instead of true time" for every
call — twice per step, across all packages, resulting in hundreds of noisy
log lines.
Unset SOURCE_DATE_EPOCH inline for these timing-only calls, since they
measure real elapsed time and do not affect build reproducibility.
Signed-off-by: Nathan Bloch <nblochn@gmail.com>
---
package/pkg-generic.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index a2749320..e4bf6def 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -50,7 +50,7 @@ endef
# Time steps
define step_time
printf "%s:%-5.5s:%-20.20s: %s\n" \
- "$$(date +%s.%N)" "$(1)" "$(2)" "$(3)" \
+ "$$(SOURCE_DATE_EPOCH= date +%s.%N)" "$(1)" "$(2)" "$(3)" \
>>"$(BUILD_DIR)/build-time.log"
endef
GLOBAL_INSTRUMENTATION_HOOKS += step_time
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] pkg-generic: suppress SOURCE_DATE_EPOCH warning in step_time
2026-03-19 10:42 [Buildroot] [PATCH] pkg-generic: suppress SOURCE_DATE_EPOCH warning in step_time Nathan Bloch
@ 2026-04-07 18:42 ` Arnout Vandecappelle via buildroot
2026-04-08 9:29 ` Nicolas Cavallari
0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2026-04-07 18:42 UTC (permalink / raw)
To: Nathan Bloch, buildroot
Hi Nathan,
On 19/03/2026 11:42, Nathan Bloch wrote:
> From: Nathan Bloch <nblochn@gmail.com>
>
> The step_time hook calls date +%s.%N to measure build step elapsed time.
> When SOURCE_DATE_EPOCH is set (for reproducible builds), GNU coreutils date
> emits "Warning: using $SOURCE_DATE_EPOCH instead of true time" for every
> call — twice per step, across all packages, resulting in hundreds of noisy
> log lines.
I was going to apply but just to be sure I tested myself, and my (Fedora 43)
GNU coreutils date turns out not to behave like that. So I went to the coreutils
source and searched for SOURCE_DATE_EPOCH and for "instead of true time", and
got no hits (except for the expected ones for SOURCE_DATE_EPOCH). It actually
just uses true time. I also checked uutils and glibc just to be sure, found
nothing there either.
So it looks like you're using some patched version of GNU date. I'm not sure
if it worth patching Buildroot to cater with that, unless you're on some pretty
mainstream distro.
Regards,
Arnout
> Unset SOURCE_DATE_EPOCH inline for these timing-only calls, since they
> measure real elapsed time and do not affect build reproducibility.
>
> Signed-off-by: Nathan Bloch <nblochn@gmail.com>
> ---
> package/pkg-generic.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index a2749320..e4bf6def 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -50,7 +50,7 @@ endef
> # Time steps
> define step_time
> printf "%s:%-5.5s:%-20.20s: %s\n" \
> - "$$(date +%s.%N)" "$(1)" "$(2)" "$(3)" \
> + "$$(SOURCE_DATE_EPOCH= date +%s.%N)" "$(1)" "$(2)" "$(3)" \
> >>"$(BUILD_DIR)/build-time.log"
> endef
> GLOBAL_INSTRUMENTATION_HOOKS += step_time
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] pkg-generic: suppress SOURCE_DATE_EPOCH warning in step_time
2026-04-07 18:42 ` Arnout Vandecappelle via buildroot
@ 2026-04-08 9:29 ` Nicolas Cavallari
2026-04-08 9:57 ` Arnout Vandecappelle via buildroot
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Cavallari @ 2026-04-08 9:29 UTC (permalink / raw)
To: Arnout Vandecappelle, Nathan Bloch, buildroot
On 4/7/26 20:42, Arnout Vandecappelle via buildroot wrote:
> Hi Nathan,
>
> On 19/03/2026 11:42, Nathan Bloch wrote:
>> From: Nathan Bloch <nblochn@gmail.com>
>>
>> The step_time hook calls date +%s.%N to measure build step elapsed time.
>> When SOURCE_DATE_EPOCH is set (for reproducible builds), GNU coreutils
>> date
>> emits "Warning: using $SOURCE_DATE_EPOCH instead of true time" for every
>> call — twice per step, across all packages, resulting in hundreds of
>> noisy
>> log lines.
>
> I was going to apply but just to be sure I tested myself, and my
> (Fedora 43) GNU coreutils date turns out not to behave like that. So I
> went to the coreutils source and searched for SOURCE_DATE_EPOCH and for
> "instead of true time", and got no hits (except for the expected ones
> for SOURCE_DATE_EPOCH). It actually just uses true time. I also checked
> uutils and glibc just to be sure, found nothing there either.
>
> So it looks like you're using some patched version of GNU date. I'm
> not sure if it worth patching Buildroot to cater with that, unless
> you're on some pretty mainstream distro.
You need to enable BR2_REPRODUCIBLE to have package/fakedate/fakedate
installed as host/bin/date to obey SOURCE_DATE_EPOCH.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] pkg-generic: suppress SOURCE_DATE_EPOCH warning in step_time
2026-04-08 9:29 ` Nicolas Cavallari
@ 2026-04-08 9:57 ` Arnout Vandecappelle via buildroot
0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2026-04-08 9:57 UTC (permalink / raw)
To: Nicolas Cavallari, Nathan Bloch, buildroot
On 08/04/2026 11:29, Nicolas Cavallari wrote:
> On 4/7/26 20:42, Arnout Vandecappelle via buildroot wrote:
>> Hi Nathan,
>>
>> On 19/03/2026 11:42, Nathan Bloch wrote:
>>> From: Nathan Bloch <nblochn@gmail.com>
>>>
>>> The step_time hook calls date +%s.%N to measure build step elapsed time.
>>> When SOURCE_DATE_EPOCH is set (for reproducible builds), GNU coreutils date
>>> emits "Warning: using $SOURCE_DATE_EPOCH instead of true time" for every
>>> call — twice per step, across all packages, resulting in hundreds of noisy
>>> log lines.
>>
>> I was going to apply but just to be sure I tested myself, and my (Fedora 43)
>> GNU coreutils date turns out not to behave like that. So I went to the
>> coreutils source and searched for SOURCE_DATE_EPOCH and for "instead of true
>> time", and got no hits (except for the expected ones for SOURCE_DATE_EPOCH).
>> It actually just uses true time. I also checked uutils and glibc just to be
>> sure, found nothing there either.
>>
>> So it looks like you're using some patched version of GNU date. I'm not sure
>> if it worth patching Buildroot to cater with that, unless you're on some
>> pretty mainstream distro.
>
> You need to enable BR2_REPRODUCIBLE to have package/fakedate/fakedate installed
> as host/bin/date to obey SOURCE_DATE_EPOCH.
D'oh, I missed that.
However, how come host/bin/date gets used in the timing step? $(HOST_DIR)/bin
doesn't get exported to PATH, so it should only get used in the actual build and
configure steps (which use PATH=$(BR_PATH)).
I tried it locally (with BR2_REPRODUCIBLE=y obviously) and I don't see this issue.
Regards,
Arnout
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-08 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 10:42 [Buildroot] [PATCH] pkg-generic: suppress SOURCE_DATE_EPOCH warning in step_time Nathan Bloch
2026-04-07 18:42 ` Arnout Vandecappelle via buildroot
2026-04-08 9:29 ` Nicolas Cavallari
2026-04-08 9:57 ` Arnout Vandecappelle via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox