mvukov / rules_ros Goto Github PK
View Code? Open in Web Editor NEWBuild ROS (1) with Bazel
License: Apache License 2.0
Build ROS (1) with Bazel
License: Apache License 2.0
I would like to use import rosnode
, but could not find the right py_library
. I think it should be in a similar way as
rules_ros/repositories/ros_comm.BUILD.bazel
Line 155 in 7d71bec
Since aspect-build/rules_py#311 was merged, I get the following error in my code when updating to a version that contains this PR
... in deps attribute of py_library rule FOO: ros_comm//:rospy' does not have mandatory providers: 'PyInfo' or 'PyVirtualInfo'. Since this rule was created by the macro 'py_library', the error might have been caused by the macro implementation
So far, I already checked the entire code for some hint on where the native/Java implementation of py_library
could be used but was not able to find any. Any idea what could cause this issue?
Port the project to bazel modules as defined here:
https://bazel.build/external/module
As of Bazel 7, this is now the default way to bring in dependencies:
https://blog.bazel.build/2023/12/11/bazel-7-release.html
Hi Milan
This project is very nice and useful for ROS + bazel user.
But when I try to use it and learn it, I didn't get why "cc_ros_library" will generate .so and .a at the same time? And how can I choose one to pack?
Would you please give me a help on this?
Thanks
Some targets are prefixed with cc_ or py_, for some others it's not consistent. I'm happy to provide a PR. What would you prefer?
Create a lock file similar to https://github.com/mvukov/rules_ros2/blob/main/repositories/ros2_repositories_impl.bzl using a resolver similar to https://github.com/mvukov/rules_ros2/blob/main/repositories/private/resolver.py that is most probably going to use https://github.com/ros/rosdistro/blob/master/noetic/distribution.yaml for inputs.
We'll need to get rid of custom fork of ros_comm used in https://github.com/mvukov/rules_ros/blob/main/repositories/repositories.bzl#L156-L163 and work with patches.
We identified some uncertainties in rules_ros while working on remote execution. We were also able to make them locally reproducible using the https://github.com/aspect-build/rules_py:
If I run bazel build @ros_comm//:roscpp_lib
locally, this works fine. Now if I switch this load statement in repositories/gencpp.BUILD.bazel
form load("@rules_python//python:defs.bzl", "py_binary", "py_library")
to the more stricter sandboxed load("@aspect_rules_py//py:defs.bzl", "py_library", "py_binary")
, I get
Traceback (most recent call last):
File "bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/_main~non_module_ros_repositories~ros_gencpp/scripts/gen_cpp.py", line 49, in <module>
genmsg.template_tools.generate_from_command_line_options(
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/_main~non_module_dependencies~ros_genmsg/src/genmsg/template_tools.py", line 219, in generate_from_command_line_options
generate_from_file(argv[1], options.package, options.outdir, options.emdir, options.includepath, msg_template_dict, srv_template_dict)
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/_main~non_module_dependencies~ros_genmsg/src/genmsg/template_tools.py", line 158, in generate_from_file
_generate_msg_from_file(input_file, output_dir, template_dir, search_path, package_name, msg_template_dict)
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/_main~non_module_dependencies~ros_genmsg/src/genmsg/template_tools.py", line 95, in _generate_msg_from_file
_generate_from_spec(input_file,
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/_main~non_module_dependencies~ros_genmsg/src/genmsg/template_tools.py", line 82, in _generate_from_spec
raise RuntimeError("Template file %s not found in template dir %s" % (template_file_name, template_dir))
RuntimeError: Template file msg.h.template not found in template dir /tmp/bazel-source-roots/4/lib/python38.zip
Exception ignored in: <function Interpreter.__del__ at 0x7efadffe6e50>
Traceback (most recent call last):
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/rules_python~0.29.0~pip~rules_ros_pip_deps_38_empy/site-packages/em.py", line 2094, in __del__
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/rules_python~0.29.0~pip~rules_ros_pip_deps_38_empy/site-packages/em.py", line 2157, in shutdown
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/rules_python~0.29.0~pip~rules_ros_pip_deps_38_empy/site-packages/em.py", line 2647, in finalize
File "/tmp/bazel-working-directory/_main/bazel-out/k8-opt-exec-ST-a9bf7a3d11c4/bin/external/_main~non_module_ros_repositories~ros_gencpp/gencpp_bin.runfiles/rules_python~0.29.0~pip~rules_ros_pip_deps_38_empy/site-packages/em.py", line 2200, in push
AttributeError: '_io.TextIOWrapper' object has no attribute 'push'
Now here a few guesses to help solving this issue
filegroup(
name = "data",
srcs = glob(["scripts/*.template"]),
visibility = ["//visibility:public"],
)
args.add("-e", ctx.attr.data.files.to_list()[0].dirname)
) in here, since the default template dir defined in gemmsg seems to be wrong.Any help/hint would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.