Bug 285229 - Export does not consider Bundle-NativeCode filters
Summary: Export does not consider Bundle-NativeCode filters
Status: CLOSED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks: 284784
  Show dependency tree
 
Reported: 2009-07-30 16:12 EDT by Andrew Niefer CLA
Modified: 2019-09-27 16:37 EDT (History)
10 users (show)

See Also:


Attachments
patch (1.44 KB, patch)
2009-07-30 16:37 EDT, Andrew Niefer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2009-07-30 16:12:53 EDT
A Bundle-NativeCode manifest header than contains a selection-filter behaves in a manner similar to Eclipse-PlatformFilter.

When exporting a plugins, PDE/UI removes the Eclipse-PlatformFilter from BundleDescriptions that would not have matched the environment.  This allows exporting plugins that resolve on other platforms.

See PluginExportOperation.shouldAddPlugin, we are explicitly removing the platform filter on the new BundleDescription.  Note we are also implicitly removing Bundle-NativeCode elements by not using the factory method that sets it.

The problem is in the call to super.shouldAddPlugin which checks the platformFilter.  This method does not account for the native header and will return no conflict, when in fact there is one and we end up not removing the native header which will cause the export to fail.

See also bug 284806
Comment 1 Andrew Niefer CLA 2009-07-30 16:20:48 EDT
Note also that during multi-platform product export, we create a feature that contains the plugins and sets appropriate os/ws/arch entries on the feature inclusion.

These os/ws/arch are set according to which configs the plugin's platform filter matches.  By fixing FeatureExportOperation.shouldAddPlugin to account for the native spec during plugin export, we also fix product export to account for it as well.

See FeatureExportOperation.createFeature
Comment 2 Chris Aniszczyk CLA 2009-07-30 16:22:31 EDT
You want this in M1 Andrew?
Comment 3 Andrew Niefer CLA 2009-07-30 16:37:25 EDT
Created attachment 143086 [details]
patch

Here is a patch that uses a utility method that we wrote in pde.build.

The utility class is internal, but you are already a friend.  Or you can just create your own utility.

There are similar changes in pde.build that I am making and will release for M1.  With this I was able to export swt.gtk.linux.x86 using the NativeCode entry similar to the one in bug 284784.

I haven't yet tried exports with metadata, that will probably need additional work in p2.

It would be nice to have in I think, but it wouldn't be a huge problem if this didn't make M1, especially since the p2-enabled exports probably have issues.
Comment 4 Andrew Niefer CLA 2009-07-30 16:42:13 EDT
Chris, there is also a filter check in pde.core/TargetPlatformHelper.matchesCurrentEnvironment
I don't know anything about how that is used.
Comment 5 Darin Wright CLA 2009-09-16 11:39:49 EDT
Removing M2 milestone
Comment 6 Christian Ernst CLA 2009-10-23 07:15:54 EDT
Hi !

I am wondering if this might be also causing following strange effect we see while building an RCP on Solaris10/Sparc.

We have a Bundle Fragment with:
"Bundle-NativeCode: X.so;osname=sunos;processor=sparc"
The Fragment works fine in a minimalistic OSGi Server.
But when we now build our RCP using the PDE 3.5 it fails with:
---------------
[java] [eclipse.buildScript] Some inter-plug-in dependencies have not been satisfied.
[java] [eclipse.buildScript] Bundle com.versant.jvi.solaris.sparc:
[java] [eclipse.buildScript]       Host plug-in Bundle-NativeCode_0.0.0 has not been found.
----------------
When we now change the Fragment definition to: 
"Bundle-NativeCode: X.so;osname=solaris;processor=sparc"
the PDE build works fine but at runtime it can't be resolved anymore.
Only with:
"Bundle-NativeCode: X.so;osname=sunos;osname=solaris;processor=sparc"
it works fine now.

cheers
Christian
Comment 7 Andrew Niefer CLA 2009-10-23 10:32:14 EDT
(In reply to comment #6)
> [java] [eclipse.buildScript] Bundle com.versant.jvi.solaris.sparc:
> [java] [eclipse.buildScript]       Host plug-in Bundle-NativeCode_0.0.0 has not
> been found.

Yes you are hitting this bug.  The nonsense error message is bug 284806.
Comment 8 Stoyan Boshev CLA 2011-03-31 09:13:16 EDT
I am also blocked by this bug. We cannot build bundles with native code for platforms other than the one where PDE is running.
Comment 9 Cyril Jaquier CLA 2011-09-07 10:01:12 EDT
We are using 3.5 to build our product for different platform (Linux and Windows) and architecture (x86 and x86_64) and we are now hitting this bug too. Are there any workarounds?
Comment 10 Eclipse Genie CLA 2019-09-27 16:37:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.