ssi-schaefer / lcdsl

Eclipse Launch Configuration DSL (Xtext based)
Eclipse Public License 1.0
23 stars 12 forks source link

Cannot add two plugins with same id but different version #26

Closed enikao closed 4 years ago

enikao commented 5 years ago

I'd like to add the same plugin twice, with different versions. This is possible in regular launch configs.

LcDsl gives an error Duplicate PluginWithVersion 'org.antlr.runtime'

Example:

plugin org.antlr.runtime 3.2.0.v201101311130;
plugin org.antlr.runtime 4.3.0.v201502022030;
mduft commented 5 years ago

Thanks for reporting. This is definitely a bug. However you should be able to work around it by adding a "proxy" bundle to your workspace, which has no content, just the two "Require-Bundle"s for the two versions, and add that in the launch configuration instead.

enikao commented 5 years ago

Thanks for the hint. However, I only need this to work around issues in the auto-resolving, not my own plugins. Thus, I don't want to maintain additional artifacts.

Specifically:

mduft commented 5 years ago

Understood. Whilst I do want to fix this bug of course, you can still work around the issues with a single bundle with dependencies to all the doubled-up-dependencies. Nobody needs to actually use that bundle, it is just there to tear in additional dependencies that are impossible to declare with this bug.

(I know, you need to maintain that in your sources, and thats not nice. But OTOH, you would need to maintain this list of dependencies in the launch config otherwise...)

enikao commented 5 years ago

Yes, the real issue is the auto-resolver who does not understand this constraint and adds only the newest version (for both regular and LcDsl launch configs, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=472778).

mduft commented 5 years ago

Well, we do have dependencies to multiple guava versions transitively in our application, and LcDsl is able to generate launch configuration which contain both versions. We do NOT use the same resolver as Eclipse itself. I actually proposed a patch for the resolver a while ago. AFAIK the most current Eclipse has a different fix for the issue.

see https://bugs.eclipse.org/bugs/show_bug.cgi?id=489319

Re-reading the upstream bug: do you have simpleconfigurator checked in your launch configuration?

enikao commented 5 years ago

What is simpleconfigurator? Maybe I looked up the wrong bug.

Your remark on resolver might explain another issue I have: My launch config behaves differently whether I run it via the menu bar or via the launch configs dialog. I didn't report it yet because my project is not yet available for you to look into (will change soon; it's a newer version of https://github.com/altran-mde/xtext-sirius-integration).

mduft commented 5 years ago

Simpleconfigurator is a simple implementation of a OSGi framework configurator which defines which bundles should be loaded by the runtime. It uses a bundles.info file which is generated if simpleconfigurator is used. Unfortunately it seems that Eclipse still defaults to using the ULTRA-legacy UpdateManager instead of P2 (the current mechanism for bundle management in RCP applications) which was used in very old Eclipse versions and does not /really/ know OSGi that well - especially duplicate bundles with just version difference don't work with it, even if the bundles are checked in the launch configuration.

enikao commented 5 years ago

Where do I choose the simpleconfigurator? I checked the launch config dialog and the preferences, and didn't find any hint.

mduft commented 5 years ago

Simply add the org.eclipse.equinox.simpleconfigurator (or so, from the top of my head) bundle to your launch configuration, or as dependency of your software.

enikao commented 5 years ago

doesn't really help; after clicking on "add required plugins" (in a regular launch config):

image