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

Problem with p2 and flatpak distributions due to .ini file mishandling. #555

Open
wiresketch opened this issue Oct 10, 2024 · 0 comments
Open

Comments

@wiresketch
Copy link

I am trying to package my RCP app as a flatpak, and I've noticed the following issue when using it. It can be easily reproduced using https://github.com/flathub/org.eclipse.Java flatpak of Eclipse:

$ flatpak install org.eclipse.Java
$ flatpak run org.eclipse.Java

  • Install some extra plugins which will be placed in ~/.var/app/org.eclipse.Java/eclipse
  • Restart
  • Play with the plugin

Now reinstall the flatpak using:
$ flatpak uninstall org.eclipse.Java
$ flatpak install org.eclipse.Java

Then run it again:
$ flatpak run org.eclipse.Java

The installed plugin is not available anymore although it still appears in the installation details. No migration wizard is opened.

Try to run Eclipse with "-clean" parameter - a common advice in this case.
$ flatpak run org.eclipse.Java -clean

Eclipse opens but the previously installed plugin is still not available. Stop and run Eclipse again:
$ flatpak run org.eclipse.Java

There is an error and the installation is broken. The log file contains an error like this:

!ENTRY org.eclipse.osgi 4 0 2024-10-10 13:41:06.506
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:86)
	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)

I've tried to follow how shared configuration folder changes between the above steps, and I suspect that the core issue is the way .ini (eclipse.ini) file is being handled. My suspition is that the issue comes from the fact that EquinoxManipulatorImpl.java is using lastModified() of the ini file. The problem is that Flatpak sets the last modified time of all files to 1970-01-01 (unix epoch 0) as can be seen here: flatpak/flatpak#926

So I believe this makes the lastModified() time a bad method of detecting changes/updates to the .ini file. I am not a p2 export, so perhaps someone with more knowledge of implementation details can confirm whether this could be the cause of the problem.

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

1 participant