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 builds reproducible #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

smortex
Copy link

@smortex smortex commented Jan 21, 2025

Pass the SOURCE_DATE_EPOCH down to the docker containers to allow reproducible builds.

When generating the changelog entry, also rely on this environment variable.

The caller is expected to provide a value for this variable.

@smortex
Copy link
Author

smortex commented Jan 21, 2025

The caller is expected to provide a value for this variable.

This needs to pass SOURCE_DATE_EPOCH in some way. I suggest doing it from the rake tasks in the consumer projects, see this PR for an example:
OpenVoxProject/openvox-agent#4

@nmburgan
Copy link
Contributor

We'll probably want to do some defaulting here so that if SOURCE_DATE_EPOCH is not set, it defaults to Time.now.

@smortex
Copy link
Author

smortex commented Jan 21, 2025

We'll probably want to do some defaulting here so that if SOURCE_DATE_EPOCH is not set, it defaults to Time.now.

Sure! I was (and am still) not sure about where are the entry points and how to avoid tests everywhere. For today, I will stick to try to understand what is going wrong with the issue with the images that are altered to add the current date and time to vendored files.

I will then setup a wip branch that people can use to start builds and hopefully have the same artifacts as me. In the meantime, let's mark this as a draft.

@smortex smortex marked this pull request as draft January 21, 2025 19:01
@nmburgan
Copy link
Contributor

I have an idea how we might make a single entry point here. Noodling on it now. Mind if I push a commit to your branch if I get it working?

smortex and others added 3 commits January 22, 2025 12:31
Pass the SOURCE_DATE_EPOCH down to the docker containers to allow
reproducible builds.

When generating the changelog entry, also rely on this environment
variable.

The caller is expected to provide a value for this variable.
This creates the source_date_epoch variable on the project object, picking it up from the SOURCE_DATE_EPOCH env var, or using the current time if that isn't set. It converts all times to UTC so it doesn't matter what time zone you are in when you run it.
@nmburgan nmburgan force-pushed the reproducible-builds branch from 9ff1e10 to 611dd7a Compare January 22, 2025 20:31
@smortex smortex marked this pull request as ready for review January 24, 2025 02:21
The openvox-agent pacakage contains some bits from openssl, in
particular a perl script `tsget.pl` and a symbolic link `tsget` that
points to it.

`dh_perl` wants to normalize shebangs in perl files, but depending on the
order files are enumerated, it breaks builds reproducibility:
  * When `dh_perl.pl` is found first, it is normalized (replaced by a new
    regular file with the normalized shebang), and then when
    `dh_perl` is found it does not need normalizing and is kept
    unchanged.
    The package has `dh_perl.pl` as a regular file, and `dh_perl` as a
    symbolic link to that file.
  * When `dh_perl` is found first, it is normalized (replaced by a new
    regular file with the normalized shebang), and then `dh_perl.pl` is
    found and it is also normalized.
    The package has `dh_perl.pl` and `dh_perl` as two regular files.

While some debhelpers can have support for an `-X` flag to exclude
files, `dh_perl` ignore it, so we cannot rely on it.

Because perl files in the OpenVox packages are only third-party tools,
we can skip this helper to avoid breaking builds reproducibility.
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.

3 participants