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
Excluding rules from certain platforms #601
Comments
Try this: In your
In a
|
Thanks, that's helpful, and I think that can be made to work for my use case. If I have a rule defined, eg. |
You could make a macro. From a bzl file somewhere:
and have people call your macro instead of your rule. |
That makes sense to me, when I tried the example I'm seeing the behavior I want, but am getting an error about a missing symbol. Is there something the macro can return that isn't |
Try: if build_go_binary: hard to say without seeing your error |
Yeah, marking it target incompatible will cause it to be skipped without error when resolved in a pattern like You could actually still use the config value to set things up if you wanted, somethign like this could work:
|
Hello,
I'm working through a use case where we have certain rules that we want to run locally, but exclude from running on CI systems. I found this example: https://github.com/facebook/buck2/blob/8a7f7c7fca54af4be1a6b32b2d100aa0f4bca5d2/examples/with_prelude/go/hello/BUCK which uses
host_info()
to exclude rules, but I'm not sure if it's possible to extend this logic with a custom boolean value, for example,is_ci
.I've also attempted to access context data to determine which platform is being invoked and use that to skip the rule, but I'm not finding a way to do that either. Reading the docs, it seems like constraints added to our platform should work, but I'm unclear on how to implement that. For this use case, what is the best approach to take?
The text was updated successfully, but these errors were encountered: