Fix issue 20444 - Support SOURCE_DATE_EPOCH for reproducible builds#11035
Fix issue 20444 - Support SOURCE_DATE_EPOCH for reproducible builds#11035dlang-bot merged 3 commits intodlang:masterfrom
SOURCE_DATE_EPOCH for reproducible builds#11035Conversation
|
Thanks for your pull request, @Geod24! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#11035" |
c1c3acf to
ddef3ed
Compare
ddef3ed to
4ab95db
Compare
4ab95db to
42096e1
Compare
|
Rebased on master, fixed the styling error, applied @WebFreak001 's suggestion. |
42096e1 to
f06d8dc
Compare
Instead of having those `__gshared` constant hiddent in the middle of a very long function, move them to a struct and add documentation.
f06d8dc to
f67c53a
Compare
Adds support for the de-facto standard `SOURCE_DATE_EPOCH` variable, for lexer tokens `__DATE__`, `__TIME__`, `__TIMESTAMP__`.
f67c53a to
bfb538a
Compare
|
Moving things to target was a terrible idea. I changed that now, the PR should be much simpler. |
|
Ping ? |
|
Awesome to see this PR! I tried to build dmd 2.09 with this PR but it doesn't seem compatible. I'll check if it's do-able to build master on Arch. |
|
Works perfectly for me. Checked on Linux, amd64, with dmd v2.092.0. Thanks! |
|
I missed this PR, thanks a lot @Geod24! On less thing to worry about when building D code on NixOS ;) |
@Geod24 yes I am interested, and the implementation is wrong. Thanks for crossing me out. :-) $ cat test.c
#include <stdio.h>
void main() { printf(__DATE__ " " __TIME__ "\n"); }
$ SOURCE_DATE_EPOCH=1 gcc test.c -o test-c
$ ./test-c
Jan 1 1970 00:00:01$ cat test.d
import core.stdc.stdio;
void main() { printf(__DATE__ ~ " " ~ __TIME__ ~ "\n"); }
$ SOURCE_DATE_EPOCH=1 dmd test.d -oftest-d
$ ./test-d
Dec 31 1969 16:00:01 |
Since this PR touches a bunch of unrelated things, I'll split it into multiple PRs, this PR is solely to show the end goal.CC @jelly : Can you check the last commit ?
CC @ibuclaw , you might be interested in this.