Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Bundle-NativeCode selection-filter not properly supported
Bundle-NativeCode selection-filter not properly supported [message #1729372] Wed, 13 April 2016 13:13
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 56
Registered: November 2015

according to the R4.2 OSGi specification chapter 3.9.1 a bundle containing native code can use the "selection-filter" directive in the Bundle-NativeCode header to let the resolver select different native libraries based not only on osgi framework properties but also on system properties:

The below example from the specification shows that two libraries are declared for linux on x86, and that one or the other is selected based on the fact that a custom system property is set to a given value (gtk or qt).

I was trying a similar configuration in Virgo 3.6.4 and this does not work, the Quasi Resolver framework always complains because the native library on linux cannot be resolved since the selection filter does not match:

        A bundle could not be resolved because no match was found for the native code specification. Resolver error data <lib/jep.dll; processor=x86_64; osname=Win32, lib/libjep.dylib; processor=x86_64; osname=MacOSX, lib/python33/; processor=x86_64; osname=Linux; selection-filter="(python=33)">. Caused by missing constraint in bundle <jep_3.4.1.201604121252>
             constraint: <lib/jep.dll; processor=x86_64; osname=Win32, lib/libjep.dylib; processor=x86_64; osname=MacOSX, lib/python33/; processor=x86_64; osname=Linux; selection-filter="(python=33)">

I am sure the problem is due to the selection-filter because replacing it with a negation will make it work.

I had a look at the sources and debugged Virgo 3.6.4 (Equinox 3.Cool up to class NativeCodeSpecificationImpl. The Equinox behaviour is to use the selection-filter and verify whether it checks against some properties as visible in line 66 of NativeCodeSpecificationImpl [1]
The probem is that the properties include only the following:

while no system property is included. Is this a problem in Equinox 3.8 or related to Virgo's use of Equinox 3.8?
I think it's strange that filters are tested against a map of properties that is called "platform properties", see [2].



Previous Topic:Virgo Tutorial
Next Topic:PDE OSGi bundles and Virgo tooling
Goto Forum:

Current Time: Tue May 11 23:46:33 GMT 2021

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

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

Back to the top