Skip to content
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

Eclipse versioning issues #1036

Open
Phillipus opened this issue Mar 19, 2024 · 12 comments
Open

Eclipse versioning issues #1036

Phillipus opened this issue Mar 19, 2024 · 12 comments

Comments

@Phillipus
Copy link
Member

Phillipus commented Mar 19, 2024

This issue is to track problems with using different versions of Eclipse.

Background

  • Archi is built upon the Eclipse framework
  • There is a new version of Eclipse every 3 months - March, June, September and December
  • As of today, Archi is built upon Eclipse 4.28 (June 2023)
  • At times we need to use the latest, or later, version of Eclipse because there are important bug fixes and improvements
  • If we don't use these later versions, Archi might no longer work properly on certain Operating Systems, especially Mac and Linux (see this issue for a potential showstopper on Mac)
  • However, it seems that for each bug fixed in Eclipse, a new one appears

So the problem is what are pros and cons of each new Eclipse version?

@Phillipus
Copy link
Member Author

Phillipus commented Mar 19, 2024

The following is a list of Eclipse updates and what is fixed and what is broken for Archi. These Eclipse builds contain other fixes and improvements, but I've just listed the ones that affect Archi most obviously.

Eclipse 4.29 (September 2023)

No notable fixes or new features in this version that I'm aware of so no point in using this version.

Eclipse 4.30 (December 2023)

✅ Fixes line dash spacing bug on Windows at 200% scale
❌ Tree text is clipped on Mac Intel

Eclipse 4.31 (March 2024)

✅ (Fixes from previous versions)
✅ Fixes flipped splash screen image on Mac
❌ Table/Tree/List row heights are bigger on Mac with no option for smaller heights

Eclipse 4.32 (June 2024 not yet released)

✅ (Fixes from previous versions)
✅ Option to use small or large row heights on Mac
✅ Fixes potential showstopper on Mac
❓ Regressions/bugs possible but not known yet

@Phillipus
Copy link
Member Author

Phillipus commented Mar 19, 2024

I had intended to use Eclipse 4.31 for Archi 5.3 (and had even created an early access build with it) but because of the Table/Tree/List row heights are bigger on Mac with no option for smaller heights problem reverted back to Eclipse 4.28. Let's pray that Eclipse 4.32 in June is the one.

Note that it's mainly problems in Mac that stop us moving forward to the latest version of Eclipse.

Side note - it's becoming increasingly difficult to work with Eclipse with its daily regressions, breaking changes and arbitrary change for the sake of change. Every day brings a new headache.

@Phillipus Phillipus pinned this issue Mar 19, 2024
@Phillipus
Copy link
Member Author

Possible danger here - eclipse-platform/eclipse.platform.swt#1064

@noxxious
Copy link

noxxious commented May 18, 2024

Another one, I just spent couple of days figuring out (Linux):

  • SWT relies on gdk-pixbuf to load images on Linux
  • The most recent change in gdk-pixbuf by default disables a set of loaders (like bmp, xpm) gdk-pixbuf#
    e052a112
  • This requires the Linux distributions to update their builds to specifically include bmp loaders (which was no by default before the change).
  • With the GEF version on Archi right now that fails the basic loading of cursors SharedCursors.java, which breaks all tools in Archi as the createCursor does not allow creating with the mask set to null. The latest GEF avoids this by using png files.
  • Can be verified with running Archi on unstable NixOS out of the box.

@noxxious
Copy link

I've verified the fix by rebuilding Archi with latest night Eclipse and latest GEF (reverted Archi's changes to GEF, Zest and Draw2d)

@Phillipus
Copy link
Member Author

With the GEF version on Archi right now that fails the basic loading of cursors SharedCursors.java, which breaks all tools in Archi as the createCursor does not allow creating with the mask set to null. The latest GEF avoids this by using png files.

Archi doesn't use the GEF SharedCursors we are using PNG images in customised cursors:

https://github.com/archimatetool/archi/blob/master/com.archimatetool.editor/src/com/archimatetool/editor/diagram/tools/ExtCombinedTemplateCreationEntry.java

https://github.com/archimatetool/archi/blob/master/com.archimatetool.editor/src/com/archimatetool/editor/diagram/tools/ExtConnectionCreationToolEntry.java

@Phillipus
Copy link
Member Author

@noxxious OK, perhaps even if Archi is not using the shared cursors perhaps it is failing to load them. I'll replace Archi's SharedCursors code with the latest from GEF.

@noxxious
Copy link

It's due to SharedCursors static resources being loaded upon init (clicking in the toolbox) of any Archi's tools. Here's the stacktrace and I've added some logging as I thought initially this was due to scaling on Wayland. For the mask file (bmp) the getImageData() returns null due to missing loader and SWT exception being thrown in the method itself.

!MESSAGE source org.eclipse.swt.graphics.ImageData@15c1b543 null 100

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.626
!MESSAGE invalid icons/plugmask.gif icons/plug.bmp FileImageDescriptor(location=class org.eclipse.gef.internal.Internal, name=icons/plugmask.gif) FileImageDescriptor(location=class org.eclipse.gef.internal.Internal, name=icons/plug.bmp) org.eclipse.swt.widgets.Display@7aac8884

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.627
!MESSAGE os 100 false true false

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.628
!MESSAGE os 100 false true false

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.629
!MESSAGE os 100 false true false

!ENTRY org.eclipse.gef 4 0 2024-05-18 20:17:50.630
!MESSAGE os 100 false true false

!ENTRY org.eclipse.ui 4 0 2024-05-18 20:17:50.631
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ExceptionInInitializerError
	at org.eclipse.gef.tools.AbstractConnectionCreationTool.<init>(AbstractConnectionCreationTool.java:75)
	at org.eclipse.gef.tools.ConnectionCreationTool.<init>(ConnectionCreationTool.java:42)
	at com.archimatetool.editor.diagram.tools.MagicConnectionCreationTool.<init>(MagicConnectionCreationTool.java:83)
	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:132)
	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:259)
	at java.base/java.lang.Class.newInstance(Class.java:755)
	at org.eclipse.gef.palette.ToolEntry.createTool(ToolEntry.java:87)
	at org.eclipse.gef.EditDomain.handlePaletteToolChanged(EditDomain.java:154)
	at org.eclipse.gef.EditDomain$1.activeToolChanged(EditDomain.java:54)
	at org.eclipse.gef.ui.palette.PaletteViewer.fireModeChanged(PaletteViewer.java:181)
	at org.eclipse.gef.ui.palette.PaletteViewer.setActiveTool(PaletteViewer.java:416)
	at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart$2.actionPerformed(ToolEntryEditPart.java:418)
	at org.eclipse.draw2d.Clickable.fireActionPerformed(Clickable.java:209)
	at org.eclipse.draw2d.Clickable$1.actionPerformed(Clickable.java:177)
	at org.eclipse.draw2d.ButtonModel.fireActionPerformed(ButtonModel.java:141)
	at org.eclipse.draw2d.ToggleModel.fireActionPerformed(ToggleModel.java:28)
	at org.eclipse.draw2d.ButtonModel$DefaultFiringBehavior.released(ButtonModel.java:508)
	at org.eclipse.draw2d.ButtonModel.fireReleased(ButtonModel.java:180)
	at org.eclipse.draw2d.ButtonModel.setPressed(ButtonModel.java:467)
	at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart$GTKToggleButtonTracker.handleButtonUp(ToolEntryEditPart.java:148)
	at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1215)
	at org.eclipse.gef.tools.SelectionTool.mouseUp(SelectionTool.java:602)
	at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:303)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:408)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:586)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:237)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1617)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5065)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4517)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at com.archimatetool.editor.Application.start(Application.java:70)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)
Caused by: java.lang.IllegalArgumentException: Argument cannot be null
	at org.eclipse.swt.SWT.error(SWT.java:4903)
	at org.eclipse.swt.SWT.error(SWT.java:4837)
	at org.eclipse.swt.SWT.error(SWT.java:4808)
	at org.eclipse.swt.graphics.Cursor.<init>(Cursor.java:192)
	at org.eclipse.gef.SharedCursors.createCursor(SharedCursors.java:68)
	at org.eclipse.gef.SharedCursors.<clinit>(SharedCursors.java:50)
	... 53 more

@noxxious
Copy link

I could test right away, but how big and invasive are GEF changes in Archi ?

Phillipus added a commit that referenced this issue May 18, 2024
- Use latest SharedCursors from GEF
- Load PNGs for cursors
- Fixes failure to load on Linux - see #1036 (comment)
@Phillipus
Copy link
Member Author

I could test right away, but how big and invasive are GEF changes in Archi ?

I've pushed a fix - 8c6906f

@noxxious
Copy link

It, works thanks. The loading of splash screen is broken due to it being an XPM, but that is not a big deal. Anyway, if you need help with upgrades to Eclipse I would like to contribute.

@Phillipus
Copy link
Member Author

The loading of splash screen is broken due to it being an XPM, but that is not a big deal.

The splash screen is a BMP. But I just pushed a new commit to change it to PNG.

The app icon is XPM - https://github.com/archimatetool/archi/blob/master/com.archimatetool.editor.product/icons/icon.xpm - and this is the format that Eclipse requires.

Anyway, if you need help with upgrades to Eclipse I would like to contribute.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants