Skip to content

[codex] Try dropping fix(sdist): build helper uses py_binary - #1

Closed
zbarsky-openai wants to merge 6 commits into
openai/v1.11.1-monorepo-patch-stack-20260413from
codex/drop-build-helper-py-binary
Closed

zbarsky-openai wants to merge 6 commits into
openai/v1.11.1-monorepo-patch-stack-20260413from
codex/drop-build-helper-py-binary

Conversation

@zbarsky-openai

Copy link
Copy Markdown
Owner

What changed

This branch removes the fix(sdist): build helper uses py_binary patch from the current patch stack and leaves the rest of the stack intact.

Why

This is an experiment to see whether the sdist helper can go back to py_venv_binary without carrying the dedicated py_binary_rule change.

Impact

The PR diff is limited to uv/private/sdist_build/repository.bzl, switching the generated build_tool target back from py_binary_rule to py_venv_binary.

Root cause / hypothesis

The current stack introduced py_binary_rule for the temporary sdist build helper because it is an ordinary executable tool rather than a venv entrypoint. This PR exists to test whether that change is actually required in practice.

Validation

Attempted bazel test //e2e/cases/uv-patching-829:test twice from the experiment worktree, but both runs failed before test execution due to transient external fetch errors from GitHub Releases (GET returned 504 Gateway Time-out while downloading Bazel module archives).

zbarsky-openai and others added 6 commits April 13, 2026 12:08
The sdist build helper should run under the same Python version the project requested, otherwise build backends and build-only dependencies can be resolved for the wrong interpreter.
Thread `python_version` into the generated build tool so source builds use the configured Python consistently.

Co-authored-by: Codex <noreply@openai.com>
`compileall` failures during unpack are currently non-fatal, but the warning noise makes successful installs look broken and obscures real errors later in the build.
Drop the warning spam while still ignoring the non-zero exit code.

Co-authored-by: Codex <noreply@openai.com>
The setup.py probe used during native-build detection must emit machine-readable JSON, but many setup scripts print banners or capability checks to stdout or stderr first.
Capture that incidental output so the repository rule sees only the structured result.

Co-authored-by: Codex <noreply@openai.com>
Runfiles data dependencies should not inherit a parent binary's custom Python version or venv transition, because they are packaged artifacts rather than part of the selected runtime.
Reset Python flags on `data` edges and add tests so probes embedded in runfiles always see the default lock venv.

Co-authored-by: Codex <noreply@openai.com>
Compatibility selects with no matching venv currently fail with a generic alias mismatch that does not tell the user how to recover.
Add an explicit no-match error that points at the `venv` flag or top-level target attribute so incompatible wheel repos fail with actionable guidance.

Co-authored-by: Codex <noreply@openai.com>
@zbarsky-openai

Copy link
Copy Markdown
Owner Author

Closing this experiment; it was opened in the wrong repo.

@zbarsky-openai
zbarsky-openai deleted the codex/drop-build-helper-py-binary branch April 13, 2026 16:15
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.

2 participants