Skip to content

feat(e2e): Add source-built Python interpreter e2e test#833

Open
arrdem wants to merge 3 commits intomainfrom
arrdem/e2e-source-built-python-v2
Open

feat(e2e): Add source-built Python interpreter e2e test#833
arrdem wants to merge 3 commits intomainfrom
arrdem/e2e-source-built-python-v2

Conversation

@arrdem
Copy link
Copy Markdown
Contributor

@arrdem arrdem commented Mar 7, 2026

Summary

  • fix(sdist_build): Fix native sdist builds for no-binary packages

    • Set is_native = is_no_binary so packages in [tool.uv] no-binary-package use sdist_native_build (C extension support) instead of sdist_build (anyarch only)
    • Change tool attr cfg from "exec" to "target" so the build helper runs with the target Python interpreter
    • Inherit os.environ in build_helper.py instead of replacing it, so PATH and other essentials are available
    • Detect stale sysconfig CC paths (from hermetic toolchain builds) and override with system CC/CFLAGS/LDSHARED defaults
  • feat(e2e): Add source-built Python interpreter e2e test

    • Build CPython 3.11.9 from source with --with-pydebug (producing cp311d ABI tag) using rules_foreign_cc configure_make and hermetic zlib from BCR
    • test_source_built: verifies the debug interpreter runs correctly and reports expected version/ABI
    • test_with_deps: forces markupsafe sdist build via no-binary-package, verifies the resulting wheel has cp311d ABI tag (proving the custom interpreter built the C extension)
    • source_built_transition scopes --copt=-fPIC to this test configuration only (needed because BCR zlib's static archive gets linked into CPython's shared extension modules)

Test plan

  • bazel test //cases/source-built-python:test_source_built — PASSED
  • bazel test //cases/source-built-python:test_with_deps — PASSED
  • Other e2e tests unaffected (all pass, cached)

🤖 Generated with Claude Code

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 7, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ claude
❌ aspect-marvin
You have signed the CLA already but the status is still pending? Let us recheck it.

claude and others added 2 commits March 6, 2026 23:57
- Set is_native = is_no_binary so packages listed in [tool.uv]
  no-binary-package use sdist_native_build (C extension support)
  instead of sdist_build (anyarch only)
- Change tool attr cfg from "exec" to "target" so the build helper
  runs with the target Python interpreter
- Inherit os.environ in build_helper.py instead of replacing it,
  so PATH and other essentials are available
- Detect stale sysconfig CC paths (from hermetic toolchain builds)
  and override with system CC/CFLAGS/LDSHARED defaults

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Build CPython 3.11.9 from source with --with-pydebug (producing cp311d
ABI tag) using rules_foreign_cc configure_make and hermetic zlib from
BCR. Includes two test cases:

- test_source_built: verifies the debug interpreter runs correctly
  and reports the expected version/ABI
- test_with_deps: forces markupsafe sdist build via no-binary-package,
  verifies the resulting wheel has cp311d ABI tag (proving the custom
  interpreter built the C extension)

The source_built_transition scopes --copt=-fPIC to this test
configuration only, needed because BCR zlib's static archive gets
linked into CPython's shared extension modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@arrdem arrdem force-pushed the arrdem/e2e-source-built-python-v2 branch from d2f03fc to a61cc85 Compare March 7, 2026 06:58
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows bot commented Mar 7, 2026

Bazel 8 (Test)

All tests were cache hits

87 tests (100.0%) were fully cached saving 47s.


Bazel 9 (Test)

All tests were cache hits

87 tests (100.0%) were fully cached saving 1m 15s.


Bazel 8 (Test)

e2e

Buildkite build #2785 is running...


Bazel 9 (Test)

e2e

Buildkite build #2785 is running...


Bazel 8 (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 444ms.

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.

4 participants