From 305823e8a078d13d3a7433161f1b7c4360f96c60 Mon Sep 17 00:00:00 2001 From: sangcho Date: Wed, 14 Feb 2024 12:24:48 +0000 Subject: [PATCH] . --- .bazeliskrc | 1 + WORKSPACE | 6 +++--- pygloo/BUILD | 21 +++++++++++++++++++++ setup.py | 6 +++++- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .bazeliskrc diff --git a/.bazeliskrc b/.bazeliskrc new file mode 100644 index 0000000..bd4a535 --- /dev/null +++ b/.bazeliskrc @@ -0,0 +1 @@ +USE_BAZEL_VERSION=5.4.1 diff --git a/WORKSPACE b/WORKSPACE index cdd3513..a0acc5e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -67,9 +67,9 @@ http_archive( http_archive( name = "hiredis", build_file_content = all_content, - strip_prefix = "hiredis-1.0.0", - urls = ["https://github.com/redis/hiredis/archive/v1.0.0.tar.gz"], - sha256 = "2a0b5fe5119ec973a0c1966bfc4bd7ed39dbce1cb6d749064af9121fe971936f", + strip_prefix = "hiredis-1.2.0", + urls = ["https://github.com/redis/hiredis/archive/v1.2.0.tar.gz"], + sha256 = "82ad632d31ee05da13b537c124f819eb88e18851d9cb0c30ae0552084811588c", ) # gloo source code repository diff --git a/pygloo/BUILD b/pygloo/BUILD index 20c5151..3370786 100644 --- a/pygloo/BUILD +++ b/pygloo/BUILD @@ -1,5 +1,6 @@ load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") load("@rules_foreign_cc//tools/build_defs:make.bzl", "make") +load("@rules_cc//cc:defs.bzl", "cc_library") load("@pybind11_bazel//:build_defs.bzl", "pybind_library") load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") @@ -27,6 +28,26 @@ make( static_libraries = ["libhiredis.a"], ) +# cc_library( +# name = "hiredis", +# srcs = glob( +# [ +# "*.c", +# "*.h", +# ], +# exclude = +# [ +# "test.c", +# ], +# ), +# hdrs = glob([ +# "*.h", +# "adapters/*.h", +# ]), +# include_prefix = "hiredis", +# visibility = ["//visibility:public"], +# ) + cmake_external( name = "gloo", # Values to be passed as -Dkey=value on the CMake command line; diff --git a/setup.py b/setup.py index 42c4070..868c0dc 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,7 @@ def bazel_invoke(invoker, cmdline, *args, **kwargs): candidates.append(os.path.join(home, ".bazel", "bin", "bazel")) result = None for i, cmd in enumerate(candidates): + print("SANG-TODO cmd", cmd) try: result = invoker([cmd] + cmdline, *args, **kwargs) break @@ -78,14 +79,17 @@ def build(): raise RuntimeError(msg) bazel_env = dict(os.environ, PYTHON3_BIN_PATH=sys.executable) + print("SANG-TODO bazel_env", bazel_env) version_info = bazel_invoke(subprocess.check_output, ["--version"]) + print("SANG-TODO bazel version: ", version_info) bazel_version_str = version_info.rstrip().decode("utf-8").split(" ", 1)[1] bazel_version_split = bazel_version_str.split(".") bazel_version_digits = [ "".join(takewhile(str.isdigit, s)) for s in bazel_version_split ] bazel_version = tuple(map(int, bazel_version_digits)) + print("SANG-TODO bazel version", bazel_version) if bazel_version < SUPPORTED_BAZEL: logger.warning("Expected Bazel version {} but found {}".format( ".".join(map(str, SUPPORTED_BAZEL)), bazel_version_str)) @@ -93,7 +97,7 @@ def build(): bazel_targets = ["//pygloo:all"] return bazel_invoke( subprocess.check_call, - ["build", "--verbose_failures", "--"] + bazel_targets, + ["build", "--verbose_failures", "--subcommands", "--"] + bazel_targets, env=bazel_env)