-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use genrule
output directory as srcs
for ruby_library
#82
Comments
Can you elaborate on why you'd want to use the output of a genrule as a ruby library? What's the use case here? |
In the Selenium project, we generate support classes for handling the Chrome Debugging Protocol by transforming “pdl” files to ruby (and, indeed, other languages) Although we’ve not migrated the ruby build to bazel yet, our hand-rolled build system looks similar:
https://github.com/SeleniumHQ/selenium/blob/trunk/rb/build.desc#L336 is depended on by https://github.com/SeleniumHQ/selenium/blob/trunk/rb/build.desc#L291
In the more general case, this is useful for any time a code generator could be hooked into the build (think protobuf, APIs generated by OpenSwagger, parsers generated with Rangel, etc)
… On 12 Nov 2020, at 21:01, Konstantin Gredeskoul ***@***.***> wrote:
Can you elaborate on why you'd want to use the output of a genrule as a ruby library? What's the use case here?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Is there any more information I could add to this to help explain the use case better? |
I would ask this question on the Bazel/Ruby Slack channel: |
I wonder if you can generate a Ruby library from those files, and then use that as a dependency? |
That's exactly what I'm trying to do :) |
When using a
genrule
to generate ruby sources, it's helpful to output a directory and then use that for the sources of aruby_library
For example:
Note that because these are generated files, it's hard to know what prefix to place in the
include
attribute, so ideally, that would allow itself to be relative to the output directory thegenrule
created.The text was updated successfully, but these errors were encountered: