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

feat: reproducible packages #748

Merged
merged 9 commits into from
Dec 7, 2023
Merged

feat: reproducible packages #748

merged 9 commits into from
Dec 7, 2023

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Dec 6, 2023

This adds a new mtime fields to the root of the yaml configuration file, and replace all occurrences of time.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.org

It also fixes several instances in which ordering could change, changing the contents of the package slightly (namely, usage of maps).

closes #744
closes #734

defaults to $SOURCE_DATE_EPOCH

closes #744
closes #734

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 added the enhancement New feature or request label Dec 6, 2023
@caarlos0 caarlos0 self-assigned this Dec 6, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 6, 2023
Copy link

cloudflare-pages bot commented Dec 6, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: f2da005
Status: ✅  Deploy successful!
Preview URL: https://387daf8f.nfpm.pages.dev
Branch Preview URL: https://dates.nfpm.pages.dev

View logs

@caarlos0
Copy link
Member Author

caarlos0 commented Dec 6, 2023

PS: jury not set on the field name, feel free to suggest others

@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 6, 2023
Copy link
Contributor

@cognifloyd cognifloyd left a 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.

@caarlos0 caarlos0 requested a review from a team December 6, 2023 11:47
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (60cff80) 75.36% compared to head (f2da005) 74.93%.
Report is 2 commits behind head on main.

Files Patch % Lines
deb/deb.go 67.21% 11 Missing and 9 partials ⚠️
arch/arch.go 72.22% 0 Missing and 5 partials ⚠️
nfpm.go 89.28% 2 Missing and 1 partial ⚠️
apk/apk.go 85.71% 1 Missing and 1 partial ⚠️
files/files.go 94.44% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

@caarlos0 caarlos0 changed the title feat: allow to set a build date feat: reproducible packages Dec 7, 2023
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 merged commit 9c4fc0e into main Dec 7, 2023
40 of 42 checks passed
@caarlos0 caarlos0 deleted the dates branch December 7, 2023 16:58
@caarlos0 caarlos0 added this to the v2.35.0 milestone Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nfpm does not ensure reproducible builds Add support for SOURCE_DATE_EPOCH
3 participants