Bug 578205 - Workspace selection dialog never shows up with Sphinx plugins installed
Summary: Workspace selection dialog never shows up with Sphinx plugins installed
Status: CLOSED MOVED
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: 0.12.0   Edit
Hardware: PC Windows 10
: P3 normal with 1 vote (vote)
Target Milestone: 0.12.1   Edit
Assignee: Balazs Grill CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-13 12:22 EST by Raphael Weber CLA
Modified: 2024-05-08 14:58 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Weber CLA 2022-01-13 12:22:17 EST
Steps to reproduce:
 1. Start a fresh installation of eclipse >=2021.06( without any sphinx plugins) - the workspace selection dialog will appear. There is a setting in Preferences -> General -> Startup and Shutdown -> Workspaces: "Prompt for workspace on startup" that can be used to always enforce the workspace selection dialog.

 2. Install Sphinx plugins (tested with 0.11.2 and 0.12.0) shutdown and start eclipse again (do not use "Restart" from the File menu) - the workspace selection dialog will never show again...

 3. Uninstall all Sphinx plugins and the workspace selection dialog will be back.

After some digging we found out that the new Service-Component org.eclipse.e4.ui.internal.workbench.ModelAssembler seems to be the cause. The ModelAssembler activates EMF which activates Sphinx. And Sphinx assumes the workspace to be already set (defaults to $USER_HOME\workspace), so it loads it -> workspace selection dialog can never appear.
Comment 1 Balazs Grill CLA 2022-01-15 01:43:16 EST
(In reply to Raphael Weber from comment #0)
Hi Raphael,

thanks for reporting this. Many of the sphinx plugins uses eager loading through its Activator, so I have some suspects what might be causing this. I will try to look into this on next week
Comment 2 Balazs Grill CLA 2022-01-25 05:16:35 EST
You're right, the ModelAssembler loads EMF plugins which in turn instantiates every extension. (the first from sphinx I've encountered is org.eclipse.sphinx.emf.resource.SphinxManagedModelFileContentHandlerImpl)

This causes the workspace to be accessed via 
org.eclipse.sphinx.emf.Activator.Implementation.startWorkspaceSynchronizing()
before the application could start and prompt the user for the workspace settings (org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(Shell, Map))

However, this is not the only point where this happens. So far I've found the following accesses to the workspace from the context of a bundle activation:

- org.eclipse.sphinx.emf.Activator.Implementation.start(BundleContext)
- org.eclipse.sphinx.platform.internal.Activator.start(BundleContext)
- org.eclipse.sphinx.emf.workspace.Activator.Implementation.start(BundleContext)
Comment 3 Raphael Weber CLA 2023-01-23 07:38:16 EST
Hi Balazs, any chances to get this fixed?
Comment 4 Balazs Grill CLA 2023-01-23 07:59:23 EST
Hi Raphael, unfortunately this kind of eager behavior is inherent to sphinx and I don't see any quick way to resolve this without breaking functionality. There were a change replacing the affected calls to using ServiceCaller (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=580733), however it still enforces the initialization so this issue persists.

Therefore the answer to your question currently is no, I don't work on this actively.
Comment 5 Balazs Grill CLA 2024-05-07 01:00:22 EDT
This issue will be migrated to gitlab.
Comment 6 Eclipse Webmaster CLA 2024-05-08 14:58:24 EDT
This issue has been migrated to https://gitlab.eclipse.org/eclipse/sphinx/org.eclipse.sphinx/-/issues/6.