Community
Participate
Working Groups
Currently Bundle-NativeCode is processed at install time and a bundle fails to install if a valid native-code match is not found. We should consider moving this processing to resolve-time and cause bundles that do not have matching native-code to be unresolved. We did a similar change to Bundle-RequiredExecutionEnvironment. This will help us adopt the Bundle-NativeCode header instead of using the Equinox specific native code lookup. We should probably not do native code processing if the resolver mode is "development" for PDE. CC'ing Wassim incase this change has effects PDE (I anticipate that it will not)
I opened an OSGi bug to consider changing this in the OSGi spec. https://www2.osgi.org/members/bugzilla/show_bug.cgi?id=521
Once this bug is fixed we should start to migrate eclipse over to use the Bundle-NativeCode header. We will need the PDE bug 201273 to make this easier.
Created attachment 77320 [details] work in progress I started this work. Here is a snapshot of the changes required to do this. This patch modifies the State API to allow for native code specifications to be associated with BundleDescriptions and it processes and resolves them in the ResolverImpl. Still lots of work around removing the old checks performed at install time.
One thing about the Bundle-NativeCode header is that it forces you to list the native code paths that you want to use. This will likely upset folks like SWT that change the name of their library each and every time they recompile their natives. I'm not sure why they do that but if they want to move to Bundle-NativeCode then they will have to update their bundle manifest with the new library name each time they have a new library.
Created attachment 77419 [details] function complete Here is a function complete patch. I removed the all the code from the Framework class which did the install-time verification of EE and native code. It is now done after we have added the bundle to the State so that we can use the State API to perform the install-time checks required from the R4 specification. If eclipse.ee.install.verify=false which it is by default, then the install-time checks are not done. With this patch now any Eclipse bundle with native code can use the Bundle-NativeCode header instead of the Eclipse-PlatformFilter header. For example this is the Bundle-NativeCode header which can be used for the swt win32 fragment Bundle-NativeCode: swt-awt-win32-3408.dll; swt-gdip-win32-3408.dll; swt-wgl-win32-3408.dll; swt-win32-3408.dll; swt-xpcominit-win32-3408.dll; swt-xulrunner-win32-3408.dll; selection-filter="(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))" A bit more commenting and javadoc work needs to be done before releasing this patch.
Created attachment 77745 [details] test complete This patch contains several bug fixes that were present in the previous patch. It also has complete javadoc for all the newly added methods/classes in the State/Resolver API. Several new native code tests are added to the automated tests. This patch also passes the OSGi R4.1 testsuite when eclipse.ee.install.verify=true to perform the install time native code and EE checks. By default this config property is set to false.
Patch released for 3.4 M2. This is probably worth a new and noteworthy entry.
Created attachment 77981 [details] fix for Mac and Linux os versions The org.osgi.framework.processor should be set to the primary alias as defined by OSGi. The org.osgi.framework.os.version needs to be verified for a correct version number and munged into a good version number if it cannot be parsed into an OSGi Version. These issues were causing the automated testcases to fail on Linux and Mac.