File tree Expand file tree Collapse file tree 5 files changed +77
-7
lines changed
py_cc_toolchain_registered Expand file tree Collapse file tree 5 files changed +77
-7
lines changed Original file line number Diff line number Diff line change @@ -61,18 +61,26 @@ def define_local_runtime_toolchain_impl(
61
61
cc_library (
62
62
name = "_python_headers" ,
63
63
# NOTE: Keep in sync with watch_tree() called in local_runtime_repo
64
- srcs = native .glob (["include/**/*.h" ]),
64
+ srcs = native .glob (
65
+ ["include/**/*.h" ],
66
+ # A Python install may not have C headers
67
+ allow_empty = True ,
68
+ ),
65
69
includes = ["include" ],
66
70
)
67
71
68
72
cc_library (
69
73
name = "_libpython" ,
70
74
# Don't use a recursive glob because the lib/ directory usually contains
71
75
# a subdirectory of the stdlib -- lots of unrelated files
72
- srcs = native .glob ([
73
- "lib/*{}" .format (lib_ext ), # Match libpython*.so
74
- "lib/*{}*" .format (lib_ext ), # Also match libpython*.so.1.0
75
- ]),
76
+ srcs = native .glob (
77
+ [
78
+ "lib/*{}" .format (lib_ext ), # Match libpython*.so
79
+ "lib/*{}*" .format (lib_ext ), # Also match libpython*.so.1.0
80
+ ],
81
+ # A Python install may not have shared libraries.
82
+ allow_empty = True ,
83
+ ),
76
84
hdrs = [":_python_headers" ],
77
85
)
78
86
Original file line number Diff line number Diff line change
1
+ load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
2
+
3
+ http_archive (
4
+ name = "protobuf" ,
5
+ sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa" ,
6
+ strip_prefix = "protobuf-27.0" ,
7
+ url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz" ,
8
+ )
9
+
10
+ http_archive (
11
+ name = "rules_cc" ,
12
+ sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80" ,
13
+ strip_prefix = "rules_cc-0.0.13" ,
14
+ urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz" ],
15
+ )
16
+
1
17
local_repository (
2
18
name = "rules_python" ,
3
19
path = "../../.." ,
Original file line number Diff line number Diff line change
1
+ load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
2
+
3
+ http_archive (
4
+ name = "protobuf" ,
5
+ sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa" ,
6
+ strip_prefix = "protobuf-27.0" ,
7
+ url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz" ,
8
+ )
9
+
10
+ http_archive (
11
+ name = "rules_cc" ,
12
+ sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80" ,
13
+ strip_prefix = "rules_cc-0.0.13" ,
14
+ urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz" ],
15
+ )
16
+
1
17
local_repository (
2
18
name = "rules_python" ,
3
19
path = "../../.." ,
@@ -13,8 +29,6 @@ python_register_toolchains(
13
29
python_version = "3.9" ,
14
30
)
15
31
16
- load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
17
-
18
32
http_archive (
19
33
name = "bazel_skylib" ,
20
34
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d" ,
Original file line number Diff line number Diff line change
1
+ load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
2
+
3
+ http_archive (
4
+ name = "protobuf" ,
5
+ sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa" ,
6
+ strip_prefix = "protobuf-27.0" ,
7
+ url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz" ,
8
+ )
9
+
10
+ http_archive (
11
+ name = "rules_cc" ,
12
+ sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80" ,
13
+ strip_prefix = "rules_cc-0.0.13" ,
14
+ urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz" ],
15
+ )
16
+
1
17
local_repository (
2
18
name = "rules_python" ,
3
19
path = "../../.." ,
Original file line number Diff line number Diff line change
1
+ load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
2
+
3
+ http_archive (
4
+ name = "protobuf" ,
5
+ sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa" ,
6
+ strip_prefix = "protobuf-27.0" ,
7
+ url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz" ,
8
+ )
9
+
10
+ http_archive (
11
+ name = "rules_cc" ,
12
+ sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80" ,
13
+ strip_prefix = "rules_cc-0.0.13" ,
14
+ urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz" ],
15
+ )
16
+
1
17
local_repository (
2
18
name = "rules_python" ,
3
19
path = "../../.." ,
You can’t perform that action at this time.
0 commit comments