Skip to content

refactor(wheel): convert py_wheel_dist build tool to Rust - #4511

Draft
rickeylev wants to merge 2 commits into
mainfrom
rickeylev/shrubbery/01-py-wheel-dist
Draft

rickeylev wants to merge 2 commits into
mainfrom
rickeylev/shrubbery/01-py-wheel-dist

Conversation

@rickeylev

@rickeylev rickeylev commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Copying stamped wheel outputs into a dist directory currently spawns a
Python interpreter per py_wheel_dist target.

Add //crates/py_wheel_dist:py_wheel_dist_lib, register py_wheel_dist
on shrubbery, and route PyWheelDistDir through get_shrubbery_tool.
get_shrubbery_tool gains files_to_run and is_rust so rules can pass
the resolved tool straight to ctx.actions.run and branch on which
implementation resolved.

Work towards #4250

Copying stamped wheel outputs into a dist directory currently spawns a
Python interpreter per `py_wheel_dist` target.

Add `//crates/py_wheel_dist:py_wheel_dist_lib`, register `py_wheel_dist`
on `shrubbery`, and route `PyWheelDistDir` through `get_shrubbery_tool`.
`get_shrubbery_tool` gains `files_to_run` and `is_rust` so rules can pass
the resolved tool straight to `ctx.actions.run` and branch on which
implementation resolved.
@rickeylev

rickeylev commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

This PR was prepared by an agent under human direction. Review comments are triaged by the human author; agent-drafted replies and changes are reviewed and approved by the author before posting.

This is an agent-generated comment unreviewed by the user.

Comment thread crates/py_wheel_dist/src/lib.rs Resolved
Comment thread crates/py_wheel_dist/src/lib.rs Resolved
Comment thread crates/py_wheel_dist/src/lib.rs Resolved
Comment thread crates/py_wheel_dist/src/lib.rs Resolved
Comment thread crates/py_wheel_dist/src/lib.rs Resolved
Drop the wheel-name validation that the Python tool never had, use
argfile's parse_fromfile directly instead of a per-crate flagfile
parser, and adopt the USAGE constant, flags module, anyhow errors, and
long-only arguments used by the other shrubbery subcommands.
executable = toolchain.shrubbery,
executable = executable,
# `FilesToRunProvider` to pass to `ctx.actions.run(executable = ...)`.
files_to_run = executable[DefaultInfo].files_to_run,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Why have both executable and files_to_run? The two are equivalent. Prefer files_to_run instead of executable, as its more powerful and flexible.

Comment on lines +83 to +84
# True when resolved from the `shrubbery` toolchain.
is_rust = True,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

"is_rust" is slightly misleading: that shrubbery is rust based is an implementation detail. rename this to "from_shrubbery_toolchain" instead

Also: i'm guessing for testing? which is fine, I just want to verify my understanding

This branch has not been deployed

No deployments
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.

1 participant