Bug 305732 - Wrong build order impacts badly API tooling features
Summary: Wrong build order impacts badly API tooling features
Status: RESOLVED DUPLICATE of bug 532264
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
: 303214 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-12 15:00 EST by Olivier Thomann CLA
Modified: 2018-09-17 01:07 EDT (History)
11 users (show)

See Also:


Attachments
Fix typo (1005 bytes, patch)
2010-03-12 15:32 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2010-03-12 15:00:46 EST
Fup of bug 303214.
Load the projects from the project team set attached to bug 303214 comment 1.

You can see that org.eclipse.ui.editors is specified after org.eclipse.ltk.ui.refactoring in the build order.

org.eclipse.ltk.ui.refactoring has org.eclipse.compare as a dependent and org.eclipse.compare has org.eclipse.ui.editors as a dependent. So I would expect org.eclipse.ui.editors to be built before org.eclipse.ltk.ui.refactoring.

API Tooling has a bug because it tries to load a .class file from a dependent and with the actual build order the .class file doesn't exist yet. The only workaround is to manually change the build order.
Comment 1 Olivier Thomann CLA 2010-03-12 15:01:40 EST
You can see that if you add org.eclipse.compare into the workspace, suddenly the build order is right between org.eclipse.ui.editors and org.eclipse.ltk.ui.refactoring.
Comment 2 DJ Houghton CLA 2010-03-12 15:21:11 EST
From Olivier's description, in general terms he is saying:

- A depends on B which depends on C.
- A and C are in your workspace, B is a binary in your target
- when we calculate the order of project dependencies we only take into account the ones in the workspace
- so A and C are built in the wrong order
Comment 3 Olivier Thomann CLA 2010-03-12 15:32:19 EST
Created attachment 161928 [details]
Fix typo
Comment 4 Dani Megert CLA 2010-03-15 10:23:10 EDT
Olivier, I wonder how JDT Core was able to compile the stuff then in the first place?
Comment 5 John Arthorne CLA 2010-03-15 14:58:45 EDT
If org.eclipse.ltk.ui.refactoring and org.eclipse.ui.editors actually have no direct dependency on each other, I suspect from the Java compiler's point of view it doesn't matter what order they are compiled in?
Comment 6 Dani Megert CLA 2010-03-16 04:04:44 EDT
>If org.eclipse.ltk.ui.refactoring and org.eclipse.ui.editors actually have no
>direct dependency on each other, I suspect from the Java compiler's point of
>view it doesn't matter what order they are compiled in?
Right,I didn't check that there's no direct dependency. So, the question for the builder is how the default build order is defined: is it only using direct dependencies or should it also take indirect dependencies into account. I guess so far the former is the case and changing that could potential lead to more being built.
Comment 7 Pawel Pogorzelski CLA 2010-03-31 11:04:33 EDT
Build order is calculated based on projects references. If indirect dependencies should be taken into consideration method IProjectDescription.setDynamicReferences(IProject[]) should be called.

Removing the target as there will probably no changes on the Resources side.
Comment 8 Dani Megert CLA 2010-03-31 11:35:58 EDT
>If indirect
>dependencies should be taken into consideration method
>IProjectDescription.setDynamicReferences(IProject[]) should be called.
PDE would probably have to do that.
Comment 9 Szymon Brandys CLA 2010-03-31 11:53:41 EDT
(In reply to comment #8)
> PDE would probably have to do that.
This is what I think too.
Comment 10 Darin Wright CLA 2010-05-07 16:58:29 EDT
*** Bug 303214 has been marked as a duplicate of this bug. ***
Comment 11 Curtis Windatt CLA 2011-05-04 10:57:31 EDT
We are crunched for time and this feels like a risky change to be putting in during an RC build.  Moving to 3.8
Comment 12 James Fry CLA 2012-01-26 09:15:58 EST
I'm pretty sure we are getting bitten by this problem too (or at least, something similar). We are developing a fairly large RCP application, often have to work with a large workspace (the entire project is around 580 workspace plugins, and a similar number of plugins in the target platform). Eclipse appears to get the build order completely wrong for plugins.

If we create a new plugin, with the default two dependencies, and then change the dependencies in any way (say remove one), Eclipse seems to start a build of our entire workspace which takes a considerable amount of time. This is despite the fact that no plugins depend on the new plugin yet, so it shouldn't have to rebuild everything.

We attempted to debug this a few months ago with a workspace with just three plugins in, and got completely confused as to how the order was determined for PDE (pretty much any change to a manifest file resulted in a complete rebuild of the workspace). If we used just plain Java projects with project level dependencies, Eclipse built the right things and in the right order.

Is this behaviour expected, or is it related to this bug?
Comment 13 Vikas Chandra CLA 2018-09-17 01:07:34 EDT

*** This bug has been marked as a duplicate of bug 532264 ***