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

Reproducible builds by default #22

Open
chadac opened this issue Jun 20, 2022 · 1 comment
Open

Reproducible builds by default #22

chadac opened this issue Jun 20, 2022 · 1 comment

Comments

@chadac
Copy link

chadac commented Jun 20, 2022

There is currently a known issue with wheel where the built artifacts are not 100% deterministic -- the compressed wheel uses the current timestamp when adding dates to files. This is an issue for creating reproducible builds as the hash of two identical wheels built at different times are different.

This can be resolved (as referred in the issue) by setting SOURCE_DATE_EPOCH to a post 1980-01-01 date before running wheel, and in tox by passing it via setenv or passenv. However, I'm wondering if this is perhaps something that should be set as a sane default for developers? It seems like having deterministic builds by default would be better in almost all scenarios.

I think this could be done as a hook into the venv before running -- by perhaps setting setenv in the venv before execution, (if setenv or passenv doesn't contain this already) and adding an env flag --wheel-constant-source-date for people to reset to legacy behavior.

For other package builder examples -- Poetry has this as an unconfigurable default.

I'm curious what other's thoughts are on this. At least in my opinion, I think determinism should be a default, although I'm not sure if other processes could depend on these timestamps.

@mcarans
Copy link
Contributor

mcarans commented Aug 16, 2022

Determinism seems like a sensible default to me.

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

No branches or pull requests

2 participants