You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(whl_install): expose install_dir via OutputGroupInfo (#926)
## Problem
After #907 removed `install_dir` from `DefaultInfo.files`, consumers
that need to access files within the wheel directory directly (e.g.
extracting a non-console-script binary like `py-spy`) have no way to
reference the install directory from a genrule `srcs`.
## Fix
Add `OutputGroupInfo(install_dir = depset([install_dir]))` to the
`whl_install` rule's return value. Consumers can access the directory
via a `filegroup` with `output_group = "install_dir"`:
```python
filegroup(
name = "py_spy_install_dir",
srcs = ["@pip//py_spy:install"],
output_group = "install_dir",
)
genrule(
name = "py_spy_cli",
srcs = [":py_spy_install_dir"],
outs = ["py-spy"],
cmd = "cp $(execpath :py_spy_install_dir)/bin/py-spy $@",
)
```
This keeps `DefaultInfo.files` empty (preserving the improvement from
#907) while still making the install directory reachable for the rare
cases that need it.
## Test plan
- [x] Existing e2e suite passes
- [x] New e2e test case `uv-whl-install-output-group`: installs
`iniconfig` via uv, accesses the install dir through
`filegroup(output_group = "install_dir")`, uses it as a `genrule` srcs,
and asserts the listing contains expected package files
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments