Skip to content

chore: always use starlark-based extraction for wheels#3748

Merged
rickeylev merged 8 commits intobazel-contrib:mainfrom
rickeylev:chore.only.pipstar.extract
May 1, 2026
Merged

chore: always use starlark-based extraction for wheels#3748
rickeylev merged 8 commits intobazel-contrib:mainfrom
rickeylev:chore.only.pipstar.extract

Conversation

@rickeylev
Copy link
Copy Markdown
Collaborator

@rickeylev rickeylev commented Apr 30, 2026

Currently, the Python installer library is used for extracting a wheel when Bazel 7 is used. This library only outputs platform-specific extractions, and it was hard-coded to use a unixy style install. This ends up hiding Windows pythonw-based scripts and entry points because those are normalized to simply python on unix.

To fix, use the Starlark-based extraction logic instead. This is a simpler implementation that extracts the wheels mostly as-is, which allows build-phase logic to handle platform-specific differences.

This also makes the Starlark based extraction work for Bazel 8.3 and earlier, which previously didn't support it.

@rickeylev rickeylev requested a review from aignas as a code owner April 30, 2026 01:53
@rickeylev
Copy link
Copy Markdown
Collaborator Author

Am I missing something? This seems too easy to remove 😅

Ah there we go, CI flagged something...

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request streamlines the wheel extraction logic by removing the _extract_whl_py helper and the enable_pipstar_extract flag, defaulting to whl_extract. A review comment identifies that the reproducible flag in repo_metadata is now applied unconditionally, which could be incorrect if an sdist was built, potentially impacting cache correctness.

Comment thread python/private/pypi/whl_library.bzl
@rickeylev
Copy link
Copy Markdown
Collaborator Author

@aignas re: the gemini comment that its incorrectly marked reproducible even if an sdist is built:

I think it's right, but that bug looks to be pre-existing. Right now, pipstar extraction is used for bazel 8+, so it'll always be marked reproducible, even if an sdist was used. I'm going to leave that alone in this PR.

Currently, the Python `installer` library is used for
extracting a wheel when Bazel 7 is used. This library only outputs
platform-specific extractions, and it was hard-coded to use a unixy
style install. This ends up hiding Windows `pythonw`-based scripts and
entry points because those are normalized to simply `python` on unix.

To fix, use the Starlark-based extraction logic instead. This is a
simpler implementation that extracts the wheels mostly as-is, which
allows build-phase logic to handle platform-specific differences.

This also makes the Starlark based extraction work for Bazel 8.3 and
earlier, which previously didn't support it.
@rickeylev rickeylev force-pushed the chore.only.pipstar.extract branch from 9712d5d to 04f320b Compare April 30, 2026 03:34
Copy link
Copy Markdown
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

LGTM, please also cleanup the python sources that handle extraction and the config repo of unused config flags.

@rickeylev
Copy link
Copy Markdown
Collaborator Author

LGTM, please also cleanup the python sources that handle extraction and the config repo of unused config flags.

Done! Killed wheel.py and its supporting code.

@rickeylev rickeylev added this pull request to the merge queue May 1, 2026
@rickeylev rickeylev removed this pull request from the merge queue due to a manual request May 1, 2026
@rickeylev rickeylev added this pull request to the merge queue May 1, 2026
Merged via the queue into bazel-contrib:main with commit ee7c54b May 1, 2026
4 checks passed
@rickeylev rickeylev deleted the chore.only.pipstar.extract branch May 1, 2026 03:34
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