Bug 60367 - dynamic project references not maintained
Summary: dynamic project references not maintained
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 critical (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-29 01:06 EDT by John Wiegand CLA
Modified: 2004-05-18 15:09 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Wiegand CLA 2004-04-29 01:06:00 EDT
I20040428

new workspace/autobuild off
1. Create a plugin project A
2. Create a plugin project B
3. Go to preferences -> build order.
you will see A before B (either order is possible - you must edit B's 
plugin.xml if B is before A)
4. Go to A's plugin.xml
5. Add a dependency on B. (make sure you save the file)
6. Go to preferences -> build order
you will see A before B (still).  B should now be prior to A.

On build you will get an error on A: The project cannot be built until its 
prerequisite B is rebuilt...

This error should not occur; the build order should be B then A.

bug 57181 depends on this one.
Comment 1 John Wiegand CLA 2004-04-29 01:07:57 EDT
I put a breakpoint on setDynamicReferences; the breakpoint is not being hit.
Comment 2 Wassim Melhem CLA 2004-04-29 01:17:44 EDT
As per the resolution of bug 46668, the behavior that you saw at step 6 is 
expected, because JDT/Core now dynamically recommends a build order for the 
platform.  It is no longer stored in the .project file.

PDE has no control whatsoever over the build order.
Comment 3 Philipe Mulet CLA 2004-04-29 06:37:18 EDT
I suspect this results from the fact that we get notified of the classpath 
change (through container update) in a stage where we cannot modify resources 
(POST_CHANGE). Will adopt and investigate.
Comment 4 Philipe Mulet CLA 2004-04-29 07:36:10 EDT
Indeed, the trace points at us not updating the project references.

Thread[main,6,main] CPContainer SET  - setting container
Thread[main,6,main] 	container path: org.eclipse.pde.core.requiredPlugins
Thread[main,6,main] 	projects: {A}
Thread[main,6,main] 	values: {
Thread[main,6,main] 		Plug-in Dependencies {
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.ui_3.0.0/ui.jar[CPE_LIBRARY]
[K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.ui_3.0.0/uisrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.swt.win32_3.0.0/ws/win32/swt.
jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source.win32.win
32.x86_3.0.0/src/org.eclipse.swt.win32_3.0.0/ws/win32/swtsrc.zip]
[isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.jface_3.0.0/jface.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.jface_3.0.0/jfacesrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.ui.workbench_3.0.0/workbench.
jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.ui.workbench_3.0.0/workbenchsrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.core.runtime.compatibility_3.
0.0/compatibility.jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.core.runtime.compatibility_3.0.0/compatibilitysrc.zip]
[isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.core.runtime_3.0.0/runtime.ja
r[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.core.runtime_3.0.0/runtimesrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/osgi.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/osgisrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/core.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/coresrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/resolver.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/resolversrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/defaultAdaptor.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/defaultAdaptorsrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/eclipseAdaptor.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/eclipseAdaptorsrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/console.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/consolesrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi.services_3.0.0/services.
jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi.services_3.0.0/servicessrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.update.configurator_3.0.0/con
figurator.jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.update.configurator_3.0.0/configuratorsrc.zip][isExported:true]
Thread[main,6,main]  			/B[CPE_PROJECT][K_SOURCE]
[isExported:false]
Thread[main,6,main]  		}
Thread[main,6,main] 	}
Thread[main,6,main] CPContainer SET  - updating affected project due to setting 
container
Thread[main,6,main] 	project: A
Thread[main,6,main] 	container path: org.eclipse.pde.core.requiredPlugins
(Thread[main,6,main]) [JavaModelOperation.removeAllPostAction(String)] Removing 
actions /A
--------------------------------------------------------------------------------
---------------------------------------
FIRING POST_CHANGE Delta [Thread[main,6,main]]:
Java Model[*]: {CHILDREN}
	A[*]: {CHILDREN}
		D:/jdk1.4.2/jre/lib/rt.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/sunrsasign.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/jsse.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/jce.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/charsets.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/ext/dnsns.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/ext/ldapsec.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/ext/localedata.jar[*]: {REORDERED}
		D:/jdk1.4.2/jre/lib/ext/sunjce_provider.jar[*]: {REORDERED}
FIRING POST_RECONCILE Delta [Thread[main,6,main]]:
<NONE>
Thread[main,6,main] CPContainer SET  - setting container
Thread[main,6,main] 	container path: org.eclipse.pde.core.requiredPlugins
Thread[main,6,main] 	projects: {A}
Thread[main,6,main] 	values: {
Thread[main,6,main] 		Plug-in Dependencies {
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.ui_3.0.0/ui.jar[CPE_LIBRARY]
[K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.ui_3.0.0/uisrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.swt.win32_3.0.0/ws/win32/swt.
jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source.win32.win
32.x86_3.0.0/src/org.eclipse.swt.win32_3.0.0/ws/win32/swtsrc.zip]
[isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.jface_3.0.0/jface.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.jface_3.0.0/jfacesrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.ui.workbench_3.0.0/workbench.
jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.ui.workbench_3.0.0/workbenchsrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.core.runtime.compatibility_3.
0.0/compatibility.jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.core.runtime.compatibility_3.0.0/compatibilitysrc.zip]
[isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.core.runtime_3.0.0/runtime.ja
r[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.core.runtime_3.0.0/runtimesrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/osgi.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/osgisrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/core.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/coresrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/resolver.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/resolversrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/defaultAdaptor.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/defaultAdaptorsrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/eclipseAdaptor.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/eclipseAdaptorsrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi_3.0.0/console.jar
[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi_3.0.0/consolesrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.osgi.services_3.0.0/services.
jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.osgi.services_3.0.0/servicessrc.zip][isExported:true]
Thread[main,6,main]  		
	D:/eclipse/sdk/eclipse/plugins/org.eclipse.update.configurator_3.0.0/con
figurator.jar[CPE_LIBRARY][K_BINARY]
[sourcePath:D:/eclipse/sdk/eclipse/plugins/org.eclipse.platform.source_3.0.0/src
/org.eclipse.update.configurator_3.0.0/configuratorsrc.zip][isExported:true]
Thread[main,6,main]  			/B[CPE_PROJECT][K_SOURCE]
[isExported:false]
Thread[main,6,main]  		}
Thread[main,6,main] 	}
Thread[main,6,main] CPContainer SET  - updating affected project due to setting 
container
Thread[main,6,main] 	project: A
Thread[main,6,main] 	container path: org.eclipse.pde.core.requiredPlugins
--------------------------------------------------------------------------------
---------------------------------------
FIRING POST_CHANGE Delta [Thread[main,6,main]]:
Java Model[*]: {CHILDREN}
	A[*]: {CONTENT}
		ResourceDelta(/A/plugin.xml)[*]
FIRING POST_RECONCILE Delta [Thread[main,6,main]]:
<NONE>

Starting build of A @ Thu Apr 29 13:20:55 CEST 2004
Binary classpath directory /B/bin != Classpath jar file 
D:/jdk1.4.2/jre/lib/rt.jar
Clearing last state : State for A (#0 @ Thu Apr 29 13:19:21 CEST 2004)
FULL build
About to compile src/A/APlugin.java
Writing new class file APlugin.class
Recording new state : State for A (#0 @ Thu Apr 29 13:20:55 CEST 2004)
Finished build of A @ Thu Apr 29 13:20:55 CEST 2004
--------------------------------------------------------------------------------
---------------------------------------
FIRING POST_CHANGE Delta [Thread[Worker-3,5,main]]:
<NONE>
FIRING POST_RECONCILE Delta [Thread[Worker-3,5,main]]:
<NONE>




However, basically we have to honour a resource change at a time the platform 
doesn't expect us to do any... and still notify our clients as if it had been 
performed (reflect classpath change). 
Comment 5 Philipe Mulet CLA 2004-04-29 12:54:19 EDT
Added support to defer updating project references until next PRE_AUTO_BUILD 
notification; even if we get the request during a POST_CHANGE notification 
where we cannot honour it instantaneously.

Fixed
Comment 6 John Wiegand CLA 2004-04-29 15:05:31 EDT
With Philippe's patch, the simple test passes, but the more complex cases 
still do not.

So I patched workspace.build to do broadcastChanges(PRE_AUTO_BUILD, false).  
This handled the complex cases I tested.  Is this the missing ingredient? (or 
at least part of the solution - clearly there is more work than just the 1 
line change to handle all build conditions, and we know there are other issues 
outstanding)
Comment 7 Philipe Mulet CLA 2004-04-29 16:01:05 EDT
John, could you provide me with the more complex testcase ? It may require 
more 'deferred' support from our end. Is it only a build order issue in the 
end ?
Comment 8 John Arthorne CLA 2004-04-29 19:51:42 EDT
re: comment #6 - note that it was never true (since 1.0) that PRE_AUTO_BUILD
events occurred prior to manual build. While I agree it would make build
pre-processing simpler to do this, we should be cautious about changing the
order of resource change events.
Comment 9 John Arthorne CLA 2004-04-30 11:24:20 EDT
Thinking about this some more, it now feels like I need to be giving
PRE_AUTO_BUILD notifications prior to manual build.  If I don't, there is no
opportunity at all for JDT to initialize project references in the case where
project creations are immediately followed by a manual build. In the past,
project reference information was typically available at project creation time.
Now, with dynamic build paths, the project references are not known in advance,
and there is no opportunity for them to be properly initialized before a manual
build. Is this the missing piece that is needed here?  How else could JDT
correctly set up the project references prior to build in this scenario:

1) Project P1 is created
2) Maybe a POST_CHANGE event occurs, maybe not
3) Project P2 is created
4) Maybe a POST_CHANGE event occurs, maybe not
5) Manual workspace build initiated
6) Manual build completes
7) PRE_AUTO_BUILD event
8) POST_AUTO_BUILD event

?
Comment 10 John Wiegand CLA 2004-04-30 12:59:41 EDT
agree with your assessment of the current situation (there is no way for 
dynamic references to be correctly handled).

My initial exploration of the pre-autobuild notification was positive, but I 
didn't think through the details for what this means for builds with scope 
less than workspace.
Comment 11 John Arthorne CLA 2004-04-30 19:09:54 EDT
I have widened PRE_AUTO_BUILD and POST_AUTO_BUILD to also run before/after a
manual incremental workspace build. The single project build case is still not
handled - this would require sending events before and after each project build
(since there is no API in core for building an array of projects).

I will reopen this bug until we get the complex cases working.
Comment 12 Philipe Mulet CLA 2004-05-01 07:21:22 EDT
The manual build scenario is definitely troublesome. This is the aurora tool 
scenario. However, the scenario depicted in this bug is based on standard 
resource change and notifications, which had a hole in case the interesting CP 
update was triggered during a POST_CHANGE event (we didn't honour it).

The alternate problem is bug 57181 for which something more need to be done. I 
will close this one, and add comments to bug 57181.

Comment 13 Olivier Thomann CLA 2004-05-18 15:09:08 EDT
Verified in 200405180816