Skip to content

google-protobuf and grpc gems fail #86

Closed
@aaliddell

Description

@aaliddell

When trying to use google-protobuf and grpc gems, the paths created do not match the globs in the generated BUILD.bazel file.

For example, here's the library rule generated for grpc:

ruby_library(
  name = "grpc",
  srcs = glob(
    include = [
      ".bundle/config",
      "lib/ruby/2.7.0/gems/grpc-1.35.0/lib/**/*",
      "lib/ruby/2.7.0/specifications/grpc-1.35.0.gemspec",
      
    ],
    exclude = ["**/* *.*", "**/* */*"],
  ),
  deps = [":google-protobuf", ":googleapis-common-protos-types"],
  includes = ["lib/ruby/2.7.0/gems/grpc-1.35.0/lib"],
)

The glob in the srcs attr does not match any of the files, as both the gem name and contents are possibly incorrect.
In grpc's case, the path is lib/ruby/2.7.0/gems/grpc-1.35.0-x86_64-linux/... and does not contain a 'lib' directory.
In google-protobuf's case, the path is lib/ruby/2.7.0/gems/google-protobuf-3.14.0-x86_64-linux/... and does contain a 'lib' directory.

Therefore, when trying to require 'grpc' it cannot find any files:

/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- grpc (LoadError)

Context: rules-proto-grpc/rules_proto_grpc#65

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions