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

Replace the nondetermistic default locale_dir kwarg with fixed value for reproducibility #11037

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lamby
Copy link
Contributor

@lamby lamby commented Dec 19, 2022

Whilst working on the Reproducible Builds effort I noticed that sphinx could not be built reproducibly.

This is because the locale_dir keyword argument for the init_console method defaults to the path that method is implemented in (using Python's __file__ mechanism), and then that (non-deterministic) default argument is included in Sphinx's own documentation. This makes the build unreproducible as it varies depending on the directory you create the documentation from.

This patch uses the typical fn(arg1=None) […] if arg1 is None: arg1=defaultval pattern to avoid this, and was first submitted by me to Debian in bug #1025801.

…for reproducibility

Whilst working on the Reproducible Builds effort [0] I noticed that sphinx
could not be built reproducibly.

This is because the `locale_dir` keyword argument for the `init_console` method
defaults to the path that method is implemented in (using Python's `__file__`
mechanism), and then that (non-deterministic) default argument is included in
Sphinx's own documentation. This makes the build unreproducible as it varies
depending on the directory you create the documentation from.

This patch uses the typical `fn(arg1=None) […] if arg1 is None: arg1=defaultval`
pattern to avoid this and was first submitted by me to Debian in
bug #1025801 [1].

  [0] https://reproducible-builds.org/
  [1] https://bugs.debian.org/1025801
@lamby lamby force-pushed the default-locale_dir-argument branch from 7511281 to 1777a4c Compare December 19, 2022 15:35
@AA-Turner AA-Turner added this to the some future version milestone Apr 29, 2023
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.

None yet

2 participants