-
Notifications
You must be signed in to change notification settings - Fork 145
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
weird dependency resolution problems after upgrade #702
Comments
hmm where in the jars can you see that?
i assume the 0.19 will have
and thus also match 0.20.x in wonder why 0.19.0 is in the resolving game at all |
am also not sure if the |
Yes, my bad, typo, and fixed now (updated to |
In the headers of the |
Actually, after running the update, |
Looks like lsp4e got updated only partially (lsp4e.debug didn't made it through in the latest version here in my tests, causing the older version to stay around and dragging the older But the circular resolution still looks weird to me and the question why the |
hmmm i see this one Import-Package: com.google.gson;version="[2.10.1,2.11)",com.google.gson. all of these stem from this bundle. |
we might might a
|
Signed-off-by: Christian Dietrich <[email protected]>
something to experiment with |
Thanks @cdietrich for setting this up, I tried to run a few experiments with it, basically around upgrading an old installation to a new version that had this lsp4j version included. While building and upgrading works fine, I run into this when starting up the IDE:
But it really seems to be a different and probably unrelated problem. Just for the reference here. |
Signed-off-by: Christian Dietrich <[email protected]>
Signed-off-by: Christian Dietrich <[email protected]>
@martinlippert looking at your exception it seems that the runtime classpath contains duplicate GSON versions and you happen to find a cased where FWIW, I am finding myself in an unresolved target platform with a similar problem. I don't know how but I end up with multiple LSP4J bundles in the target platform: Now this doesn't seem to be a problem unless I am trying to run something. I think PDE's Target Platform State has the answer: The old GSON bundle is importing packages from the newer GSON bundle. I think is causing trouble. This basically means that there will be only one version of GSON at runtime. That's why LSP4J fails to resolve. It cannot find the old version anymore. |
@cdietrich I think the GSON bundle also needs a change (fix). The problem is that there is a mismatch on version ranges between LSP4J and GSON. If GSON continues to import its own packages (self) it can do so. However, LSP4J needs to use the same version range for its imports of GSON as GSON does for its self imports. Otherwise there will always be a resolution problem. So if LSP4J really needs that tight import range |
So, I see that the import range has been relaxed as part of #690: Is it possible to backport this to I still think the Orbit GSON bundle should be changed to use a tighter self import (cc @jonahgraham) |
we currently use
in orbit, so this would have to become
not to include next major as upper, but the next minor instead
or should we have no package import there as well, as mixing wont work anyway
|
Ed Merks tried this by using the upstream version of gson (which was already a valid OSGi bundle) and the same/similar problems happen because even the originals have self-imports. It is very common for bnd created bundles to have self imports and I don't understand why in the lsp4j+gson case this is turning into a problem. FTR I don't mind if someone want to change gson in Orbit, but my preference would be to remove the re-bundled gson in Orbit. I am working with Ed (meeting next week) to stop having bundles in Orbit that are already OSGi-ified using https://download.eclipse.org/oomph/simrel-maven/nightly/latest |
@jonahgraham It's LSP4J narrow import range. This clashes with GSON. See my comment/analysis here. The GSON self imports with the wider version range ensure that all minor releases of GSON are collapsed at runtime to avoid multiple minor versions of the same package. Thus there will always be only one major version available. LSP4J on the flip side requires multiple minor versions to be available. That's a conflict. I don't have background on this decision. Might be worth reconsidering. |
The background is we were shy about wider ranges because gson does not do semantic versioning (or at a minimum in the past they have had instances of API changes on maintenance releases). LSP4J 0.20.1 widdened the range to cover tested versions in #690 and I am certainly open to widening it again. The upstream (maven central) gson does not use version ranges at all on its self-imports, their import package is:
and I don't know what that implies, does that mean any version of Anyway, I am open to changes/widening of ranges/etc in LSP4J. Please provide a PR that resolves your issue. I am more than happy to release a 0.20.2 version (or whatever you need to unblock) just let me know. |
I am still catching up with the older messages. Yes I can do a 0.19.x with that change. |
sorry for the influx of messages - I seem to be doing a bit of stream of consciousness A 0.19.1 with #690 backported will be the same as 0.20.1 is. The only differences between 0.19.0 and 0.20.1 is the gson version range + the version of LSP4J itself: Therefore can you switch to 0.20.1? Or are you constrained elsewhere to 0.19.x in a way that is hard to resolve? |
@jonahgraham It seems WildWebtools has a dependency on 0.19.x in 2023-03. |
I can do a 0.19.1 release next week. It will basically be the same as 0.20.1 release - except for the version number of LSP4J itself. |
@merks @jonahgraham is there an issue where this is tracked? |
@jonahgraham and I have a meeting week to discuss Orbit/Maven. I opened this issue describing what I've done so far: |
Signed-off-by: Christian Dietrich <[email protected]>
Fixes eclipse-lsp4j#702 Backport of eclipse-lsp4j#690 commit ff58da7
Fixed in #723 |
After running an update, I found myself in a situation that various lsp4j bundles in version
019.0
as well as0.21.1
are installed. While that should not be a problem on its own, the package wiring that I ended up with is somewhat strange.This looks like the package
org.eclipse.lsp4j.jsonrpc
is imported in version0.19.0
from the0.20.1
bundle and vice versa.This somehow causes the bundle
org.eclipse.lsp4j
in version0.20.1
to not resolve with this problem diagnosis:It seems to me like the re-import of the exported packages is causing some confusion.
The text was updated successfully, but these errors were encountered: