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

Make eext builds reproducible #101

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Conversation

aajith-arista
Copy link
Collaborator

Using the standard methods that make rpmbuild reproducible.

The idea here is to use the SOURCE_DATE_EPOCH environment to set build times, and the _buildhost rpm macro to freeze the build host.

We set the following macros to 1 and enable the behavior described below:

  1. source_date_epoch_from_changelog: SOURCE_DATE_EPOCH is set by rpmbuild to match the the latest changelog entry in the spec file. Note that if there's no changelog SOURCE_DATE_EPOCH is not set. It's upto the users to make sure there's a changelog entry.
  2. use_source_date_epoch_as_buildtime: This sets the build time as per thr variable.
  3. clamp_mtime_to_source_date_epoch: All file mtimes are clamped to this value.

References:
https://rpm-software-management.github.io/rpm/manual/buildprocess.html#Reproducability https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes rpm-software-management/mock#692

Fixes: BUG925340

Using the standard methods that make rpmbuild reproducible.

The idea here is to use the SOURCE_DATE_EPOCH environment to set build
times, and the _buildhost rpm macro to freeze the build host.

We set the following macros to 1 and enable the behavior described
below:
1. source_date_epoch_from_changelog: SOURCE_DATE_EPOCH is set by
   rpmbuild to match the the latest changelog entry in the spec file.
   Note that if there's no changelog SOURCE_DATE_EPOCH is not set. It's
   upto the users to make sure there's a changelog entry.
2. use_source_date_epoch_as_buildtime: This sets the build time as per
   thr variable.
3. clamp_mtime_to_source_date_epoch: All file mtimes are clamped to this
   value.

References:
https://rpm-software-management.github.io/rpm/manual/buildprocess.html#Reproducability
https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes
rpm-software-management/mock#692

Fixes: BUG925340
@manith-arista
Copy link
Contributor

Changes to create reproducible eext builds looks good.

@aajith-arista
Copy link
Collaborator Author

Changes to create reproducible eext builds looks good.

Can you pls approve. Now the branch protection rules mandates approval

Copy link
Contributor

@manith-arista manith-arista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, ship it.

@aajith-arista aajith-arista merged commit 3d01047 into main Mar 15, 2024
2 checks passed
@aajith-arista aajith-arista deleted the aajith-reproducible-builds branch March 15, 2024 10:54
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