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

MAINT: Work around non-deterministic Python readdir order in distutils #11163

Merged
merged 1 commit into from May 28, 2018

Conversation

bmwiedemann
Copy link
Contributor

@bmwiedemann bmwiedemann commented May 26, 2018

Sort input file list
so that the python-scikit-learn openSUSE package
that uses config.add_extension(name, "path/to/*.cpp", ...)
builds in a reproducible way
in spite of indeterministic filesystem readdir order
and http://bugs.python.org/issue30461

See https://reproducible-builds.org/ for why this is good.

@@ -882,7 +882,7 @@ def _wildcard_get_subpackage(self, subpackage_name,
caller_level = 1):
l = subpackage_name.split('.')
subpackage_path = njoin([self.local_path]+l)
dirs = [_m for _m in glob.glob(subpackage_path) if os.path.isdir(_m)]
dirs = [_m for _m in sorted(glob.glob(subpackage_path)) if os.path.isdir(_m)]
Copy link
Member

Choose a reason for hiding this comment

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

Sort of inconsistent with what you do above. Either you should sort the outer list comprehension here, or you should always sort glob, even if it's unused.

My preference would be a sorted_glob helper function, with a comment explaining why it's necessary.

so that the python-scikit-learn openSUSE package
that uses config.add_extension(name, "path/to/*.cpp", ...)
builds in a reproducible way
in spite of indeterministic filesystem readdir order
and http://bugs.python.org/issue30461

See https://reproducible-builds.org/ for why this is good.
@charris charris changed the title Sort input file list MAINT: Work around non-deterministic Python readdir order in distutils May 27, 2018
@charris
Copy link
Member

charris commented May 27, 2018

@eric-wieser Look good to you?

@eric-wieser eric-wieser merged commit 40b55b6 into numpy:master May 28, 2018
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

3 participants