Closed kageiit closed 7 years ago
@cushon
We have been able to work around this by forking dagger and disabling the java formatter part. It does not change the code functionally and just formats it, so it didnt have any impact.
It might be good to provide an apt argument to turn off java formatter due to this bug
@ronshapiro @cushon any updates or thoughts?
Can we get this fixed on the eclipse side of things? That would fix this issue for any google-java-format (and thereby dagger) user. I don't think not formatting is the way to solve this.
edit: I realize that might not be so simple, but I'm not sure what resource is needed to parse an AST.
Agreed that not formatting isn't the ideal way to solve it, it's just a temporary patch on our end to de-flake our builds. I think the issue is IO reads in a multi-module project during APT exposes that JDK bug. There might not be much we can do about it without Java fixing it. I was thinking more of a solution around formatting before writing to disk, rather than writing once, reading back (where the error happens), and writing again. Sort of like AutoValue's Reformatter
does. Thoughts?
OK, so I did a bit of digging into this. First, it seems that while the stack trace contains GJF, the problem doesn't actually arise from formatting, but rather from ecj loading its own messages. Luckily, as of https://github.com/google/google-java-format/commit/ba2a958fc7b2452779f99c9246ee0feb07f52815, GJF doesn't use ecj anymore!
I chatted with @hzsweers and he's going to do a GJF build from HEAD
and see if using that fixes their issue.
In either case, it seems like a new release of GFJ might be a good idea. I'm not sure exactly whose in charge of that release process but @cushon, @nglorioso and @ronshapiro seem like likely candidates.
I talked with some people working on GJF and they're looking into cutting new release. https://github.com/google/google-java-format/issues/111 is the tracking bug. As soon as that is resolved, we can cut a new dagger release and close this issue.
GJF is using error prone compiler under the hood to format code now. Error prone bundles an unshaded guava version in their core jar that causes issues when it is put on the classpath by GJF. There is a related ticket open about it here https://github.com/google/error-prone/issues/501
I'll cut a GJF release soon.
This is unrelated to google/error-prone#501 - Error Prone and GJF depend on the same version of javac, GJF does not depend on Error Prone.
IIUC, this issue is no longer plaguing you, right? If it is, feel free to reopen this
Yep we're good now on the crash
Dagger processor seems to crash sporadically when many parallel gradle modules in a project are being built.
This seems very similar to the issues observed in https://github.com/google/auto/issues/365 which is related to reading resources and this long standing JDK issue: https://bugs.openjdk.java.net/browse/JDK-6947916