Bug 121569 - [Import/Export] Importing projects in workspace, the default build order is alphabetical instead of by dependency
Summary: [Import/Export] Importing projects in workspace, the default build order is a...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-20 10:49 EST by Wayne Fuller CLA
Modified: 2006-03-27 10:50 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Fuller CLA 2005-12-20 10:49:20 EST
I saw this in 3.2 M3 also.  To duplicate this create two projects "AProject" and "BProject".  Make "AProject" dependent on "BProject", look at the build order "Windows...Preferences...General...Workspace...Build Order" and it will be correct, "BProject" listed first.  Now delete the two projects without deleting the contents.  Import the projects back in and the Build Order is now showing the projects alphabetically.  The current workaround is to move the projects around in the correct order.  From what I remember, this worked in 3.1.

Thanks,
Wayne Fuller
Comment 1 Karice McIntyre CLA 2006-01-05 14:46:51 EST
This case doesn't work for me in 3.1, as well as 3.2.  
I think this is a JDT problem because ProjectDescription.setDynamicReferences() is not being called in this particular case.  If you were to import the projects into a new workspace you will find that the build order is correct.
Comment 2 Yves Canty CLA 2006-02-22 22:24:51 EST
We get similar behavior with 3.1.2.  Our software is composed of about 15 projects. We recently removed all circular dependencies between the projects. When I got the latest changes in my stream (clearcase), I just refreshed all the projects in my workspace. The workspace's default build order was NOT reset to the most optimal compilation order.  In fact, I'm pretty sure it didn't even change after the refresh. I then tried deleting all the projects and reimporting them in the workspace.  This time, the default workspace build order changed, but to a strange order, not purely alphabetical, and still far from being optimal.  I then manually reordered the projects and got a 2x speed increase for a full rebuild, which seemed to finally be done in one pass.

I will try the suggested workaround of importing the projects in a brand new workspace. But I'd like to see this bug fixed, as it is very unintuitive behavior.

The default build order should be recalculated automatically whenever the project dependencies change, whatever the means (through a project refresh, a project delete/import, or by changing project properties.  Any others?).
Comment 3 Yves Canty CLA 2006-02-23 09:35:38 EST
I have just tried importing the projects in a brand new workspace.  The default build order is definitely better, but our manual build order is even more optimized. It took 2 minutes to do a full build of our projects when imported in a fresh workspace, and just 1 minute when using our manual build order!

It seems the algorithm for computing the default build order needs work, even when importing in a new workspace.
Comment 4 Jerome Lanneluc CLA 2006-03-13 04:37:08 EST
Changed DeltaProcessor#checkProjectsBeingAddedOrRemoved(...) to update the project references if a project is added/opened.

Added regression test JavaProjectTests#testProjectImport
Comment 5 Frederic Fusier CLA 2006-03-27 03:53:29 EST
Reopen to assign
Comment 6 Frederic Fusier CLA 2006-03-27 03:54:19 EST
Still fixed.
Comment 7 Maxime Daniel CLA 2006-03-27 10:50:52 EST
Verified for 3.2M6 using build I20060327-0010.