Open danbst opened 7 years ago
You might check out Debian to see if they have patches fixing this indeterminate issue
We might want to use CLONE_NEWUTS
in Nix instead and set some bogus hostname. whoami
is already handled (not sure though but I think the user is always root
or nixbld1
now). That leaves only date
.
Looking through Nix's source code we already use CLONE_NEWUTS
-- nice!
Perhaps use faketime (from libfaketime package)?
Could we have a setup hook that sets LD_PRELOAD
or DYLD_INSERT_LIBRARIES
(depending on platform) to use libfaketime (with SOURCE_DATE_EPOCH
) everywhere? It seems more robust than hunting and patching every last place that sets dates.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
The best solution would be that upstream stops doing that. It's not that useful, especially when we add arbitrary values in our build.
I marked this as stale due to inactivity. → More info
Issue description
I've tried to package a
tcptrace
tool. It was very easy, but during building it injects current hostname, build user and current datetime into executable, thus rendering it non-deterministic.What is the correct way to handle this? Should I patch inplace or
hostname
,whoami
anddate
should be replaced with smth immutable in defaultstdenv
?Steps to reproduce
Relevant part of makefile: