Bug 61602 - ant.ui AntUtil not compiling in HEAD
Summary: ant.ui AntUtil not compiling in HEAD
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 blocker (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 61604 (view as bug list)
Depends on: 61325
Blocks:
  Show dependency tree
 
Reported: 2004-05-10 11:26 EDT by Jim des Rivieres CLA
Modified: 2004-05-10 23:00 EDT (History)
4 users (show)

See Also:


Attachments
project containing plugin that exhibits this problem (4.88 KB, application/octet-stream)
2004-05-10 15:17 EDT, John Wiegand CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim des Rivieres CLA 2004-05-10 11:26:05 EDT
Build N20040510

In my full source workspace the ant.ui plug-in has compile errors. The 
complaint is against AntUtil: "The type 
org.eclipse.core.boot.IPlatformRunnable cannot be resolved. It is indirectly 
referenced from required .class files." As a result, the ant.ui project is not 
built, and this means that pde.ui does not build either.

The ant.ui plug-in does not depend on org.eclipse.core.runtime.compatibility
(and hasn't for about 1 week). However, the .project file still has left over 
static project references, which should be cleaned out:

		<project>org.apache.ant</project>
		<project>org.eclipse.ant.core</project>
		<project>org.eclipse.core.resources</project>
		<project>org.eclipse.core.runtime.compatibility</project>
		<project>org.eclipse.core.variables</project>
		<project>org.eclipse.debug.core</project>
		<project>org.eclipse.debug.ui</project>
		<project>org.eclipse.jdt.debug.ui</project>
		<project>org.eclipse.jdt.launching</project>
		<project>org.eclipse.jdt.ui</project>
		<project>org.eclipse.jface.text</project>
		<project>org.eclipse.ui</project>
		<project>org.eclipse.ui.console</project>
		<project>org.eclipse.ui.editors</project>
		<project>org.eclipse.ui.externaltools</project>
		<project>org.eclipse.ui.ide</project>
		<project>org.eclipse.ui.views</project>
		<project>org.eclipse.ui.workbench.texteditor</project>

I removed these ion my ws, but the problem remains.
Comment 1 Darin Swanson CLA 2004-05-10 11:44:48 EDT
*** Bug 61604 has been marked as a duplicate of this bug. ***
Comment 2 Darin Swanson CLA 2004-05-10 11:47:55 EDT
Can someone please help me out in the correct means of cleaning up 
our .project files? 
The support I have tried does not do what I would have expected. Thanks.
Comment 3 Jim des Rivieres CLA 2004-05-10 12:08:19 EDT
To remove them manualy, switch to resource view, open .project file, and 
delete the <project>...</project> lines.
Comment 4 Darin Swanson CLA 2004-05-10 13:38:25 EDT
I have made a pass of all our .project files and removed our static project 
refs.
Changes to:
org.eclipse.ant.core
org.eclipse.ant.tests.core
org.eclipse.ant.tests.ui
org.eclipse.ant.ui
org.eclipse.core.variables
org.eclipse.debug.core
org.eclipse.debug.ui
org.eclipse.jdt.debug
org.eclipse.jdt.debug.jdi.tests
org.eclipse.jdt.debug.tests
org.eclipse.jdt.debug.ui
org.eclipse.jdt.launching
org.eclipse.jdt.launching.j9
org.eclipse.ui.console
org.eclipse.ui.externaltools
Comment 5 Darin Swanson CLA 2004-05-10 13:38:44 EDT
Please verify DarinW.
Comment 6 John Wiegand CLA 2004-05-10 14:23:34 EDT
The "real" problem here may be related to bug 60910.  The ant.ui plugin has an 
empty plug-in dependency collection.  This causes the compilation failures.
Once the .project references are cleaned up, we should move this to PDE.
Comment 7 Jim des Rivieres CLA 2004-05-10 14:38:09 EDT
I'm pretty sure it's not related to problems with the PDE classpath container. 
Deleting the extra <project> elements does not fix the problem.
Comment 8 Darin Swanson CLA 2004-05-10 14:48:43 EDT
Moving to PDE to investigate the errors.
Comment 9 John Wiegand CLA 2004-05-10 15:16:44 EDT
1. the build order appears to be fine (the extra .project references are 
noise - they should be cleaned up, but they don't make for bad classpaths).

2. The problem is related to the fact that ant.ui doesn't require the 
compatability layer, but it depends on ant.core (which does).  Therefore there 
is an indirect reference to the compatability layer that is not ending up in 
the classpath.

I can recreate this problem with a trivial plugin (attachment follows - 
myplugin.zip)
Comment 10 John Wiegand CLA 2004-05-10 15:17:48 EDT
Created attachment 10464 [details]
project containing plugin that exhibits this problem
Comment 11 Wassim Melhem CLA 2004-05-10 15:19:09 EDT
Not sure it's a PDE issue.

ant.ui does not have a dependency on core.runtime.compatibility, so PDE does 
not put org.eclipse.internal.core.boot.IPlatformRunnable on its classpath.  
All good from a PDE classpath point of view.

The JDT/Compiler complains that this particular class is indirectly referenced 
by AntUI.  Since the classpath computed by PDE is correct, this means one of 
three things:
1. A false error flagged by the compiler.
2. Ant/UI dependencies need to be reexamined. That is, it is possible that it 
is enough to just drop core.runtime.compatibility and pick up core.runtime.  
Some classes that used to be visible to ant.ui are no longer visible through 
core.runtime.
3. The "Provide-Package" of core.runtime might want to "provide" more 
packages, if they want clients of core.runtime.compatibility to transition to 
core.runtime smoothly.  
Comment 12 Wassim Melhem CLA 2004-05-10 15:22:11 EDT
Most likely it's explanation 2.  Darins, please look at your plugin's 
dependencies and make sure ant.ui's code is not referencing any code it has 
not explicitly depend on.

ant.core could reexport core.runtime.compatibility, but this would not be 
recommended as it would be abusing the "reexported dependency" notion.

Drop the dependency of ant.core on runtime.compatibility and see what happens.
Comment 13 Jim des Rivieres CLA 2004-05-10 15:28:29 EDT
AntUtil is flagged as having a fatal problem. If you comment out the method 
bodies of all AntUtil methods and rebuild, the problem shifts to 
AntLaunchDelegate. If you comment out the method bodies of all 
AntLaunchDelegate methods, the ant.ui project compiles without errors.

The problem is with methods that reference AntRunner.

Potentially relevant: org.eclipse.ant.core.AntRunner is declared in 2 places:
(1) org.eclipse.ant.core/src
(2) org.eclipse.core.resource/lib/antsupport.jar
ant.ui requires both org.eclipse.ant.core and org.eclipse.core.resource
Comment 14 Wassim Melhem CLA 2004-05-10 15:34:40 EDT
Note that the jdt/compiler resolves all types referenced by an ant/ui class 
and all those types referenced by ant.core.  So when compiling AntUtil, it 
tries to resolve AntCorePreferences.  it then goes to AntCorePreferences finds 
IPlatformRunnable.  It tries to resolve it, but it fails because it's not on 
ant.ui's classpath.
Comment 15 John Wiegand CLA 2004-05-10 17:38:03 EDT
Ok: more info.  ant.core needs to keep the dependency on the compatability 
layer - we are not going to rewrite it entirely.  However, we should change 
AntRunner (the API class) to eliminate the compatability reference in its API.

This issue was exposed by the change to address bug 61097.  The consequence is 
that the development time dependencies do not match the runtime dependencies 
(they are a subset).  This helps plug-in writers not get distracted with 
implementation details, but requires implementation details to appear in the 
plugin.xml (if there is an implementation extension in the API class - 
creating an API class that subclasses an implementation class for example).  
Comment 16 Jim des Rivieres CLA 2004-05-10 18:02:41 EDT
Changing AntRunner to implement o.e.core.runtime.IPlatformRunnable (instead of 
o.e.core.boot.IPlatformRunnable) does indeed fix the problem in my full source 
ws.
Comment 17 Darin Swanson CLA 2004-05-10 18:13:59 EDT
I have released the changes to AntRunner.
Comment 18 Darin Swanson CLA 2004-05-10 18:49:39 EDT
Thanks for all the help.

Please verify DarinW.
Comment 19 Darin Wright CLA 2004-05-10 23:00:14 EDT
Verified.