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

Allow genrule dependencies in cc_ build rules. #4875

Closed
wants to merge 1 commit into from

Conversation

deeglaze
Copy link
Contributor

This is going to be contentious. On one hand, power and expressiveness, and on the other, non-hermetic builds.

I have some rules that need to depend on linker scripts (which are allowed dependencies), but those scripts are generated by a genrule that includes some symbols or not depending on config_settings interpreted through select expressions. Since it is a genrule doing this, Bazel disallows it.

Will this ever be allowed? If not, can we get some kind of provider for a Skylark rule to apply as some kind of "yes, I accept the risks and responsibilities of being a cc_ rule dependency."?

This is going to be contentious. On one hand, power and expressiveness, and on the other, non-hermetic builds.

I have some rules that need to depend on linker scripts (which are allowed dependencies), but those scripts are generated by a genrule that includes some symbols or not depending on config_settings interpreted through select expressions.

Will this ever be allowed? If not, can we get some kind of provider for a Skylark rule to apply as some kind of "yes, I accept the risks and responsibilities of being a cc_ rule dependency."?
@hlopko
Copy link
Member

hlopko commented Mar 22, 2018

Hi Dionna,

I see you understand the tradeoffs. So it won't be surprising that I don't want to allow C++ rules to depend on genrules, that's just too much rope. But we are currently working on #4570 that will enable you to write your own almost cc_library/cc_binary that will do what you need. I'll close this PR now, you can comment on #4570 if you want to continue the discussion.

Thanks!

@hlopko hlopko closed this Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants