-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Transitive tags #4264
Comments
Just curious, which android tests under //src/test are causing you problems? Is it more than just //src/test/shell/bazel/android and //src/test/java/com/google/devtools/build/android? |
And the answer to “can someone explain why the sdk/ndk are not set up in the workspace in the first place” is that many Bazel developers dont have $ANDROID_HOME and $ANDROID_NDK_HOME set, and without them the repository functions will fail when they are triggered by loading any android target. |
Quite. Just do a |
Not quite. The other solution would be to have a repository rule, which just downloads a predefined set of sdk/ndk, instead of forcing everyone to do that manually. |
@abergmeier : are you suggesting to add a If so, I see a couple problems with that: it's not clear how would a rule remove transitive tags from the set it inherited from its upstream rules (dependencies), and how would Bazel handle diamond dependencies when it depends on library rule via different paths and the set of transitive tags are different on the different paths. How about using Bazel query instead? Get the |
@laszlocsomor I think I would rather have |
@abergmeier : I don't see what you mean by "implicit property" -- a rule attribute, a test tag, Bazel somehow knowing that a particular |
@laszlocsomor The thing in my mind is something like a aspect implementation that simply passes on all tags of |
I'd prefer not to do that - it introduces another way to have spooky action at a distance. What I was talking about with @lberki the other week is to have a mechanism to configure certain subtrees of a repository, e.g., to add a java_plugin to all Java rules under //java/my/weird/package. |
Ok. But then the only way of easily disabling testing android rules is too manually tag them. And then to add some way of figuring out, when such a tag is missing. |
src/test/java/com/google/devtools/build/android/BUILD As I said earlier, only //src/test/shell/bazel/android/... and //src/test/java/com/google/devtools/build/android/... should require an Android SDK. //src/test/java/com/google/devtools/build/lib/rules/android/... does not. |
AFAIR you are wrong (reason being implicit dependencies). I will introduce the android tag if someone at Google helps with setting up non-android testing. |
My suggestion is to provide a way to mark - say - the src/test/java/com/google/devtools/build/android subtree as Android. That's technically a manual step, but then it applies to all test targets within that tree. On the other hand, I'm also in favor of moving all the Android stuff out of Bazel proper (and to rules_android), which would also solve the specific issue here. |
👍 |
All of the Android stuff are moving out of Bazel core. Tracked in #5354 |
Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.
Description of the problem / feature request / question:
I wanted to enable
bazel test //src/test/... --test_tag_filters=-android
(can someone explain why the sdk/ndk are not set up in the workspace in the first place?). Turns out tagging all android-tests is quite the work. The interesting thing is that it might not be necessary if tags would be transitive.Then we only would need to tag the base libraries and filegroups and viola - all tests would be correctly tagged.
Environment info
bazel info release
): 0.8.1The text was updated successfully, but these errors were encountered: