Skip to content

fix(uv): select C++ compiler companions#1213

Open
tamird wants to merge 1 commit into
aspect-build:mainfrom
tamird:fix-native-cxx-driver-v1
Open

fix(uv): select C++ compiler companions#1213
tamird wants to merge 1 commit into
aspect-build:mainfrom
tamird:fix-native-cxx-driver-v1

Conversation

@tamird

@tamird tamird commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

py_binary startup benchmark

Version Mean (ms) Median (ms) ± stddev vs BCR vs main Build (s)
BCR 1.11.7 (baseline) 154.285 154.220 ±3.318 32.79
HEAD main 54.858 54.701 ±1.110 -64.4% 9.66
This PR 55.480 54.753 ±3.660 -64.0% +1.1% 7.02

Measured with hyperfine --warmup 5 --runs 50 on Linux
Gate: PR vs HEAD main (threshold: 10%). BCR is shown only as a historical baseline.
Build time: cold bazel build //:bench with isolated output base, no disk cache.

sys.path quality

Version sys.path entries distinct site-packages roots duplicate realpaths
BCR 1.11.7 (baseline) 6 1 0
HEAD main 7 2 0
This PR 7 2 0

sys.path quality measured by bench_syspath inside the assembled venv. Duplicate realpaths indicate symlink redundancy; many distinct site-packages roots suggest an inefficient venv layout.

✅ 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.
@tamird tamird force-pushed the fix-native-cxx-driver-v1 branch from bc2c5e6 to 63c05c0 Compare June 28, 2026 04:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread e2e/cases/uv-sdist-native-build/require_cxx_driver.patch

tamird commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

The full matrix is green at 63c05c0. @jbedard, this is the downstream fasttext C++ runtime failure: native wheel builds now use the selected toolchain's declared clang++/g++ companion when present, with same-driver fallback otherwise. Ready for independent review.

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.

1 participant