| commit | f9992f7f11472a825a73e096f2904122a71f094e | [log] [tgz] |
|---|---|---|
| author | Shayan Hoshyari <108962133+shayanhoshyari@users.noreply.github.com> | Sun Jan 11 10:51:17 2026 -0800 |
| committer | GitHub <noreply@github.com> | Sun Jan 11 18:51:17 2026 +0000 |
| tree | 7c4de476ff2835fa264ca4225861aa29213ec398 | |
| parent | 22f3de02efe54f00d532bcd77939710507e7209e [diff] |
fix (venv_site_packages): Fix wrong runfiles.symlinks when py_binary is not in root module (#3505) When: 1) venv_site_packages is on 2) we have a py_binary in a non-root module (e.g. a tool used in rules), and it uses python deps that result in usage of runfiles.symlinks, the `ctx.runfile` based symlinks end up going in the wrong folder (`_main`), while the `ctx.actions.symlink(...)` files go in the right place. This results in an invalid `venv` and import errors. The reason is that `actions.symlinks` always go to the `_main` module, as [Bazel docs explain](https://bazel.build/extending/rules#runfiles_symlinks). To send symlinks to other modules, one needs to use root_symlinks and prefix them with the right module name. Fixes: https://github.com/bazel-contrib/rules_python/issues/3503 --------- Co-authored-by: Shayan Hoshyari <hoshyari@adobe.com> Co-authored-by: Richard Levasseur <rlevasseur@google.com>
This repository is the home of the core Python rules -- py_library, py_binary, py_test, py_proto_library, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.