Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dev] Fix ros_launch python issue #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ coverage --test_tag_filters=-cpplint
# load bazelrc from the legacy location
# as recommended in https://github.com/bazelbuild/bazel/issues/6319
try-import %workspace%/ci.bazelrc
try-import %workspace%/user.bazelrc
try-import %workspace%/user.bazelrc
14 changes: 5 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

load("@rules_python//python:pip.bzl", "pip_install")
# load("@rules_python//python:pip.bzl", "pip_install")

pip_install(
name = "pip",
requirements = "//bazel/python:requirements.txt",
)
# pip_install(
# name = "pip",
# requirements = "//bazel/python:requirements.txt",
# )

### Gazelle Setup
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
Expand Down Expand Up @@ -77,17 +77,13 @@ register_detected_cuda_toolchains()

### ROS2 Setup
load("@com_github_mvukov_rules_ros2//repositories:repositories.bzl", "ros2_repositories", "ros2_workspace_repositories")

ros2_workspace_repositories()

ros2_repositories()

load("@com_github_mvukov_rules_ros2//repositories:deps.bzl", "ros2_deps")

ros2_deps()

load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
name = "rules_ros2_python",
python_version = "3.10",
Expand Down
5 changes: 4 additions & 1 deletion bazel/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

load("//third_party/toolchains_llvm:workspace.bzl", toolchains_llvm = "repo")
load("//third_party/bazel_gazelle:workspace.bzl", bazel_gazelle = "repo")

load("//third_party/rules_cc:workspace.bzl", rules_cc = "repo")
load("//third_party/rules_python:workspace.bzl", rules_python = "repo")
load("//third_party/rules_foreign_cc:workspace.bzl", rules_foreign_cc = "repo")
load("//third_party/pybind11:workspace.bzl", pybind11 = "repo")
load("//third_party/rules_proto:workspace.bzl", rules_proto = "repo")
load("//third_party/rules_go:workspace.bzl", rules_go = "repo")
load("//third_party/rules_rust:workspace.bzl", rules_rust = "repo")
load("//third_party/rules_cuda:workspace.bzl", rules_cuda = "repo")

load("//third_party/rules_cuda:workspace.bzl", rules_cuda = "repo")
load("//third_party/rules_oci:workspace.bzl", rules_oci = "repo")
load("//third_party/rules_pkg:workspace.bzl", rules_pkg = "repo")

Expand Down Expand Up @@ -53,6 +55,7 @@ def init_language_repos():
toolchains_llvm()
bazel_gazelle()

rules_cc()
rules_proto()
rules_foreign_cc()
rules_python()
Expand Down
18 changes: 8 additions & 10 deletions experimental/ros2_example/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ ros2_cpp_binary(
],
)

# Disabled ros2_launch temporarily, for following issue:
# Error: file '@rules_python//python:pip.bzl' does not contain symbol 'whl_filegroup'
#ros2_launch(
# name = "ros_chatter",
# launch_file = "ros_chatter.py",
# nodes = [
# ":ros_listener",
# ":ros_talker",
# ],
#)
ros2_launch(
name = "ros_chatter",
launch_file = "ros_chatter.py",
nodes = [
":ros_listener",
":ros_talker",
],
)

cpplint()
4 changes: 2 additions & 2 deletions experimental/ros2_example/ros_chatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def generate_launch_description():
# Provide the rootpath for the node.
executable='chatter/talker',
output='screen',
name='talker'),
name='ros_talker'),
launch_ros.actions.Node(executable='chatter/listener',
output='screen',
name='listener'),
name='ros_listener'),
])
1 change: 1 addition & 0 deletions third_party/rules_cc/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package(default_visibility = ["//visibility:public"])
6 changes: 6 additions & 0 deletions third_party/rules_cc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## rules_cc

See: https://github.com/bazelbuild/rules_cc

### references
- https://github.com/bazelbuild/rules_cc
15 changes: 15 additions & 0 deletions third_party/rules_cc/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Loads the rules_cc package"""

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

def clean_dep(dep):
return str(Label(dep))

def repo():
# see: https://github.com/bazelbuild/rules_cc/releases
http_archive(
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
)
7 changes: 4 additions & 3 deletions third_party/rules_python/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ def clean_dep(dep):
return str(Label(dep))

def repo():
# see: https://github.com/bazelbuild/rules_python/releases
http_archive(
name = "rules_python",
sha256 = "b593d13bb43c94ce94b483c2858e53a9b811f6f10e1e0eedc61073bd90e58d9c",
strip_prefix = "rules_python-0.12.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.12.0.tar.gz",
sha256 = "be04b635c7be4604be1ef20542e9870af3c49778ce841ee2d92fcb42f9d9516a",
strip_prefix = "rules_python-0.35.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.35.0/rules_python-0.35.0.tar.gz",
)
Loading