Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 20444 - Support SOURCE_DATE_EPOCH for reproducible builds #11035

Merged
merged 3 commits into from
Apr 17, 2020

Conversation

Geod24
Copy link
Member

@Geod24 Geod24 commented Apr 14, 2020

Adds support for the de-facto standard `SOURCE_DATE_EPOCH` variable,
for lexer tokens `__DATE__`, `__TIME__`, `__TIMESTAMP__`.

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.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @Geod24!

Bugzilla references

Auto-close Bugzilla Severity Description
20444 enhancement Make DATE in dlang reproducible using SOURCE_DATE_EPOCH

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#11035"

src/dmd/target.d Outdated Show resolved Hide resolved
@Geod24 Geod24 force-pushed the source-date-epoch branch from 4ab95db to 42096e1 Compare April 14, 2020 14:04
@Geod24
Copy link
Member Author

Geod24 commented Apr 14, 2020

Rebased on master, fixed the styling error, applied @WebFreak001 's suggestion.

@Geod24 Geod24 force-pushed the source-date-epoch branch from 42096e1 to f06d8dc Compare April 14, 2020 18:06
Geod24 added 2 commits April 15, 2020 22:01
Instead of having those `__gshared` constant hiddent in the middle of a very long function,
move them to a struct and add documentation.
@Geod24 Geod24 force-pushed the source-date-epoch branch from f06d8dc to f67c53a Compare April 15, 2020 13:18
Adds support for the de-facto standard `SOURCE_DATE_EPOCH` variable,
for lexer tokens `__DATE__`, `__TIME__`, `__TIMESTAMP__`.
@Geod24 Geod24 force-pushed the source-date-epoch branch from f67c53a to bfb538a Compare April 15, 2020 13:21
@Geod24
Copy link
Member Author

Geod24 commented Apr 15, 2020

Moving things to target was a terrible idea. I changed that now, the PR should be much simpler.

@Geod24
Copy link
Member Author

Geod24 commented Apr 16, 2020

Ping ?

@dlang-bot dlang-bot merged commit 4a9d5a0 into dlang:master Apr 17, 2020
@Geod24 Geod24 deleted the source-date-epoch branch April 17, 2020 00:39
@jelly
Copy link

jelly commented Apr 17, 2020

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.

@baryluk
Copy link

baryluk commented May 28, 2020

Works perfectly for me. Checked on Linux, amd64, with dmd v2.092.0.

Thanks!

@PetarKirov
Copy link
Member

PetarKirov commented Mar 26, 2021

I missed this PR, thanks a lot @Geod24! On less thing to worry about when building D code on NixOS ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants