feat(e2e): Add source-built Python interpreter e2e test#833
Open
feat(e2e): Add source-built Python interpreter e2e test#833
Conversation
|
|
2 tasks
- 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>
d2f03fc to
a61cc85
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
fix(sdist_build): Fix native sdist builds for no-binary packages
is_native = is_no_binaryso packages in[tool.uv] no-binary-packageusesdist_native_build(C extension support) instead ofsdist_build(anyarch only)"exec"to"target"so the build helper runs with the target Python interpreteros.environinbuild_helper.pyinstead of replacing it, so PATH and other essentials are availablefeat(e2e): Add source-built Python interpreter e2e test
--with-pydebug(producingcp311dABI tag) usingrules_foreign_ccconfigure_makeand hermetic zlib from BCRtest_source_built: verifies the debug interpreter runs correctly and reports expected version/ABItest_with_deps: forces markupsafe sdist build viano-binary-package, verifies the resulting wheel hascp311dABI tag (proving the custom interpreter built the C extension)source_built_transitionscopes--copt=-fPICto 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— PASSEDbazel test //cases/source-built-python:test_with_deps— PASSED🤖 Generated with Claude Code