-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Turbine breaks ASWB IDE sync for projects using Robolectric (android_local_test) #13144
Comments
@cushon - Any idea why Turbine would fail when processing https://github.com/robolectric/robolectric/blob/master/annotations/src/main/java/org/robolectric/annotation/Config.java - Its an interesting annotation (with an implementation and a bunch of complexity) but I'm not sure why Turbine would fail with I can work around this in our repo by removing any redundant annotations and the rest migrate to Kotlin whose source files obviously don't trigger Turbine. |
This CL fixes the version of Java to JDK8 and Bazel to 3.7.1 For Java, ubuntu-latest will soon be switching from Java 8 to Java 11 as the default (actions/runner-images#1816), and our Bazel builds currently don't work with Java 11 since compile_testing depends on @local_jdk//:lib/tools.jar which doesn't exist in Java 11. https://github.com/google/bazel-common/blob/master/third_party/java/compile_testing/BUILD#L32 For Bazel, ubuntu-latest currently uses Bazel 4.0.0 by default, which fails with Robolectric tests @config annotation: ``` error: missing required annotation argument: <clinit> @config ``` RELNOTES=N/A PiperOrigin-RevId: 358062883
@jongerrish have you tried testing with this commit pulled into your fork? bef4bbb |
Thanks for the heads up, this is a bug in turbine that I was able to reproduce at head, I'm working on a fix |
The bug affects any annotation declaration with a class initializer. That's somewhat uncommon, because default values for annotation element have to be compile-time constants, so stuff like
If you want a work-around, inlining |
This was causing an error when checking required annotation elements for annotations with `<clinit>`s read from bytecode: ``` error: missing required annotation argument: <clinit> @foo ``` bazelbuild/bazel#13144 PiperOrigin-RevId: 360525202
This was causing an error when checking required annotation elements for annotations with `<clinit>`s read from bytecode: ``` error: missing required annotation argument: <clinit> @foo ``` bazelbuild/bazel#13144 PiperOrigin-RevId: 360553027
Amazing! Thanks for the fast turnaround Liam! |
Making a java_tools release: bazelbuild/java_tools#45 |
Description of the problem / feature request:
Turbine breaks ASWB IDE sync for projects with Robolectric tests.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Using Android Studio w/ Blaze v4.0+ sync a project with an
android_local_test
rule.What operating system are you running Bazel on?
Mac
What's the output of
bazel info release
?development version
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.Our internal fork based on v.4.0.0
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?git@github.sc-corp.net:Snapchat/bazel.git
2e15fa7e372a3118a09438624494b570e84c44d3
2e15fa7e372a3118a09438624494b570e84c44d3
Have you found anything relevant by searching the web?
I created this issue on the Robolectric tracker:
robolectric/robolectric#6242
Dagger seems to have stumbled on this issue and worked around it by pegging their Bazel version at v3.7.x:
google/dagger@1b5b075
This is the actual Turbine error check that fails:
google/turbine@8bbf4cb
This is the annotation that causes the problem:-
https://github.com/robolectric/robolectric/blob/master/annotations/src/main/java/org/robolectric/annotation/Config.java
I'm unsure why its reporting clinit as the missing attribute however.
Any other information, logs, or outputs that you want to share?
To reproduce from the command line you can just trigger the ASWB IDE aspect, this command is the smallest stripped down command that the IDE issues. Note that intellij-resolve-java is the key output group since this is what triggers Turbine. Note, that it is possible to build and run tests because Turbine isn't invoked for an
android_local_test
target in these cases. It's the aspect that triggers Turbine.The text was updated successfully, but these errors were encountered: