Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » org.eclipse.swt Dependency issues with RAP 2.0 and Tycho Build
org.eclipse.swt Dependency issues with RAP 2.0 and Tycho Build [message #1007960] Fri, 08 February 2013 13:57 Go to next message
Ken Lee is currently offline Ken LeeFriend
Messages: 97
Registered: March 2012
Member
Hi,

I'm not sure if this is a RAP 2.0 or a Tycho issue but I guess it's related to RAP 2.0 since the Tycho build was working correctly with RAP 1.5.

I have RAP-Scout feature (org.eclipse.scout.rt.rap) that depends on the features org.eclipse.rap.feature and org.eclipse.scout.rt.
In the feature org.eclipse.rap.feature there's a bundle org.eclipse.rap.rwt which exports the package org.eclipse.swt.
Inside the feature org.eclipse.scout.rt there's a fragment *swt.fragment requiring the bundle org.eclipse.swt as a dependency. This bundle does also export a package org.eclipse.swt.

When building the RAP-Scout feature with Tycho the build fails with the following error message:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.eclipse.scout.rt.rap.feature.group 3.9.0.qualifier
[ERROR]   Cannot satisfy dependency: org.eclipse.rap.feature.feature.group 2.0.0.20130205-1849 depends on: org.eclipse.swt 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.scout.rt.feature.group 3.9.0.qualifier depends on: org.eclipse.scout.rt.ui.swing.browser.swt.fragment 0.0.0
[ERROR]   Cannot satisfy dependency: org.eclipse.scout.rt.rap.feature.group 3.9.0.qualifier depends on: org.eclipse.rap.feature.feature.group [2.0.0,3.0.0)
[ERROR]   Cannot satisfy dependency: org.eclipse.scout.rt.rap.feature.group 3.9.0.qualifier depends on: org.eclipse.scout.rt.feature.group [3.9.0,4.0.0)
[ERROR]   Cannot satisfy dependency: org.eclipse.scout.rt.ui.swing.browser.swt.fragment 3.9.0.qualifier depends on: bundle org.eclipse.swt [3.4.0,4.0.0)


My guess why this error occurs is because Tycho resolves the org.eclipse.rap.feature first and finds out that the exported package org.eclipse.swt belongs to the bundle org.eclipse.rap.rwt. When the dependency of the *swt.fragment is resolved, there might be a package name clash since the bundle org.eclipse.swt exports the same package.

However, in the *swt.fragment the bundle org.eclipse.swt is defined explicitly as a required plugin. So the package name clash should not be the reason.
I tried to remove the bundle org.eclipse.swt from the required plugins and set the package org.eclipse.swt under imported packages. In this case, I can see that the bundle org.eclipse.rap.rwt is used which is not the desired plugin.
If I set a constraint on the imported package e.g. minimum version 3.4.0 neither org.eclipse.swt nor org.eclipse.rap.rwt is imported.

Does anyone have an idea why this dependency cannot be resolved?

Used updatesites:
RAP 2.0 RC3: http://download.eclipse.org/rt/rap/2.0/RC3-20130205-1849.kepler
Kepler: http://download.eclipse.org/releases/kepler/






Re: org.eclipse.swt Dependency issues with RAP 2.0 and Tycho Build [message #1008228 is a reply to message #1007960] Mon, 11 February 2013 15:54 Go to previous messageGo to next message
Ken Lee is currently offline Ken LeeFriend
Messages: 97
Registered: March 2012
Member
I guess that this is a similar question that was asked some months ago in [1].
According to Markus Knauer the feature cannot have a reference on org.eclipse.rap.feature.feature.group instead each plugin dependency has to be listed separately.
However, if I understand Markus correctly, this should be fixed with RAP 2.0.

Markus Knauer wrote on Mon, 03 September 2012 06:17

(As a side note: This problem will be solved with the next RAP 2.0 release. We've removed this virtual dependency and replaced it with negative p2 requirments on bundle level in the p2 metadata. Since a few months it is possible to define such a negative requirement with p2.inf files during build time and this solution should solve your problems *in the long run*.)


As mentioned in my previous post, referencing the org.eclipse.rap.feature directly leads to a dependency error in Tycho because the package org.eclipse.swt is taken from the RAP plugin org.eclipse.rap.rwt instead from org.eclipse.swt.

I compared the p2.inf in the RAP 1.5 feature org.eclipse.rap.runtime_1.5.2.20130205-2024 with the RAP 2.0 feature org.eclipse.rap.feature_2.0.0.20130205-1849. It seems that the p2.inf was changed due to bug [2]. But it looks like that the latest p2.inf does only solve the dependency problem on bundle level and not on feature level.

[1] http://www.eclipse.org/forums/index.php/m/905434/
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=385512
Re: org.eclipse.swt Dependency issues with RAP 2.0 and Tycho Build [message #1009458 is a reply to message #1008228] Fri, 15 February 2013 07:17 Go to previous messageGo to next message
Markus Knauer is currently offline Markus KnauerFriend
Messages: 179
Registered: July 2009
Senior Member

The RAP Runtime feature org.eclipse.rap.feature defines negative p2 requirements [1] to conflicting bundles (e.g. org.eclipse.swt, org.eclipse.ui). For reasons described in bug 385512 it wasn't possible to define the negative p2 requirements from bundle to bundle as planned, but from feature to bundles. This prevents the installation of this feature via p2 into anything that already contains these bundles, e.g. the Eclipse IDE, because in that case the installation of RAP Runtime artifacts would cause unpredictible negative side effects.

But all this applies to the feature level only. For everyone who has a valid use-case to install RAP Runtime *bundles* together with their SWT counterparts, this is not forbidden but needs to be done explicitly - I think this is what you did in your first approach.

F org.eclipse.scout.rt.rap
- F org.eclipse.rap.feature
-- B org.eclipse.rap.rwt exports package org.eclipse.swt (1)
- F org.eclipse.scout.rt
-- Fragment *swt.fragment requiring bundle org.eclipse.swt
--- B org.eclipse.swt exports package org.eclipse.swt (2)


What I don't understand is why you have/need this *swt.fragment in your org.eclipse.scout.rt feature. IMO this always introduces a dependency to the SWT bundles and you'll always end up with two bundles providing the package org.eclipse.swt at compile time. I am not sure if this is handled by Tycho correctly... at least it doesn't seem so. I'd recommend to split this build into the two parts - RAP and SWT, and assemble the bundles/features afterwards.


[1] http://git.eclipse.org/c/rap/org.eclipse.rap.git/tree/features/org.eclipse.rap.feature/p2.inf


--

Twitter: @mknauer23 and @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: org.eclipse.swt Dependency issues with RAP 2.0 and Tycho Build [message #1009502 is a reply to message #1009458] Fri, 15 February 2013 08:39 Go to previous messageGo to next message
Markus Knauer is currently offline Markus KnauerFriend
Messages: 179
Registered: July 2009
Senior Member

On my way to the office I thought again about your problem: With the *swt.fragment you get a hard dependency to the org.eclipse.swt bundle, but this bundle cannot coexist with the org.eclipse.rap.feature feature. That explains why your approach in your first message cannot work, it's not a package name clash in that case.

Changing this hard bundle dependency to a package import doesn't work either, because then you'll end up with using the org.eclipse.rap.rwt bundle *only*. From a p2 point of view this would work, but that's probably not what you need during compile time.


--

Twitter: @mknauer23 and @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: org.eclipse.swt Dependency issues with RAP 2.0 and Tycho Build [message #1015652 is a reply to message #1009458] Fri, 01 March 2013 14:28 Go to previous messageGo to next message
Ken Lee is currently offline Ken LeeFriend
Messages: 97
Registered: March 2012
Member
Hi Markus,

Thanks for your useful information.

Quote:

F org.eclipse.scout.rt.rap
- F org.eclipse.rap.feature
-- B org.eclipse.rap.rwt exports package org.eclipse.swt (1)
- F org.eclipse.scout.rt
-- Fragment *swt.fragment requiring bundle org.eclipse.swt
--- B org.eclipse.swt exports package org.eclipse.swt (2)


What I don't understand is why you have/need this *swt.fragment in your org.eclipse.scout.rt feature. IMO this always introduces a dependency to the SWT bundles and you'll always end up with two bundles providing the package org.eclipse.swt at compile time. I am not sure if this is handled by Tycho correctly... at least it doesn't seem so. I'd recommend to split this build into the two parts - RAP and SWT, and assemble the bundles/features afterwards.


Since Scout runtime provides multi-frontend capabilities there are dependencies to the SWT und RAP bundles.
However, what I don't understand so far is why the Tycho build does work if I list the RAP bundles inside the RAP feature separately, i.e.

F org.eclipse.scout.rt.rap
- B org.eclipse.rap.rwt (from org.eclipse.rap.feature)
- B org.eclipse.rap.rwt.osgi (from org.eclipse.rap.feature)
- B org.eclipse.rap.jface (from org.eclipse.rap.feature)
- B org.eclipse.rap.ui (from org.eclipse.rap.feature)
- ...
- F org.eclipse.scout.rt
-- B *rt.ui.swt
--- Fragment *swt.fragment requiring bundle org.eclipse.swt
---- B org.eclipse.swt exports package org.eclipse.swt (2)


I guess that this has to do with

Quote:

For reasons described in bug 385512 it wasn't possible to define the negative p2 requirements from bundle to bundle as planned, but from feature to bundles.


meaning that the negated p2.inf only has an effect if the RAP feature is listed as a required dependency but not if the RAP bundles are used directly as required dependencies.
With this approach, there are eventually two bundles providing the package org.eclipse.swt and Tycho seems to handle them correctly at compile time.
In the former case when the RAP feature was used as dependency, only the package org.eclipse.swt of the bundle org.eclipse.rap.rwt was found because the one from bundle org.eclipse.swt could not be installed due to the p2.inf negated requirements.

The bundle approach however seems to have a disadvantage too because a negated p2.inf file corresponding to [1] cannot be defined since this would prevent the root feature org.eclipse.scout.rt.rap from getting installed.
Therefore, I think that the only solution would be create a separate feature for the *swt.fragment part as you already mentioned in the previous post.

What's your opinion?

[1] http://git.eclipse.org/c/rap/org.eclipse.rap.git/tree/features/org.eclipse.rap.feature/p2.inf



Re: org.eclipse.swt Dependency issues with RAP 2.0 and Tycho Build [message #1016948 is a reply to message #1015652] Fri, 08 March 2013 10:09 Go to previous message
Markus Knauer is currently offline Markus KnauerFriend
Messages: 179
Registered: July 2009
Senior Member

Hi Ken, I really think the best and the easiest solution is to split the build into two or more parts, and assemble the bits and pieces thereafter. Keep us posted about your progress.

Thanks, Markus


--

Twitter: @mknauer23 and @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:UrlLauncher can't handle dataURIs
Next Topic:NullPointerException in UISessionBuilder after launching Site in Browser
Goto Forum:
  


Current Time: Thu Apr 18 20:57:37 GMT 2024

Powered by FUDForum. Page generated in 0.02079 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top