-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Upgrade Gson to 2.10 #3321
Comments
Xtext 2.30 is expected at end of February and that updates to GSON 2.10. |
That will cause issues if you develop using Eclipse, because bnd only allows for using one version of a bundle. So it will break either everything Xtext related (depending on the older Gson) or all code depending on the new Gson bundle version. |
For reference: xtext/xtext-reference-projects#318
@wborn - hmm, that sounds like a real problem. Unfortunately I'm not very much into Maven and dependencies, but I know the pain from managing dependencies in .NET. This time it seems we might get lucky because xtext is being upgraded soon, but if this wouldn't have happened, our progress could be slowed down a lot when stuck with versions from lowest denominators. I hope there is some kind of solution for that. I might take the opportunity to learn more about Maven, but would be interested in any tips. 🙂 Anyway, this is slightly off-topic as it can now be considered a more general problem, since we'll hopefully soon be able to upgrade to Gson 2.10 when xtext does, and we are ready to upgrade xtext. |
Could we also figure the same with XStream ? Version 1.5.0+ is needed for records. |
xtext 2.30 was released in the beginning of this week: https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2023/02/27/version-2-30-0 Previous upgrade for reference: f9a74ab |
I just tried.. it's a very difficult upgrade. XText now requires |
@wborn Do you have an idea how we can get around the equinox runtime requirement for xtext? |
I had a look and so far could only get a working distro with Xtext 2.30.0 and Gson 2.10 by manually removing the requirement from the |
Do you think we should create our own bundle in openhab-osgiify? Can you push your changes to a branch, I can then check what needs to be done to the bundle. |
Have a look at wborn@2a587e2. I also had to patch the Xtext bundles to work with Pax Logging 2.2.0 but that is hopefully fixed in the next Karaf version. |
It seems with #3814 Pax Logging is at 2.2.3. I'm not sure where that leaves us with Xtext and ultimately Gson? |
IIRC the issue is that the newer Xtext versions depend on slf4j 2.x and that was not available in pax-logging 2.2.0. pax-logging > 2.2.0 has slf4j, so this should no longer be an issue. What remains is #3321 (comment). |
I'll have another look and see what happens when upgrading to Xtext 2.32.0 instead of 2.30.0 which I previously tried. |
Upgrades Xtext and its dependencies to: * Xtext/Xtend 2.32.0 * LSP4J 0.21.0 * GSON 2.10.1 * Guava 32.1.2 * Guice 7.0.0 For release notes, see: https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2023/08/27/version-2-32-0 Fixes openhab#3321 Signed-off-by: Wouter Born <github@maindrain.net>
Upgrades Xtext and its dependencies to: * Xtext/Xtend 2.32.0 * LSP4J 0.21.0 * GSON 2.10.1 * Guava 32.1.2 * Guice 7.0.0 For release notes, see: https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2023/08/27/version-2-32-0 Fixes openhab#3321 Signed-off-by: Wouter Born <github@maindrain.net>
Upgrades Xtext and its dependencies to: * Xtext/Xtend 2.32.0 * LSP4J 0.21.0 * GSON 2.10.1 * Guava 32.1.2 * Guice 7.0.0 For release notes, see: https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2023/08/27/version-2-32-0 Fixes #3321 Signed-off-by: Wouter Born <github@maindrain.net>
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/govee-dreamcoulour-led-strips/84435/34 |
There doesn't seem to be a XStream 1.5.0 release yet @clinique. |
Now that we have Java 17 support, it would be nice to upgrade Gson to the latest version (currently 2.10.1). Version 2.10 supports Java records: https://github.com/google/gson/releases/tag/gson-parent-2.10. Records are particularly useful when used in combination with Gson for serializing/deserializing from/to DTO's.
I'm working on a new binding (openhab/openhab-addons#14222) where I have initially taken advantage of this:
However, including this Gson dependency within the binding adds more than 250 kB, which is probably not acceptable:
I tried upgrading from 2.9.1 to 2.10.1 in core, but ended up with a dependency problem:
[ERROR] Failed to execute goal on project org.openhab.core.bom.compile-model: Could not resolve dependencies for project org.openhab.core.bom:org.openhab.core.bom.compile-model:pom:4.0.0-SNAPSHOT: Failed to collect dependencies at org.eclipse.xtext:org.eclipse.xtext.xbase.ide:jar:2.29.0 -> org.eclipse.xtext:org.eclipse.xtext.ide:jar:2.29.0 -> org.eclipse.lsp4j:org.eclipse.lsp4j:jar:0.19.0 -> org.eclipse.lsp4j:org.eclipse.lsp4j.generator:jar:0.19.0 -> org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:jar:0.19.0 -> com.google.code.gson:gson:jar:[2.9.1,2.10): No versions available for com.google.code.gson:gson:jar:[2.9.1,2.10) within specified range -> [Help 1]
I don't know how to fix this, but I'm wondering if it would be possible and acceptable to have both 2.9.1 (because of this dependency) and 2.10.1 in core? At least 2.10.1 would only be included once and all bindings could take advantage of it.
The text was updated successfully, but these errors were encountered: