You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Chad Loder <cl...@acm.org> on 2002/05/02 01:27:38 UTC
Possible bug with , and depends
Hello. Sorry if this is the wrong list for this
sort of thing. I'm seeing something which may
be a bug. OTOH, I may be misunderstanding how
parallel is supposed to work (I'm used to GNU
make's parallel build, which correctly computes
closure and executes dependencies at most once
per build, even in parallel mode).
I don't want to submit this to Bugzilla if
I'm just misunderstanding how ant is supposed to
work.
I'm using ant 4.1. I have a build file containing the
following:
<!-- execute the given ${target} on all sub projects -->
<target name="all-projects">
<parallel>
<antcall target="httpclient"/>
<antcall target="junit"/>
<antcall target="log4j"/>
<antcall target="xerces"/>
</parallel>
</target>
<target name="junit">
<echo>building junit, target ${target}</echo>
<ant dir="junit" target="${target}"/>
</target>
<target name="log4j" depends="junit">
<ant dir="log4j" target="${target}"/>
</target>
<target name="xerces" depends="junit">
<ant dir="xerces" target="${target}"/>
</target>
<target name="httpclient" depends="log4j">
<echo>building httpclient, target ${target}</echo>
<ant dir="httpclient" target="${target}"/>
</target>
When I use this version, the presence of <parallel>
causes the junit target to be executed 4 times. Without
parallel, it's only executed once (as expected).
Here's an excerpt from the ant log (using parallel):
[javac] Compiling 86 source files to
E:\r7\src\3rdparty\junit\junit\_DEBUG\build
[javac] Compiling 86 source files to
E:\r7\src\3rdparty\junit\junit\_DEBUG\build
[javac] Compiling 86 source files to
E:\r7\src\3rdparty\junit\junit\_DEBUG\build
[javac] Compiling 86 source files to
E:\r7\src\3rdparty\junit\junit\_DEBUG\build
When I remove the <parallel>, the junit target gets executed
a maximum of one time (as desired).
Thanks,
Chad
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Possible bug with , and depends
Posted by Chad Loder <cl...@acm.org>.
Steve,
Your response wasn't very helpful. :-) I already
know that ant doesn't do parallel builds the way
I expect. My real question is, "Should it?", and
if not, why not?
The documentation for <parallel> is not clear on
this point. Should this be considered a documentation
clarity issue or an outright bug?
Now, before I get flamed, I do understand how "depends"
in ant is different than depends in GNU make. The ant
documentation states:
"It should be noted, however, that Ant's depends
attribute only specifies the order in which targets
should be executed - it does not affect whether the
target that specifies the dependency(s) gets executed
if the dependent target(s) did not (need to) run."
However, right after this statement, the documentation also
states:
"A target gets executed only once, even when more than
one target depends on it (see the previous example)."
Then the documentation for AntCall states:
"When a target is invoked by antcall, all of its dependent
targets will also be called within the context of any new
parameters. For example. if the target "doSomethingElse"
depended on the target "init", then the antcall of
"doSomethingElse" will call "init" during the call."
My point is, the "junit" target only gets executed once when
multiple <antcall> tasks are specified. So far so good.
However, when the <antcall> is inside <parallel>, this desirable
behavior disappears. It sounds like a defect to me, and I'd
be willing to submit a patch that fixes it, just as soon as
someone tells me I'm right. :-)
c
At Wednesday 5/1/2002 05:00 PM -0700, you wrote:
> > I don't want to submit this to Bugzilla if
> > I'm just misunderstanding how ant is supposed to
> > work.
>
>fraid so.
>
>ant doesnt do parallel builds the way you expect, and antcall re-execs all
>the dependencies.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Possible bug with , and depends
Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Chad Loder" <cl...@acm.org>
To: <an...@jakarta.apache.org>
Sent: Wednesday, May 01, 2002 4:27 PM
Subject: Possible bug with <parallel>, <antcall> and depends
> Hello. Sorry if this is the wrong list for this
> sort of thing. I'm seeing something which may
> be a bug. OTOH, I may be misunderstanding how
> parallel is supposed to work (I'm used to GNU
> make's parallel build, which correctly computes
> closure and executes dependencies at most once
> per build, even in parallel mode).
>
> I don't want to submit this to Bugzilla if
> I'm just misunderstanding how ant is supposed to
> work.
fraid so.
ant doesnt do parallel builds the way you expect, and antcall re-execs all
the dependencies.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>