Skip to content
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

Open
shs96c opened this issue Oct 1, 2020 · 6 comments
Open

Use genrule output directory as srcs for ruby_library #82

shs96c opened this issue Oct 1, 2020 · 6 comments
Assignees
Labels
feature New feature or request

Comments

@shs96c
Copy link

shs96c commented Oct 1, 2020

When using a genrule to generate ruby sources, it's helpful to output a directory and then use that for the sources of a ruby_library

For example:

genrule(
  name = "gen-src-dir",
  outs = ["some-directory"],
  cmd = "mkdir -p $@ && touch $@/foo.rb $@/bar.rb"
)

ruby_library(
  name = "my-lib",
  srcs = [":gen-src-dir"],
)

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 the genrule created.

@kigster kigster added the feature New feature or request label Nov 12, 2020
@kigster kigster self-assigned this Nov 12, 2020
@kigster
Copy link
Contributor

kigster commented Nov 12, 2020

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?

@shs96c
Copy link
Author

shs96c commented Nov 13, 2020 via email

@shs96c
Copy link
Author

shs96c commented Mar 2, 2021

Is there any more information I could add to this to help explain the use case better?

@kigster
Copy link
Contributor

kigster commented Mar 3, 2021

I would ask this question on the Bazel/Ruby Slack channel:
https://bazelbuild.slack.com/archives/CN4HMSK9Q

@kigster
Copy link
Contributor

kigster commented Mar 3, 2021

I wonder if you can generate a Ruby library from those files, and then use that as a dependency?

@shs96c
Copy link
Author

shs96c commented Apr 11, 2021

That's exactly what I'm trying to do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants