| Summary: | org/eclipse/core/runtime/IPluginDescriptor is missing in runtime_registry_compatibility.jar | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Andrey Loskutov <loskutov> | ||||
| Component: | Runtime | Assignee: | John Arthorne <john.arthorne> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | andrea.ross, igor, john.arthorne, krzysztof.daniel, Lars.Vogel, pwebster, thanh.ha | ||||
| Version: | 1.0 | ||||||
| Target Milestone: | 4.3 M5 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 385966 | ||||||
| Bug Blocks: | 372792 | ||||||
| Attachments: |
|
||||||
|
Description
Andrey Loskutov
I believe that the IPluginDescriptor.class is kept compiled in the project org.eclipse.core.runtime.compatibility.registry_3.5.100.x.: ./eclipse.platform.runtime/bundles/org.eclipse.core.runtime.compatibility.registry/classes/org/eclipse/core/runtime/IPluginDescriptor.class. It is required only at build time. (In reply to comment #1) > It is required only at build time. Even not. This class is required at run time, otherwise few plugins will have problems described here: http://dev.eclipse.org/mhonarc/lists/cbi-dev/msg00493.html. Paul, do you know where this comes from? org/eclipse/core/runtime/IPluginDescriptor is in org.eclipse.core.runtime in the source. In org.eclipse.core.runtime.compatibility.registry it's in a classes subfolder, and it looks like customBuildCallbacks.xml adds those classes. PW John might be able to shed some light on what's supposed to be going on. PW I can see from the history the custome callback was added in bug 329277. I believe the reason here is that the stuff in the classes folder was compiled against the old pre-Eclipse 3.0 API which was later refactored. This needs to be folded into the compatibility.registry bundle to enable the old Eclipse 2.x API to function. I am somewhat surprised that the error surfaces when running the Eclipse SDK, because it implies we still have dependencies on this 2.x-3.0 compatibility layer. Or did you install additional bundles Andrey? (In reply to comment #6) > I am somewhat surprised that the error surfaces when running the Eclipse SDK, > because it implies we still have dependencies on this 2.x-3.0 compatibility > layer. Or did you install additional bundles Andrey? For sure :-) It was Clearcase plugin from IBM :-) That explains it! So what we need to know is the Tycho way to include both the content from src and the content from classes folder in the final jar. Well, as somebody commented on one of the bugs I reported against PDE many years ago, "nested jars are evil" (https://bugs.eclipse.org/bugs/show_bug.cgi?id=111238#c11), so to discourage their use Tycho makes nested jars little extra hard to produce :-) Seriously, though, to include IPluginDescriptor.class in runtime_registry_compatibility.jar, add the following snippet to org.eclipse.core.runtime.compatibility.registry/pom.xml. It tells Maven to copy all files from classes/ folder to target/classes directory, which happens to be what is included in runtime_registry_compatibility.jar. Kinda hackish, but works. <build> <resources> <resource> <directory>classes</directory> </resource> </resources> </build> (In reply to comment #9) Is it possible to get IPluginDescriptor from the org.eclipse.core.runtime bundle in any other way than using maven-ant-runner ? I am not sure what you mean. IPluginDescriptor.class file is part of org.eclipse.core.runtime.compatibility.registry project source tree. It needs to be included in runtime_registry_compatibility.jar and the pom.xml snippet I showed in comment #9 does that without ant. Where else do you need to "get" the class to? Not "to". "from". I can't use *.class in Fedora, so I need to get it from the project where it is really compiled... I am not sure it is possible to compile IPluginDescriptor as part of the current Eclipse source tree, but I would let somebody from Eclipse Platform team comment on this. Created attachment 220197 [details]
Patch
This is a copy of the patch that I'm using to get the IPluginDescriptor into right location.
The IPluginDescriptor class file in the source tree was compiled against an older version of the Eclipse platform API, so it would be difficult (and unnecessary) to compile this in the CBI build. How did the old Fedora build handle this? (In reply to comment #15) In the same way. Copied a class file. But I see now it was wrong - since it should be an older version. I need to find a better solution for that. I have tried to use the approach described in comment 9 but it does not work for me - the class file is not copied. Thanh, Andrew, I think a fix for this issue should go into CBI 1.0 :-), so may I ask for double verification of the proposed solution (I mean - I have somewhat modified build environment and I may be doing somethign wrong...). (In reply to comment #17) > I have tried to use the approach described in comment 9 but it does not work > for me - the class file is not copied. > > Thanh, Andrew, > I think a fix for this issue should go into CBI 1.0 :-), so may I ask for > double verification of the proposed solution (I mean - I have somewhat > modified build environment and I may be doing somethign wrong...). Hi Krzysztof, I tried Igor's suggestion from comment 9 and it seems to have copied over the IPluginDescriptor.class file to target/classes for me. $ ls target/classes/org/eclipse/core/runtime/IPluginDescriptor.class target/classes/org/eclipse/core/runtime/IPluginDescriptor.class I also noticed in my log when the maven-resources-plugin is run I get the following output: [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ org.eclipse.core.runtime.compatibility.registry --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 1 resource I'm assuming the 1 resource is the IPluginDescriptor.class. Is there any additional patches I should apply to run to reproduce your issue? (I did not apply the patch that's attached to this bug, should I?) Thanks, Thanh! If this works for you, then there is a bug in my environment and I need to fix it by myself. It's ok to apply just Igor suggestion from comment 9. master: http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=f051f1bd355bc6e186b0a8d1bbf37888d157b5f7 R4_2_maintenance: http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?h=R4_2_maintenance&id=9ce2e2da476d8b13914da5c1fa1d6824e78b6583 (In reply to comment #20) > master: > > http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/ > ?id=f051f1bd355bc6e186b0a8d1bbf37888d157b5f7 > > R4_2_maintenance: > > http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/ > ?h=R4_2_maintenance&id=9ce2e2da476d8b13914da5c1fa1d6824e78b6583 I can confirm that this file IPluginDescriptor.class is now included in the runtime_registry_compatibility.jar that is produced in the CBI build. Archive: runtime_registry_compatibility.jar creating: org/ creating: org/eclipse/ creating: org/eclipse/core/ creating: org/eclipse/core/internal/ creating: org/eclipse/core/internal/registry/ creating: org/eclipse/core/runtime/ inflating: org/eclipse/core/internal/registry/RegistryCompatibilityHelper.class inflating: org/eclipse/core/internal/registry/ExtensionHandle.class inflating: org/eclipse/core/internal/registry/ExtensionPointHandle.class inflating: org/eclipse/core/internal/registry/BundleHelper.class inflating: org/eclipse/core/runtime/IExtension.class inflating: org/eclipse/core/runtime/IPluginDescriptor.class inflating: org/eclipse/core/runtime/IExtensionPoint.class Thanks Thanh. Marking fixed. |