-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
python312Packages.python-ldap: fix build #326321
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we agreed on Matrix that this seems really wrong, but not on exactly what’s going on here or how it should be fixed. If this is required it should at least be in the main
setuptoolspackage, I guess.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe cython/cython#5754 (comment) provides a clear picture of what happened and how the Python 3.12 distutils issue is specific to Nix. Though
setuptools/_distutilsis and should be setuptools-free, so I have no idea yet for an upstreamable fix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate why this is really wrong?
At first glance it looks like it would only affect the non-propagated build-system of this specific package. Is it about the import of an explicitly internal vendored distutils from setuptools? Or am I missing something obvious?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this is breaking on something
setuptoolsis doing internally. It’s generating a script that referencesdistutils.util, running it, and hitting an error. Therefore, eitherpython-ldapis somehow holdingsetuptoolsin a way that is really wrong and triggering this error (and therefore we should patchpython-ldap, notsetuptools), or this would be broken in more packages than justpython-ldap, so we should fix it in oursetuptoolspackage, or in our general Python environment handling if there’s something we’re doing to cause it. Patchingsetuptoolsonly withinpython-ldapcan’t be the right answer.And indeed, @wegank’s link confirms to me that it’s an issue with our Python environment. Perhaps we should include this hack in our
setuptoolspackage for now until we figure out a better fix? Do we know the exact chain of features/code that causesetuptoolsto start executing this vendoreddistutilscode path?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, the relevant code: https://github.com/pypa/setuptools/blob/634d81da556bde64279f36348fd94c7f4ad13bfb/setuptools/_distutils/util.py#L406-L446
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setuptools provides a .pth file to make the vendored distutils importable via
import distutilsat every Python startup, except that the mechanism doesn't work for Nix. As a result, we're making PRs to solve missing distutils issues that don't exist on other distros.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW it’s probably not entirely a bad thing that it doesn’t work for us, because things really shouldn’t be using
distutilsanyway! But it is kind of annoying in the meantime.If we don’t want to deal with it we could just make
setuptoolspropagate aPYTHONPATHthat letsdistutilsbe found directly. I presume there’s a reason they did it the way they did, though.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explaination. I miss-understood that the fix was wrong per se, my new understanding is that
python3.pkgs.setuptoolsmight be a better place to get it's behavior a bit closer to conventional venvs.Thef first link @wegank posted seems to imply the reason could be to shadow an (older) distutils from the standard library where available:
This doesn't seem like a concern for us if we apply only for python >=3.12 (where there is no distutils in stdlib)