Giter Club home page Giter Club logo

rules_ros's People

Contributors

finn-ball avatar hofbi avatar mvukov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rules_ros's Issues

'ros_comm//:rospy' and 'ros_ros//:rosunit' does not have mandatory providers: 'PyInfo' or 'PyVirtualInfo'

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?

Naming conventions for targets

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 from rosdistro

Rules ROS seems to be not fully hermetic

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

  1. Adding the templates as data dependency:
filegroup(
    name = "data",
    srcs = glob(["scripts/*.template"]),
    visibility = ["//visibility:public"],
)
  1. Explicitly setting the template dir (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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.