commit | 438b12edca345db7d06021dde97cb3bd6b1bae84 | [log] [tgz] |
---|---|---|
author | Chowder <16789070+chowder@users.noreply.github.com> | Mon Nov 25 16:24:07 2024 +0000 |
committer | GitHub <noreply@github.com> | Mon Nov 25 08:24:07 2024 -0800 |
tree | c2b07c13d9c50f42da45cbe7748b7d4d1c72a7cc | |
parent | 4ee7e256de85faff38db5f21defd660a2cd6aa85 [diff] |
fix: correctly obtain relative path required for the venv created by `--bootstrap_impl=script` (#2439) Computing the relative path from the venv interpreter to the underlying interpreter was incorrectly using the actual interpreter's directory depth, not the venv interpreter's directory depth, when computing the distance from the venv interpreter to the runfiles root. The net effect is the correct relative path would only be computed for binaries with the same directory depth as the actual interpreter (e.g. 2). This went undetected in CI because the tests for this logic just happen to have the same directory depth as the actual interpreter used. To fix, compute the relative path to the runfiles root using the venv interpreter directory. Also added a test in a more nested directory to test this case. Along the way: * Change relative path computation to compute a minimum relative path. * Fix the internals to pass a runfiles-root relative path, not main-repo relative path, for the actual interpreter, as intended. Fixes https://github.com/bazelbuild/rules_python/issues/2169 --------- Co-authored-by: Richard Levasseur <rlevasseur@google.com> Co-authored-by: Richard Levasseur <richardlev@gmail.com> Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.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.