python / python/cpython

_osx_support._default_sysroot is dead in CPython but used downstream with no public replacement

Open
#150,881 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OS-mac stdlib
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

_osx_support._default_sysroot(cc) has no caller inside CPython, yet several downstream projects import it directly and there is no public replacement to send them to.

Lifecycle

  • GH-23301 (bpo-41116) added it to locate the macOS 11 SDK sysroot when building extensions.
  • Its only in-tree caller lived in distutils. GH-99061 (gh-92584) removed distutils, so nothing in CPython calls it now.

Downstream use

A GitHub code search finds live callers: pyston (setup.py), PyOxidizer (vendored distutils/unixccompiler.py), and the macports and fink Python patches. They call it to discover the SDK sysroot when compiling extensions.

No public replacement

sysconfig does not expose the SDK sysroot and distutils is gone, so a downstream user has nowhere supported to move. They would shell out to xcrun --show-sdk-path or copy the function body.

Question

For this private helper with live downstream use and no public equivalent, which way do we go:

  1. Keep it as-is and document that it is unsupported.
  2. Add a supported public equivalent first, then deprecate and remove.
  3. Remove it now under the "private API carries no guarantee" rule and accept the breakage.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting _osx_support._default_sysroot(cc) and the downstream entry points named in the issue: pyston's setup.py, PyOxidizer's vendored distutils/unixccompiler.py, and the macports and fink patches. Determine whether a supported replacement, documentation, or removal path is appropriate; the work is done when the chosen policy and downstream migration path are clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.