erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

Document reproducible builds of YAWS #447

Closed avtobiff closed 2 years ago

avtobiff commented 2 years ago

Document how to enable reproducible builds (export environment variables YAWS_DETERMINISTIC_BUILD and SOURCE_DATE_EPOCH when building) and what that entails for the build artefacts. Also note that various paths are included in generated files i.e. installation prefix affects build artefacts, which can be mitigated by using DESTDIR.

SOURCE_DATE_EPOCH is understood by pdflatex, thus setting it to the same unix timestamp across builds will make yaws.pdf build determenistically. However, latex/dvips does not understand SOURCE_DATE_EPOCH, thus the generated date in the DVIPSSource comment is generated from SOURCE_DATE_EPOCH if set.

Fixes #446

vinoski commented 2 years ago

Thanks for this change!

I modified it to use erl instead of date to get the datestring from SOURCE_DATE_EPOCH, as the date command in the original PR doesn't work on macOS.

This change is now on master.