Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions python/private/local_runtime_repo_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,26 @@ def define_local_runtime_toolchain_impl(
cc_library(
name = "_python_headers",
# NOTE: Keep in sync with watch_tree() called in local_runtime_repo
srcs = native.glob(["include/**/*.h"]),
srcs = native.glob(
["include/**/*.h"],
# A Python install may not have C headers
allow_empty = True,
),
includes = ["include"],
)

cc_library(
name = "_libpython",
# Don't use a recursive glob because the lib/ directory usually contains
# a subdirectory of the stdlib -- lots of unrelated files
srcs = native.glob([
"lib/*{}".format(lib_ext), # Match libpython*.so
"lib/*{}*".format(lib_ext), # Also match libpython*.so.1.0
]),
srcs = native.glob(
[
"lib/*{}".format(lib_ext), # Match libpython*.so
"lib/*{}*".format(lib_ext), # Also match libpython*.so.1.0
],
# A Python install may not have shared libraries.
allow_empty = True,
),
hdrs = [":_python_headers"],
)

Expand Down
16 changes: 16 additions & 0 deletions tests/integration/compile_pip_requirements/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "protobuf",
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
strip_prefix = "protobuf-27.0",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
)

http_archive(
name = "rules_cc",
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
strip_prefix = "rules_cc-0.0.13",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
)

local_repository(
name = "rules_python",
path = "../../..",
Expand Down
18 changes: 16 additions & 2 deletions tests/integration/ignore_root_user_error/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "protobuf",
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
strip_prefix = "protobuf-27.0",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
)

http_archive(
name = "rules_cc",
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
strip_prefix = "rules_cc-0.0.13",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
)
Comment on lines +3 to +15
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rickeylev, I think this means that the py_repositories function adding these deps needs to be updated. This looks like the wrong thing to do if we want to keep supporting bazel@HEAD with a released rules_python version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Something felt off updating so many workspace files for tests. I've started #2335 to update py_repositories.


local_repository(
name = "rules_python",
path = "../../..",
Expand All @@ -13,8 +29,6 @@ python_register_toolchains(
python_version = "3.9",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/pip_parse/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "protobuf",
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
strip_prefix = "protobuf-27.0",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
)

http_archive(
name = "rules_cc",
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
strip_prefix = "rules_cc-0.0.13",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
)

local_repository(
name = "rules_python",
path = "../../..",
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/py_cc_toolchain_registered/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "protobuf",
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
strip_prefix = "protobuf-27.0",
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
)

http_archive(
name = "rules_cc",
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
strip_prefix = "rules_cc-0.0.13",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
)

local_repository(
name = "rules_python",
path = "../../..",
Expand Down