Bug 23683 - Build cycle treatment improvement
Summary: Build cycle treatment improvement
Status: RESOLVED DUPLICATE of bug 10262
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0.1   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-18 03:57 EDT by Andreas Krüger CLA
Modified: 2002-09-18 10:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Krüger CLA 2002-09-18 03:57:24 EDT
Projects in the real world don't always come in nice "sorted levels".
Often, what's in project A and what's in project B depends on code ownership
issues or other weird things.

I presently own projects A and B, and there is another project P
owned by other people.  B depends on A; so far, so good.
As far as P is concerned, the situation unfortunately is a mess:
P depends on B, but I also need P to compile B.

So I'm locked in a build cycle.

Just to mention one more thing, I do want to autobuild B whenever I change A.

What I end up doing: I have an ant script that builds a jar from A and B.
I build that jar occasionally (my outer interface doesn't change all that
often). I have P depend on that jar.

When I fire up the main program, which is in P, I need to do tricks
with the CLASSPATH at run time, so that I actually get
the current version of A and B, as opposed to the stuff from the jar.

It's a workable approach in my situation.  But I feel that I'm playing games
I shouldn't have to play, and that eclipse's support of build cycles
among projects leaves to be desired.

My suggestion:

What would really help me is a new kind of "weak" project dependency
that does not fire autobuild and is not taken into account in cycle
detection.

So I would have P weakly depend on A and B.

Weak dependency should be easy for you to do.  Here are the details:


P will not autobuild when A or B change.

When I rebuild P manually, or when P is autorebuild because of
another project dependency, this will not cause A or B to be rebuild
prior to P's build. P's build will grab out of A and B whatever
happens to be there at the time of the P's build.

Of course, in my case, B depends on P, so B will be autorebuild afterwards,
but that's a different story.

Likewise, whenever I run a program out of P, it will find in its CLASSPATH
whatever happens to be in A or B at that moment (unless I configure otherwise).
Comment 1 Philipe Mulet CLA 2002-09-18 06:34:26 EDT
Your claim is fully legite. The Eclipse current build infrastructure doesn't 
support cycles, but this is going to change (see 2.1 plans). The responsibility 
lies in Platform/Core which owns the build manager, and provide a couple 
adjustments for this.

The weak dependency approach goes in the same direction as a change we 
implemented in last integration build (2.1 branch). In the Java>Compiler>Other 
preferences, you can decide the severity of each kind of classpath problem. 
Cycles can be downgraded to "warning", which would let the build run smoothly. 
However, this still only build each project in the cycle once.

Platform should still allow to further build projects in a cycle incrementally 
until no more change is performed (with some limit in the number of iterations, 
in case of misbehaving builder implementations). By doing this, only one build 
action (when autobuild is off) would be necessary to correctly build a cycle.

Moving to Platform/Core for further comments. I think JDT/Core already does the 
right thing (with latest changes).
Comment 2 Philipe Mulet CLA 2002-09-18 06:35:22 EDT
Forgot to mention that the JDT/Core cycle change is also going to be backported 
into a 2.0.2 update.
Comment 3 John Arthorne CLA 2002-09-18 10:35:39 EDT

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