Skip to content

Commit

Permalink
squashed
Browse files Browse the repository at this point in the history
  • Loading branch information
lalten committed Feb 1, 2024
1 parent abf3461 commit 60855d8
Show file tree
Hide file tree
Showing 15 changed files with 242 additions and 58 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ jobs:
- "gcc"
- "clang"
external_dependency_system:
# - bzlmod # TODO: https://github.com/mvukov/rules_ros2/pull/238
- bzlmod
- workspace
include:
- toolchain: "gcc"
config_option: ""
- toolchain: "clang"
config_option: "--config=clang"
# - external_dependency_system: bzlmod
# bzlmod_flags: --enable_bzlmod
- external_dependency_system: bzlmod
bzlmod_flags: --enable_bzlmod
- external_dependency_system: workspace
bzlmod_flags: --noenable_bzlmod

Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
default_language_version:
python: python3.10
node: 18.16.0

default_stages: [commit]
Expand Down
111 changes: 111 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
module(name = "com_github_mvukov_rules_ros2")

bazel_dep(name = "asio", version = "1.28.2")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "boringssl", version = "0.0.0-20240126-22d349c")
bazel_dep(name = "eigen", version = "3.4.0")
bazel_dep(name = "fmt", version = "10.2.1")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "libyaml", version = "0.2.5")
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 = "readerwriterqueue", version = "1.0.6")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_foreign_cc", version = "0.10.1")
bazel_dep(name = "rules_python", version = "0.29.0")
bazel_dep(name = "spdlog", version = "1.12.0")
bazel_dep(name = "sqlite3", version = "3.42.0.bcr.1")
bazel_dep(name = "tinyxml2", version = "10.0.0")
bazel_dep(name = "websocketpp", version = "0.8.2")
bazel_dep(name = "yaml-cpp", version = "0.8.0")
bazel_dep(name = "zlib", version = "1.3")
bazel_dep(name = "zstd", version = "1.5.5.bcr.1")

python = use_extension("@rules_python//python:extensions.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.11",
)
use_repo(python, "python_versions")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.whl_mods(
# Keep this in sync with repositories/pip_annotations.bzl
additive_build_content = """\
cc_library(
name = "headers",
hdrs = glob(["site-packages/numpy/core/include/numpy/**/*.h"]),
includes = ["site-packages/numpy/core/include"],
deps = ["@rules_python//python/cc:current_py_cc_headers"],
)
""",
hub_name = "whl_mods_hub",
whl_name = "numpy",
)
use_repo(pip, "whl_mods_hub")
pip.parse(
hub_name = "rules_ros2_pip_deps",
python_version = "3.11",
requirements_lock = "//:requirements_lock.txt",
whl_modifications = {"@whl_mods_hub//:numpy.json": "numpy"},
)
use_repo(pip, "rules_ros2_pip_deps")
use_repo(pip, "rules_ros2_pip_deps_311_numpy")
pip.parse(
hub_name = "rules_ros2_resolver_deps",
python_version = "3.11",
requirements_lock = "//repositories/private:resolver_requirements_lock.txt",
)
use_repo(pip, "rules_ros2_resolver_deps")

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",
"ros2_common_interfaces",
"ros2_diagnostics",
"ros2_geometry2",
"ros2_image_common",
"ros2_kdl_parser",
"ros2_keyboard_handler",
"ros2_launch",
"ros2_launch_ros",
"ros2_libstatistics_collector",
"ros2_message_filters",
"ros2_pluginlib",
"ros2_rcl",
"ros2_rcl_interfaces",
"ros2_rcl_logging",
"ros2_rclcpp",
"ros2_rclpy",
"ros2_rcpputils",
"ros2_rcutils",
"ros2_resource_retriever",
"ros2_rmw",
"ros2_rmw_cyclonedds",
"ros2_rmw_dds_common",
"ros2_rmw_implementation",
"ros2_robot_state_publisher",
"ros2_ros_testing",
"ros2_rosbag2",
"ros2_rosidl",
"ros2_rosidl_python",
"ros2_rosidl_runtime_py",
"ros2_rosidl_typesupport",
"ros2_rpyutils",
"ros2_tracing",
"ros2_unique_identifier_msgs",
"ros2_urdfdom",
"ros2_urdfdom_headers",
"ros2_xacro",
"ros2cli",
"ros2",
)
Empty file added WORKSPACE.bzlmod
Empty file.
66 changes: 66 additions & 0 deletions examples/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module(name = "rules_ros2_examples")

bazel_dep(name = "com_github_mvukov_rules_ros2")
local_path_override(
module_name = "com_github_mvukov_rules_ros2",
path = "..",
)

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",
"ros2_ament_cmake_ros",
"ros2_ament_index",
"ros2_class_loader",
"ros2_common_interfaces",
"ros2_diagnostics",
"ros2_geometry2",
"ros2_image_common",
"ros2_kdl_parser",
"ros2_keyboard_handler",
"ros2_launch",
"ros2_launch_ros",
"ros2_libstatistics_collector",
"ros2_message_filters",
"ros2_pluginlib",
"ros2_rcl",
"ros2_rcl_interfaces",
"ros2_rcl_logging",
"ros2_rclcpp",
"ros2_rclpy",
"ros2_rcpputils",
"ros2_rcutils",
"ros2_resource_retriever",
"ros2_rmw",
"ros2_rmw_cyclonedds",
"ros2_rmw_dds_common",
"ros2_rmw_implementation",
"ros2_robot_state_publisher",
"ros2_ros_testing",
"ros2_rosbag2",
"ros2_rosidl",
"ros2_rosidl_python",
"ros2_rosidl_runtime_py",
"ros2_rosidl_typesupport",
"ros2_rpyutils",
"ros2_tracing",
"ros2_unique_identifier_msgs",
"ros2_urdfdom",
"ros2_urdfdom_headers",
"ros2_xacro",
"ros2cli",
)

bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_python", version = "0.29.0")

python = use_extension("@rules_python//python:extensions.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.11",
)
use_repo(python, "python_versions")
9 changes: 9 additions & 0 deletions extensions.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@com_github_mvukov_rules_ros2//repositories:repositories.bzl", "ros2_repositories", "rules_ros2_workspace_and_bazelmod_common_deps")

def _non_module_deps_impl(mctx):
rules_ros2_workspace_and_bazelmod_common_deps()
ros2_repositories()

non_module_deps = module_extension(
implementation = _non_module_deps_impl,
)
2 changes: 1 addition & 1 deletion renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"eigen",
"foxglove_bridge",
"nlohmann_json",
"openssl",
"boringssl",
"pybind11",
"rules_foreign_cc",
"rules_python",
Expand Down
13 changes: 4 additions & 9 deletions repositories/asio.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "asio",
srcs = glob(["src/*.cpp"]),
hdrs = glob([
"include/**/*.hpp",
"include/**/*.ipp",
srcs = glob([
"**/*.hpp",
"**/*.ipp",
]),
defines = [
"ASIO_SEPARATE_COMPILATION",
],
includes = ["include"],
includes = ["."],
visibility = ["//visibility:public"],
deps = ["@openssl//:ssl"],
)
2 changes: 1 addition & 1 deletion repositories/curl.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ cp ${BUILD_TMPDIR}/lib/libcurl.a ${INSTALLDIR}/lib
""",
visibility = ["//visibility:public"],
deps = [
"@openssl//:ssl",
"@boringssl//:ssl",
"@zlib",
],
)
1 change: 1 addition & 0 deletions repositories/foxglove_bridge.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cc_library(
includes = ["foxglove_bridge_base/include"],
deps = [
"@nlohmann_json//:json",
"@boringssl//:ssl",
"@websocketpp",
],
)
Expand Down
2 changes: 1 addition & 1 deletion repositories/libyaml.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ expand_template(
)

cc_library(
name = "yaml",
name = "libyaml",
srcs = [
"src/api.c",
"src/dumper.c",
Expand Down
1 change: 1 addition & 0 deletions repositories/pip_annotations.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@rules_python//python:pip.bzl", "package_annotation")

# Keep this in sync with MODULE.bazel
PIP_ANNOTATIONS = {
"numpy": package_annotation(
additive_build_content = """\
Expand Down
2 changes: 1 addition & 1 deletion repositories/rcl.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ros2_c_library(
includes = ["rcl_yaml_param_parser/include"],
visibility = ["//visibility:public"],
deps = [
"@libyaml//:yaml",
"@libyaml",
"@ros2_rcutils//:rcutils",
"@ros2_rmw//:rmw",
],
Expand Down
Loading

0 comments on commit 60855d8

Please sign in to comment.