-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
19rc2 regression: Using ImmutableMutlimap and annotation processors fails compile on jdk6 #2173
Comments
javac trace with 19rc2:
|
javac trace with 19rc1:
|
I suspect this is due to c62b07d |
We assume that anyone who wants to compile Guava will do so with javac 7. That said, if anyone wants to propose a noninvasive fix, we could merge it. |
This looks like this JDK bug but I think that should be fixed in the 1.6.0_45 version. @cpovirk the issue occurs when compiling with Guava in the classpath, not when compiling Guava itself. |
Oh, sorry, thanks. We should figure this out. |
Thanks for the easy way of reproducing the problem. I've tried backing out your suggested commit and everything else related to j2objc (c62b07d 9615497daa21fd9eba838949c52af979184fdf19 b21afd3bab31518b4a1c74784d3fd7f95783cb23 a02e1656a4be29fd6f8441f444c3b30cc62467c6 4fe1c9c76ba9e7a9cfd8073ab750a73404c685a0), but this didn't help. I'm kind of glad, since I don't know what we would do if that were the problem :) Not that I'm sure what we'll do, anyway.... I'll binary search from here. |
@cgruber, is it possible for us to configure Travis to run with Java 6? |
The problem seems to be 26342f6. |
Or maybe I'm doing |
@cpovirk I hope there is more to it than this commit, otherwise jdk6 javac is seriously fucked up! |
From the sound of the bug Éamonn linked, I would guess that it is :) That one would at least be easy to fix :) But I do think I got the commit wrong. I'm suspecting that I need to learn more about |
Actually, if I now rebuild 19.0-rc1, I get the failure there, too. The problem seems to be that we've upgraded the compiler on our workstations between when we built 19.0-rc1 and 19.0-rc2. Hermetic builds are overrated, so Maven doesn't care :-P I'll see if we can build with an older compiler. |
Yep, that's the problem. I've updated our release instructions to include building with an older JDK. We will do so for 19.0-rc3. @cgdecker as an FYI. Thanks again for the report. Ideally we would report this to Oracle, but I envision that a small enough example program will be painful to produce. |
A workaround:
|
"Alternative" "fix" that would not be very helpful in practice:
|
@cpovirk thanks for solving this! |
@cpovirk We might be able to configure Travis to use openjdk6 for something, but I'm not clear on what we'd do. We can't do the normal build/test we do on other JDKs because Guava just won't build on JDK6. And even if we could, is a build/test enough to catch this problem? Don't we need to build something else with guava + annotation processor on the classpath? |
Sorry, I guess I still haven't quite accepted that this is a different problem than I initially thought. Ideally we would still have a regression test, but it would have to be more complex than I had expected, so it's probably not worthwhile. |
I'm still trying to reproduce this without pulling in the whole of Guava. |
I've managed to reproduce it. I'm not sure whether Oracle will feel the need to do anything, since Java 6 (and even Java 7) are no longer publicly updated, but maybe there's some chance that they'll view it as a bug in the Java 8 compiler. But I'm not feeling too lucky. @jbgi , for what reason do you build with JDK6? We might be able to find workarounds, but I would be worried that we'll miss cases unless we invest a fair bit of time in hunting them all down. |
(For example, the problem exists with all other public subclasses of |
Unfortunately we still use jdk 6 in a number of projects at work (full migration to java 8 will not happen before Q2.2016). If this bug is not fixed then I guess we will just continue to use guava 18 until we migrate to java 8.
|
I think it is worth openning a bug at openjdk. then, if it fixed, release a 19.1 that restore jdk6 compatibility. |
Thanks. I guess I'm focusing too much on the negatives: We do have the workaround of compiling 19.0 with an older javac, so we should be able to maintain compatibility. |
Ok, so if we just compile 19.0 on, say, openjdk7, the resulting artifact shouldn't have this problem when used with an annotation processor? Not something we want to have to keep doing long-term probably, but should certainly be able to do that for 19.0. |
Yep. I previously claimed to have updated our Release Process instructions with the information about which specific JDK version I was having success with. But I realized that I hadn't saved the change to the page because I'd been planning to link to back to this thread. I did eventually make the change, but if you looked relatively shortly after I claimed to have made it, it wasn't there. It is now. |
I confirm that I cannot reproduce the problem with 19.0-rc3. thanks! |
The following test case fails on jdk6u45 (trigger a jdk6 bug probably fixed in jdk7). It happens as soon as an annotation processor is present in the classpath (not only auto-value).
The text was updated successfully, but these errors were encountered: