ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45902] New: Up-to-date checks for JARs broken due to comparison of dir timestamps
Date Fri, 26 Sep 2008 19:56:48 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45902

           Summary: Up-to-date checks for JARs broken due to comparison of
                    dir timestamps
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: jglick@netbeans.org


If you follow the (rather complex) instructions in

http://www.netbeans.org/nonav/issues/show_bug.cgi?id=142466

you can (sometimes) reproduce a regression in Ant 1.7.1;
samples/admin/target/useradmin-shared.jar is recreated during incremental
builds. The log for this <jar> task says

....
net/java omitted as
/tmp/genesis-3.1/samples/admin/target/useradmin-shared.jar:net/java/ is up to
date.
net/java/dev omitted as
/tmp/genesis-3.1/samples/admin/target/useradmin-shared.jar:net/java/dev/ is up
to date.
net/java/dev/genesis omitted as
/tmp/genesis-3.1/samples/admin/target/useradmin-shared.jar:net/java/dev/genesis/
is up to date.
....
net omitted as /tmp/genesis-3.1/samples/admin/target/useradmin-shared.jar:net/
is up to date.
net/java omitted as
/tmp/genesis-3.1/samples/admin/target/useradmin-shared.jar:net/java/ is up to
date.
net/java/dev omitted as
/tmp/genesis-3.1/samples/admin/target/useradmin-shared.jar:net/java/dev/ is up
to date.
net/java/dev/genesis omitted as
/tmp/genesis-3.1/samples/admin/target/useradmin-shared.jar:net/java/dev/genesis/
is up to date.
....
net added as net/ is outdated.
net/java added as net/java/ is outdated.
net/java/dev added as net/java/dev/ is outdated.
net/java/dev/genesis added as net/java/dev/genesis/ is outdated.
....

The problem occurs only when directories are added to the JAR file.

Uncommenting

  if (target.isDirectory()) return false;

from ResourceUtils.selectOutOfDateSources' ResourceSelector.isSelected impl
causes the issue not to appear; the problem seems to relate to a ZipResource
".../admin/target/useradmin-shared.jar:net/" always being OOD relative to a
FileResource ".../admin/modules/shared/target/hibernate/net".

Of course uncommenting that line would regress performance of many tasks. I'm
not sure why we are even checking timestamps on ZIP folders; surely these do
not matter to begin with? There is

  if (doFilesonly) resources = selectFileResources(resources);

in Zip.java but I do not understand why this is conditional; seems to me that
this should be run even if !doFilesonly. Making this unconditional might fix
the issue for me; I am not sure because now I can no longer reproduce the
original problem (seems to come and go).

The build script is too complex for me to follow. The problem may be ultimately
due to some user error in the script. But I think I am out of my depth with the
new resource collection code which I can barely follow.


BTW (probably unrelated to this bug): peterreilly changed my code in
SelectorUtils.isOutOfDate to create a sourceExists local variable - but it is
unused! Perhaps there is a missing

  if (!sourceExists) return false;

?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message