fix(uv): select C++ compiler companions#1213
Conversation
py_binary startup benchmark
sys.path quality
✅ No regression detected (PR is +1.1% vs HEAD main) |
Native wheel builds export the selected C driver as both CC and CXX. When the toolchain exposes clang/clang++ or gcc/g++, C++ extension links can run through the C driver and omit the C++ runtime. Recognize exact or numeric-suffixed clang/gcc drivers and select the same-directory C++ companion from existing toolchain inputs. Preserve same-driver fallback when no companion is declared. Add coverage for exact, versioned, near-miss, and fallback cases, and make native-sdist e2e require a real C++ runtime.
bc2c5e6 to
63c05c0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc2c5e6d30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Native PEP 517 wheel builds export the selected C compiler as both CC
and CXX. With clang/clang++ or gcc/g++, C++ extensions can link through
the C driver and omit the C++ runtime.
This recognizes only exact or numeric-suffixed clang/gcc names, selects
the same-directory companion already in the toolchain inputs, and
preserves the existing same-driver fallback when no companion is
declared. It also rejects near-miss tool names such as clang-cl and
gcc-ar.
The unit and analysis coverage covers exact, versioned, near-miss, and
missing-companion cases. The native-sdist e2e patches python-geohash
with std::string so Linux CI must link a real C++ runtime. Local
compiler-driver and toolchain-env tests, canonical snapshots, snapshot
tests, Buildifier, and diff check pass. Linux runtime e2e is left to CI
on this macOS host.