-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcc-wrapper: make __DATE__/__TIME__ deterministic
...when NIX_ENFORCE_PURITY=1. @vcunat corrected the date according to docs. https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html In order to handle the spaces well, the extraAfter array had to be quoted more properly and appended by +=.
- Loading branch information
1 parent
7141303
commit aa119e1
Showing
1 changed file
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aa119e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this broke unzip in staging: http://hydra.nixos.org/build/14219164/nixlog/1/raw
aa119e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be cleaner to just patch the implementation of
__DATE__
and__TIME__
in gcc itself? Shouldn't be too hard.aa119e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The breakages were IMO because of the missing quotes around the date string, so the expanded macro was not a string (I forgot those, I'm sorry). That should've been fixed by e766f0b (still OK after 552b105).
aa119e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preprocessor flags could be shared by multiple compilers (which we currently don't do AFAIK). Anyway, a real general solution is LD_PRELOADing libfaketime or similar, which also seems to be among the patches in #2281 (31e433b).
aa119e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed locally that unzip builds in current staging (552b105).