Skip to content

Set PYTHONHASHSEED for reproducible .pycs #48908

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

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Apr 3, 2025

No description provided.

Copy link
Member

@techalchemy techalchemy left a comment

Choose a reason for hiding this comment

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

Gentoo seems to set PYTHONHASHSEED to SOURCE_DATE_EPOCH: https://wiki.gentoo.org/wiki/User:OstCollector/Reproducible_Build#The_use_of_SOURCE_DATE_EPOCH_and_PYTHONHASHSEED

OpenSUSE uses a static value of 0: https://lists.reproducible-builds.org/pipermail/rb-general/2024-June/003436.html and https://github.com/openSUSE/post-build-checks/blob/master/suse-buildsystem.sh#L8

and it looks like arch has also fixed this by pinning to 0: https://archlinux.org/todo/unreproducible-python-bytecode/

Note that I don't think it really matters what we set this to, as long as it is deterministic.

Relevant CPython Bug: python/cpython#73894

cc @pnasrat

@imjasonh imjasonh marked this pull request as ready for review April 4, 2025 01:20
@pnasrat
Copy link
Contributor

pnasrat commented Apr 4, 2025

This seems reasonable and thanks @techalchemy for looking at other distros.

Copy link
Contributor

@pnasrat pnasrat left a comment

Choose a reason for hiding this comment

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

LGTM

@imjasonh imjasonh merged commit 2892eda into wolfi-dev:main Apr 4, 2025
14 checks passed
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