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

Tell people to report sysconfig issues to Apple #10707

Merged
merged 1 commit into from
Dec 4, 2021

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Dec 4, 2021

I’ve been ignoring this for a while becase it is extremely poor practice to install pip against an Xcode-installed Python, but this has been popping up much more frequently in #10151 for some reason that I feel we should do something about it. This Apple bug is actually quite serious. This is how the warnings look like:

WARNING: Value for prefixed-purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/n7/jxpt0h157xj8pwrmvy0h4_c80000gn/T/pip-build-env-0u_jk1as/normal/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Value for prefixed-platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/n7/jxpt0h157xj8pwrmvy0h4_c80000gn/T/pip-build-env-0u_jk1as/normal/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = '/private/var/folders/n7/jxpt0h157xj8pwrmvy0h4_c80000gn/T/pip-build-env-0u_jk1as/normal'
  WARNING: Value for prefixed-purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/n7/jxpt0h157xj8pwrmvy0h4_c80000gn/T/pip-build-env-0u_jk1as/overlay/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Value for prefixed-platlib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
  distutils: /private/var/folders/n7/jxpt0h157xj8pwrmvy0h4_c80000gn/T/pip-build-env-0u_jk1as/overlay/lib/python3.8/site-packages
  sysconfig: /Library/Python/3.8/site-packages
  WARNING: Additional context:
  user = False
  home = None
  root = None
  prefix = '/private/var/folders/n7/jxpt0h157xj8pwrmvy0h4_c80000gn/T/pip-build-env-0u_jk1as/overlay'

The warnign appear when the prefix is an overlay i.e. when pip is doing build isolation. The result is that, if Apple ships Python 3.10 with the same patch, pip will fail to correctly perform build isolation because sysconfig won’t install build backends to the overlay, but to /Library/Python. This patch suppresses the current warning, and emit a new one telling users clearly that Apple is the problem and how they can help. (From what I know, bugs reproted to Apple’s public platform tend to go into a void, but that’s the best we can do.)

@uranusjr uranusjr added the skip news Does not need a NEWS file entry (eg: trivial changes) label Dec 4, 2021
@uranusjr uranusjr added this to the 22.0 milestone Dec 4, 2021
@pfmoore
Copy link
Member

pfmoore commented Dec 4, 2021

I've not been following this work, but am I right that distutils gives the "right" answer here, and the problem is because Python are deprecating distutils, Apple no longer provide a supported way for us to get the correct values?

Should we (or someone) also be reporting this to CPython as a potential blocker for the removal of distutils? If nothing else, the core Python team is likely to have a lot more influence over Apple than we do. And I do feel that the Python devs should do a bit more to deal with some of the consequences of their decision to deprecate distutils, rather than leaving it all to the affected apps like us...

@uranusjr
Copy link
Member Author

uranusjr commented Dec 4, 2021

Yes, that’s correct. I expect Apple to do something about this in 3.10 (they haven’t distrubted it anywhere yet) since the scheme logic in distutils was re-written quite extensively in that version that Apple’s current patch won’t apply. But if they do release 3.10 with still an incorrect patch (we’ll know because users will come reporting build isolation breakages when that happens), this should be raised to CPython as a part of the distutils removal timeline consideration.

@uranusjr uranusjr merged commit 17c0281 into pypa:main Dec 4, 2021
@uranusjr uranusjr deleted the location-warning-suppress-apple branch December 4, 2021 11:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants