-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat: reproducible packages #748
Conversation
defaults to $SOURCE_DATE_EPOCH closes #744 closes #734 Signed-off-by: Carlos Alexandro Becker <[email protected]>
Deploying with Cloudflare Pages
|
PS: jury not set on the field name, feel free to suggest others |
closes #739
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.
OOH! Thank you! This looks fantastic.
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #748 +/- ##
==========================================
- Coverage 75.36% 74.93% -0.43%
==========================================
Files 10 11 +1
Lines 2440 2466 +26
==========================================
+ Hits 1839 1848 +9
- Misses 425 439 +14
- Partials 176 179 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Carlos Alexandro Becker <[email protected]>
Use commit time in mod_timestamp, as documented in: https://goreleaser.com/customization/builds/#reproducible-builds https://goreleaser.com/blog/reproducible-builds/ https://goreleaser.com/customization/templates/?h=templates#common-fields ## Test plan: ### Before. Build two times: ``` goreleaser release --snapshot --clean -f .goreleaser.yml mv dist/ ~/tmp/dist_before goreleaser release --snapshot --clean -f .goreleaser.yml vimdiff dist/SHA256SUMS ~/tmp/dist_before/SHA256SUMS ``` Observe all the shasums are different: ![image](https://github.com/user-attachments/assets/ed0b932c-ab5b-46de-bf73-0516e223af8a) ### After: Do the build two times, ``` goreleaser release --snapshot --clean -f .goreleaser.yml mv dist/ ~/tmp/dist_after goreleaser release --snapshot --clean -f .goreleaser.yml vimdiff dist/SHA256SUMS ~/tmp/dist_after/SHA256SUMS ``` Observe that only rpm and deb packages are different ![image](https://github.com/user-attachments/assets/ad4e3786-5d2b-480b-9e66-c2824f379d57) There was a feature added to goreleaser to make packages reproducible too, but I haven't figured out how to use it yet: goreleaser/nfpm#748 I asked in Discord. We can tackle that separately Signed-off-by: Alex Bozhenko <[email protected]>
This adds a new
mtime
fields to the root of the yaml configuration file, and replace all occurrences oftime.Now()
with its value.This should help making packaging reproducible.
Also, if that value is empty, it will default to
$SOURCE_DATE_EPOCH
as per reproducible-builds.orgIt also fixes several instances in which ordering could change, changing the contents of the package slightly (namely, usage of maps).
closes #744
closes #734