Skip to content

Commit e5b4668

Browse files
authored
[8.3.0] Move Python runfiles library out of Bazel (#26021)
The Python runfiles libraries in @bazel_tools, which isn't fully functional with Bzlmod, now aliases to `@rules_python//python/runfiles. This requires skipping load visibility checks for resolved WORKSPACE files, which are going away anyway. Partial cherry-pick of b8b91e4 Fixes #26020
1 parent 0195f18 commit e5b4668

File tree

6 files changed

+13
-719
lines changed

6 files changed

+13
-719
lines changed

src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceFileFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public SkyValue compute(SkyKey skyKey, Environment env)
360360
keys.build(),
361361
starlarkSemantics,
362362
bzlLoadFunctionForInlining,
363-
/* checkVisibility= */ true);
363+
/* checkVisibility= */ !useWorkspaceResolvedFile);
364364
} catch (NoSuchPackageException e) {
365365
throw new WorkspaceFileFunctionException(e, Transience.PERSISTENT);
366366
}

tools/python/gen_runfiles_constants.bzl

Lines changed: 0 additions & 35 deletions
This file was deleted.

tools/python/runfiles/BUILD

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
load("@rules_python//python:defs.bzl", "py_library", "py_test")
2-
load("//tools/python:gen_runfiles_constants.bzl", "gen_runfiles_constants")
3-
41
package(default_visibility = ["//visibility:private"])
52

63
filegroup(
@@ -17,23 +14,3 @@ filegroup(
1714
],
1815
visibility = ["//tools/python:__pkg__"],
1916
)
20-
21-
py_library(
22-
name = "runfiles",
23-
testonly = 1,
24-
srcs = [
25-
"runfiles.py",
26-
":_runfiles_constants",
27-
],
28-
)
29-
30-
gen_runfiles_constants(
31-
name = "_runfiles_constants",
32-
)
33-
34-
py_test(
35-
name = "runfiles_test",
36-
srcs = ["runfiles_test.py"],
37-
visibility = ["//visibility:public"],
38-
deps = [":runfiles"],
39-
)

tools/python/runfiles/BUILD.tools

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
load("//tools/python:gen_runfiles_constants.bzl", "gen_runfiles_constants")
21
load("@rules_python//python:defs.bzl", "py_library")
32

43
py_library(
54
name = "runfiles",
65
srcs = [
76
"runfiles.py",
8-
":_runfiles_constants",
97
],
108
visibility = ["//visibility:public"],
11-
)
12-
13-
gen_runfiles_constants(
14-
name = "_runfiles_constants",
9+
deps = [
10+
"@rules_python//python/runfiles",
11+
],
1512
)

0 commit comments

Comments
 (0)