bazelruby / rules_ruby

Formerly canonical rules for ruby, that are about 2-3 years behind current Bazel. If they work for you great, but if not — please try the new rules ruby by Alex Radionov: https://github.com/bazel-contrib/rules_ruby
Apache License 2.0
99 stars 37 forks source link

Ruby Gem isn't including generated files #85

Closed cdc97 closed 3 years ago

cdc97 commented 3 years ago

Hi all, I'm not especially familiar with bazel, so this may be more of a user error, but I was hoping I could get some help. I am generating a ruby proto library (with grpc) using

load("@build_stack_rules_proto//ruby:ruby_proto_library.bzl", "ruby_proto_library")
ruby_proto_library(
    name = "rb_proto",
    has_services = True,
    deps = [
        ":v1",
    ],
    verbose = 3,
)

I then am trying to package the generated rb files into a ruby_gem. I can see both the proto generated rb files and the zip file from ruby_gem in my bazel-out, but my rb files aren't in my ruby_gem zip file when I unzip it. I only find the generated README and gemspec file.

Here's how I create my ruby_gem:

ruby_gem(
    name = "rb_gem",
    srcs = [":rb_proto"],
    gem_author_emails = [
        "my email here"
    ],
    gem_name = "my_proto_library",
    gem_version = "0.3.0"
)

What am I missing here? How do I ensure that my proto library generated ruby files show up in ruby_gem zip file? Thanks!

kigster commented 3 years ago

If the gem files are not in the lib folder, I don't think they'd get included. There is a PR in progress that might fix that