-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Only import errorprone.annotations with optional (if at all) #2794
Comments
See this comment and the discussion it links to. Unless you have reason to think the situation has evolved, this doesn't seem like something we want to change. |
Maven optional (compile time) is something completely with OSGi optional (runtime), the jar is already compiled at this stage so it can't lead to any "cryptic compiler message", so I'd like to ask to reopen this please! |
@eamonnmcmanus I support @laeubi in this regard and would encourage to reopen. This topic is similar to my work done in #2735 and is about runtime and resolving bundles in an OSGi context. Without |
OK. To be honest, OSGi support is something of an annoyance to the project maintainers, since none of us has expertise in it or uses it in any way. As recently as yesterday I was forced to spend quite some time figuring out how to adjust the OSGi configuration, and I seriously contemplated just removing it from the project. However, apparently some people do need it, presumably because of Eclipse, and this change is probably harmless. |
Is there a chance to release 2.12.1 ASAP with this fix? |
Has something changed to make this urgent? Was the situation not already the same with 2.11.0, released last May? |
2.12.0 was released and people / projects will update to it like in eclipse-platform/eclipse.platform.releng.aggregator#2794 |
I think you can ping everybody involved in this issue (including myself) in case you need assistance with OSGi or the configuration of the bnd-maven-plugin in the future. |
That doesn't really answer the question. You're asking me to do something ASAP and I'm asking you what has made it so suddenly urgent. Apparently people have been living with the current situation for a long time. I'm a little reluctant to make another release a few days after the last one, if only because of the churn it may cause for client projects. |
Umm. The problem appears first with 2.12.0 version, so 3 days is not a long time :) Especially because the problem just happened it would be beneficial for all OSGI consumers to get immediate hotfix. |
I see. Can you or @HannesWell help me understand why the problem occurred with 2.12.0 and not 2.11.0? |
The manifest of 2.12.0 says OSGI to require errorprone annotations bundle, 2.11.0 manifest doesn't have this dependency at all. So whoever had dependency to gson but never had errorprone annotations can't update now without additionally install errorprone dependency as in eclipse-platform/eclipse.platform.releng.aggregator#2794 |
Do you know what changed to cause that addition to the manifest? |
Not a slightest idea. @laeubi and @HannesWell are much more familliar with the build tooling around maven. |
Let me try, because I had a look at bnd today: I believe it happened because
Thus in order to opt-out and say "No we do not use it at RUNTIME, and it is fine to be optional", the OSGi Manifest needs to be manually adjust via |
OK. I will make another release, but I have to say that you OSGi guys are making a lot of work for other people. Perhaps there is some way to avoid that? |
Thanks a lot. |
Much appreciated! |
@eamonnmcmanus First thanks for working on this I can understand it is annoying. But on the other hand it is also annoying for consumer of such a (widely used) library if things "suddenly" go in the wrong direction. It is a bit hard to help/improve if we not know what are the problems you have had here:
so if there is any problem/question you can of maybe just ping anyone recently adjusted that configuration (like @chrisrueger ) and I'm sure they will help. I think for general OSGi question one can even ask here. Beside that I have opened this ticket, I really don't see any value (beside confusing people and tools) that these error prone annotation are available at RUNTIME: I don't use error prone at all so its hard to tell, but from the description:
the CLASS or even SOURCE retention policy should be enough and would make this annotation much less intrusive (and probably even let the strange compile errors go away). |
This sounds very plausible for me. If one wants to be very sure. One could revert the commit that adds these annotations locally and re-build GSON without the change that makes the errorprone-annotations optional explicitly. |
For the record, this was in the context of #2793. As it turns out, I am dropping that PR anyway. |
Gson version
2.12.0
Java / Android version
any java version
Used tools
Description
Currently the gson release requires in its manifest:
com.google.errorprone.annotations;version="[2.36,3)"
this requires to pull in the error prone annotations to the OSGi runtime.
Expected behavior
The annotations should only be imported with optional
com.google.errorprone.annotations;version="[2.36,3)";resolution:=optional
because they are not interesting/required at runtime, see also
or not imported at all.
The text was updated successfully, but these errors were encountered: