You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2016/01/18 17:17:59 UTC

[Bug 58886] New: Targets are called several times

https://bz.apache.org/bugzilla/show_bug.cgi?id=58886

            Bug ID: 58886
           Summary: Targets are called several times
           Product: Ant
           Version: 1.9.4
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core
          Assignee: notifications@ant.apache.org
          Reporter: sebastien.eon@microej.com

Created attachment 33460
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33460&action=edit
Scripts reproducing the issue.

Under certain conditions, some targets are called two times.
The attached archive contains some simple scripts to reproduce the issue (build
file is main.xml). It involves the usage of an extension point, and importing
scripts in separated folders.
The script fails if the target bar is called two times, succeed otherwise.

The bug appears since version 1.9.4 (1.9.3 works fine, 1.9.6 still contains the
issue).
The bug seems OS independent and can be reproduce on Windows or MacOSX.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 58886] Targets are called several times

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58886

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |1.9.7

--- Comment #2 from Stefan Bodewig <bo...@apache.org> ---
Found the root cause which was responsible for Ant importing files twice. Fixed
with git commit 7046631.

Many thanks for providing the testcase, it help a lot.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 58886] Targets are called several times

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58886

--- Comment #4 from Stefan Bodewig <bo...@apache.org> ---
Now that I know the problem is that Ant didn't "normalize" the filename and so
didn't realize it had imported bar before, there is a workaround for you.

In foo use

        <property name="x" location="${foo.dir}/../bar/bar.xml"/>
    <import file="${x}"/>

instead of your original import. This will normalize the file name and should
make your script work for 1.9.4 to 1.9.6.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 58886] Targets are called several times

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58886

--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
s/help/helped/

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 58886] Targets are called several times

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58886

--- Comment #1 from Stefan Bodewig <bo...@apache.org> ---
Not a solution or a complete analysis so far, but running ant -v will tell you

Build sequence for target(s) `platform' is [bar, foo/export, bar.bar, extpoint,
platform]

so the target "bar" is executed twice, once with its prefixed name and once
with its plain name. At first I thought it might by depends and extensionOf
colliding, but removing the depends from foo/export yields

Build sequence for target(s) `platform' is [foo/export, bar, bar.bar, extpoint,
platform]

which only rearranges the targets but keeps bar inside of the list twice.

This certainly looks like a bug and I'm trying to figure out which change in
1.9.4 may have caused it.

-- 
You are receiving this mail because:
You are the assignee for the bug.