Skip to content

Commit 57c35e2

Browse files
committed
fix path processing
1 parent 3aa6386 commit 57c35e2

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

python/private/py_library.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ load(":normalize_name.bzl", "normalize_name")
4242
load(":precompile.bzl", "maybe_precompile")
4343
load(":py_cc_link_params_info.bzl", "PyCcLinkParamsInfo")
4444
load(":py_info.bzl", "PyInfo")
45+
load(":py_internal.bzl", "py_internal")
4546
load(":reexports.bzl", "BuiltinPyInfo")
4647
load(":rule_builders.bzl", "ruleb")
4748
load(
@@ -246,6 +247,10 @@ def _get_imports_and_venv_symlinks(ctx):
246247
fail("When venvs_site_packages is enabled, exactly one `imports` " +
247248
"value must be specified, got {}".format(imports))
248249

250+
site_packages_root = paths.normalize(paths.join(
251+
py_internal.get_label_repo_runfiles_path(ctx.label),
252+
imports[0],
253+
))
249254
venv_symlinks = get_venv_symlinks(
250255
ctx,
251256
ctx.files.srcs + ctx.files.data + ctx.files.pyi_srcs,

python/private/venv_runfiles.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ def _get_file_venv_path(ctx, f, site_packages_root):
250250
Args:
251251
ctx: The current ctx.
252252
f: The file to compute the venv_path for.
253-
site_packages_root: The site packages root path.
253+
site_packages_root: The site packages root path; repo-relative
254+
path.
254255
255256
Returns:
256257
A tuple `(venv_path, rf_root_path)` if the file is under

0 commit comments

Comments
 (0)