eclipse-equinox / equinox

equinox
Eclipse Public License 2.0
31 stars 65 forks source link

Child app launched from Eclipse no longer shows splash screen since I20240507-2220 build (Mac aarch64) #625

Closed Phillipus closed 4 months ago

Phillipus commented 4 months ago

I'm not sure if Equinox is the right place for this but I'll try....

When I launch my RCP app (or a child Eclipse instance) from Eclipse I get to see the splash screen and the RCP app gains the focus. Since I-Build I20240507-2220 this no longer happens. This is on macOS aarch64.

@HannesWell Can you help? Did something change?

Phillipus commented 4 months ago

Steps to reproduce:

  1. Download I-build Eclipse for mac aarch64 - https://download.eclipse.org/eclipse/downloads/drops4/I20240505-1800/
  2. Launch this Eclipse with a clean workspace and create a new Launch Configuration and select "org.eclipse.platform.ide" in the "Run a Product" section.
  3. Launch this child Eclipse and see the splash screen

And:

  1. Download I-build Eclipse for mac aarch64 - https://download.eclipse.org/eclipse/downloads/drops4/I20240507-2220/ (or later)
  2. Launch this Eclipse with the previous workspace to re-use the previous Launch Configuration (or create a new one as before)
  3. Launch this child Eclipse and there is no splash screen
HannesWell commented 4 months ago

I don't have time to investigate this before next week, sorry. But there have been a couple of changes affecting the executable and launcher library for Mac the day before that build, e.g. regarding file-permissions. I don't recall a change in PDE form the top of my head, which could be another location influencing that.

Phillipus commented 4 months ago

I don't have time to investigate this before next week, sorry. But there have been a couple of changes affecting the executable and launcher library for Mac the day before that build, e.g. regarding file-permissions. I don't recall a change in PDE form the top of my head, which could be another location influencing that.

Actually it's since version I20240507-2220 so I've edited the original posts. This is only affecting Mac aarch64. Windows and Mac x86_64 is OK. At the moment I can't see any changes that would affect this so any clues are helpful. :-)

Phillipus commented 4 months ago

@HannesWell I found the problem.

The org.eclipse.equinox.launcher.cocoa.macosx_1.2.1000.v20240507-1834 folder is missing the eclipse_11902.so file. This file is in the org.eclipse.equinox.launcher.cocoa.macosx.aarch64_1.2.1000.v20240507-1834 folder but it needs to be in the first folder as well.

Build I20240505-1800:

1

 

Build I20240507-2220 and later:

2
Phillipus commented 4 months ago

It's interesting that on Mac aarch64 two launcher bundles are created:

org.eclipse.equinox.launcher.cocoa.macosx_xxxxxxxx org.eclipse.equinox.launcher.cocoa.macosx.aarch64_xxxxxxxx

Whereas on Mac x86_64 only one is created:

org.eclipse.equinox.launcher.cocoa.macosx.x86_64_xxxxxxxx

I once asked why this is so. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=572797#c4

I'm not sure which one is actually used on aarch64. As reported here, the first one is needed for the splash screen to show when launching a child Eclipse/RCP app but the second one is needed to actually launch Eclipse/RCP app.

Phillipus commented 4 months ago

Another strange thing...

To test my RCP app I have a target definition file targeting the latest I-builds and one targeting the Eclipse 4.28 p2 repo so I can compare.

It seems that when launching my RCP app from Eclipse it looks for the most recent org.eclipse.equinox.launcher.cocoa.macosx_xxxxx bundle in the target bundle pool because the splash screen is now not showing even though I'm targeting Eclipse 4.28 and it should use the org.eclipse.equinox.launcher.cocoa.macosx_1.2.700.v20221108-1024 bundle.

If I manually delete the latest org.eclipse.equinox.launcher.cocoa.macosx_xxxxx bundle (the one with the missing eclipse_11902.so file) from the target bundle pool it works again.

TL;DR - PDE launch uses the latest version org.eclipse.equinox.launcher in the target bundle pool regardless of what target you specify.

HannesWell commented 4 months ago

The missing so-file is could be a side-effect of https://github.com/eclipse-equinox/equinox/pull/612. Maybe tycho does not follow sym-links.

But from what you have described https://github.com/eclipse-equinox/equinox/pull/622#issuecomment-2101584195 could fix this too.

Phillipus commented 4 months ago

The missing so-file is could be a side-effect of #612. Maybe tycho does not follow sym-links.

But from what you have described #622 (comment) could fix this too.

I don't really understand all of this, but from my experiments it seems that launching Eclipse or an RCP app natively requires the longer named bundle, but launching a child Eclipse/RCP app from Eclipse requires the shorter named bundle? Also, Mac requires different archs for the so binaries?

Phillipus commented 4 months ago

I've been trying to figure out why the so library is loaded from the org.eclipse.equinox.launcher.cocoa.macosx location rather than org.eclipse.equinox.launcher.cocoa.macosx.aarch64

I debugged and came to this:

https://github.com/eclipse-equinox/equinox/blob/99a85789ed29f87d4ed04d15bb640de325f4750f/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java#L450-L457

fragmentArch is not being added to the string because of the if condition. If that condition is removed the so file is loaded from org.eclipse.equinox.launcher.cocoa.macosx.aarch64.