Skip to content

Conversation

@toabctl
Copy link

@toabctl toabctl commented Dec 5, 2025

To make the build reproducable (see [0]), respect the SOURCE_DATE_EPOCH variable and don't include a build timestammp in the binary when set.

[0] https://reproducible-builds.org/

@toabctl
Copy link
Author

toabctl commented Dec 5, 2025

tested with:

❯ make dist     
CGO_ENABLED=0 go build -o listmonk -ldflags="-s -w -X 'main.buildString=v5.1.0 (#f8dee184 2025-12-05T07:48:45+0000)' -X 'main.versionString=v5.1.0'" cmd/*.go

vs.

❯ SOURCE_DATE_EPOCH=1 make dist 
CGO_ENABLED=0 go build -o listmonk -ldflags="-s -w -X 'main.buildString=v5.1.0 (#f8dee184)' -X 'main.versionString=v5.1.0'" cmd/*.go

To make the build reproducable (see [0]), respect the
SOURCE_DATE_EPOCH variable and don't include a build timestammp in the
binary when set.

[0] https://reproducible-builds.org/
@toabctl toabctl force-pushed the reproducable-build branch from f8dee18 to 05b68cc Compare December 5, 2025 07:50
@knadh
Copy link
Owner

knadh commented Dec 12, 2025

Hi @toabctl. If SOURCE_DATE_EPOCH is set, it should be used as the Unix timestamp offset and the date should be derived from that, otherwise, the system time. Here, if it's set, the date bit in the build string is completely eliminated, which isn't right.

@knadh
Copy link
Owner

knadh commented Dec 29, 2025

@toabctl would you be able to review this?

@toabctl
Copy link
Author

toabctl commented Jan 3, 2026

@toabctl would you be able to review this?

I'll do during the next days. sorry for the delay

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants