Skip to content

Commit

Permalink
go back to WORKSPACE version of pybind11
Browse files Browse the repository at this point in the history
  • Loading branch information
lalten committed Jan 28, 2024
1 parent 81458f1 commit 1333d8a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
6 changes: 1 addition & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "lz4", version = "1.9.4")
bazel_dep(name = "nlohmann_json", version = "3.11.3")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "pybind11_bazel", version = "2.11.1.bzl.1")
bazel_dep(name = "readerwriterqueue", version = "1.0.6")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_foreign_cc", version = "0.10.1")
Expand Down Expand Up @@ -57,17 +56,14 @@ pip.parse(
)
use_repo(pip, "rules_ros2_resolver_deps")

python_configure = use_extension("@pybind11_bazel//:python_configure.bzl", "extension")
python_configure.toolchain(python_version = "3")
use_repo(python_configure, "local_config_python", "pybind11")

non_module_deps = use_extension("@com_github_mvukov_rules_ros2//:extensions.bzl", "non_module_deps")
use_repo(
non_module_deps,
"cyclonedds",
"foxglove_bridge",
"iceoryx",
"osrf_pycommon",
"pybind11",
"ros2_ament_cmake_ros",
"ros2_ament_index",
"ros2_class_loader",
Expand Down
7 changes: 0 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ load(

install_rules_ros2_pip_deps()

load("@pybind11_bazel//:python_configure.bzl", "python_configure")

python_configure(
name = "local_config_python",
python_interpreter_target = python_interpreter_target,
)

# Below are internal deps.

pip_parse(
Expand Down
12 changes: 12 additions & 0 deletions repositories/pybind11.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
""" Builds pybind11.
"""

load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "pybind11",
hdrs = glob(["include/pybind11/**/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
deps = ["@rules_python//python/cc:current_py_cc_headers"],
)
28 changes: 12 additions & 16 deletions repositories/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,6 @@ def rules_ros2_workspace_deps():
urls = ["https://github.com/leethomason/tinyxml2/archive/refs/tags/9.0.0.tar.gz"],
)

maybe(
http_archive,
name = "pybind11_bazel",
sha256 = "56397b31ab55eb151e45d4e0a6b28d90a854290728595607c9a04d0ffee05c49",
strip_prefix = "pybind11_bazel-2.11.1.bzl.1",
urls = ["https://github.com/pybind/pybind11_bazel/releases/download/v2.11.1.bzl.1/pybind11_bazel-2.11.1.bzl.1.tar.gz"],
)
maybe(
http_archive,
name = "pybind11",
build_file = "@pybind11_bazel//:pybind11.BUILD",
sha256 = "d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c",
strip_prefix = "pybind11-2.11.1",
urls = ["https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz"],
)

maybe(
http_archive,
name = "readerwriterqueue",
Expand Down Expand Up @@ -165,6 +149,18 @@ def rules_ros2_workspace_deps():

def ros2_repositories():
"""Import external/third-party build http_archive dependencies."""

# Move pybind stuff to rules_ros2_workspace_deps() and configure in MODULE.bazel
# once https://github.com/pybind/pybind11_bazel/issues/66 is resolved.
maybe(
http_archive,
name = "pybind11",
build_file = "@com_github_mvukov_rules_ros2//repositories:pybind11.BUILD.bazel",
sha256 = "d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c",
strip_prefix = "pybind11-2.11.1",
urls = ["https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz"],
)

maybe(
http_archive,
name = "libyaml",
Expand Down

0 comments on commit 1333d8a

Please sign in to comment.