Skip to content

Conversation

@aignas
Copy link
Collaborator

@aignas aignas commented Nov 23, 2025

With this we start extracting the wheel without Python and
it becomes a requirement only when patching (we will extract
the wheel without Python, patch it and then re-compress it
which makes a very inefficient process).

This should result in much faster executions because we can start
extracting wheels even before we fetch the entire Python toolchain
and we don't need to fetch it in a wheel-only setup until we are
actually building/executing tests. What is more bazel is faster
in extracting everything.

Work towards #2948

@aignas aignas force-pushed the aignas.pipstar.extract_whl_starlark_2 branch from aca42c3 to d8b1274 Compare November 23, 2025 14:47
@rickeylev
Copy link
Collaborator

Nice.

A bonus of this is it'll make it easier to use an alternative extractor (it can just extract instead of having to deal with wheel format details)

@rickeylev
Copy link
Collaborator

I would trigger merge, but this is set as draft -- overall it LGTM. Is there some edge case the python code handles that a plain extract doesn't?

@rickeylev rickeylev changed the title feat(pipstar): extract the wheel without python refactor(pypi): extract the wheel without python Nov 23, 2025
@rickeylev
Copy link
Collaborator

I renamed the title; this is purely internal and I don't see why it would be user-notable

github-merge-queue bot pushed a commit that referenced this pull request Nov 23, 2025
This is a small utility function to get us Python free when wheels are
extracted in the repository phase.

Next is to extract the wheel using `repository_ctx.extract` (#3430).

Whereas patching the wheel after extracting is more involved to be done
without Python because we need to rezip the wheel and that has to be
done
with Python for a few reasons (to stay sane). If we want to remove this,
then we would have to create a `whl` file in the build phase, which
could
work, but will need to be an exercise for the reader.

Nevertheless, this moves us towards removing any side-effects from
Python
interpreter, so changing the default interpreter would not cause us to
refetch everything.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
With this we start extracting the wheel without Python and
it becomes a requirement only when patching (we will extract
the wheel without Python, patch it and then re-compress it
which makes a very inefficient process).

This should result in much faster executions.
@aignas aignas force-pushed the aignas.pipstar.extract_whl_starlark_2 branch from d8b1274 to 034653b Compare November 24, 2025 00:44
@aignas aignas marked this pull request as ready for review November 24, 2025 06:35
@aignas aignas requested a review from groodt as a code owner November 24, 2025 06:35
@aignas
Copy link
Collaborator Author

aignas commented Nov 24, 2025

OK, I updated the hub_builder code and a few other paths so that we are not even passing the python interpreter to the whl_library so that we don't need to fetch the interpreter to extract the whls. The interpreter is only used in the sdist building if any of that happens or when we are using pip.

Let me know what kind of extra tests we should have here.

@aignas aignas mentioned this pull request Nov 24, 2025
5 tasks
@aignas aignas added this pull request to the merge queue Nov 25, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 25, 2025
With this we start extracting the wheel without Python and
it becomes a requirement only when patching (we will extract
the wheel without Python, patch it and then re-compress it
which makes a very inefficient process).

This should result in much faster executions because we can start
extracting wheels even before we fetch the entire Python toolchain
and we don't need to fetch it in a wheel-only setup until we are
actually building/executing tests. What is more bazel is faster
in extracting everything.

Work towards #2948
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 25, 2025
Removed 'python_interpreter_target' from the configuration.
@aignas aignas enabled auto-merge November 25, 2025 02:45
@aignas aignas added this pull request to the merge queue Nov 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 25, 2025
@aignas aignas added this pull request to the merge queue Nov 25, 2025
Merged via the queue into bazel-contrib:main with commit 89fedb7 Nov 25, 2025
4 checks passed
@aignas aignas deleted the aignas.pipstar.extract_whl_starlark_2 branch November 25, 2025 03:19
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