Skip to content
This repository was archived by the owner on Nov 5, 2026. It is now read-only.
This repository was archived by the owner on Nov 5, 2026. It is now read-only.

google-protobuf and grpc gems fail #86

Closed

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

Activity

  1. kigster commented on Jul 8, 2021

    @kigster
    Contributor

    This is a known limitation.

    When adding gems we were hard coding the lib folder. The PR submitted by @mmizutani should fix it.

  2. aaliddell commented on Sep 17, 2021

    @aaliddell
    Author

    Cycling back around to this: grpc still fails to load due to missing a file at etc/roots.pem. It's a pretty odd layout that can be fixed by adding includes = {"grpc": ["etc"]} to the ruby_bundle call, but I dunno if there's a fix you want to do here for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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