You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2007/10/20 17:39:26 UTC

DO NOT REPLY [Bug 43665] New: - dependset complaints about files from the future when they are 0.5s old

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665

           Summary: dependset complaints about files from the future when
                    they are 0.5s old
           Product: Ant
           Version: 1.7.0
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: kimhanse@gmail.com


I have noticed that triggering a dependset task right after a build causes the
dependset to complaint about future files. I think it is caused by the Date
ResourceSelector's granularity of 1s on UNIX systems, this means that a file
0.5s old is seen as from the future.

I don't think the bug causes any kind of errors in the files build, but it
lowers my colleagues trust in Ant.

This is an example showing the complaints:
========================
kim@raph:~/orion/svn/repo3/servlet/frontend$ ant clean build build
Buildfile: build.xml

clean:
   [delete] Deleting directory /mnt/crypt/orion/svn/repo3/servlet/frontend/build

build:
    [mkdir] Created dir: /mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes
    [javac] Compiling 91 source files to
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes

build:
[dependset] Warning:
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes/dk/ange/orion/servlet/format/jobs/PrerunWarnings$1.class
modified in the future.
[dependset] Warning:
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes/dk/ange/orion/servlet/format/jobs/PrerunWarnings$BasicWarning.class
modified in the future.
[dependset] Warning:
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes/dk/ange/orion/servlet/format/jobs/PrerunWarnings$FormattedWarning.class
modified in the future.
[dependset] Warning:
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes/dk/ange/orion/servlet/format/jobs/PrerunWarnings$ParseWarning.class
modified in the future.
[dependset] Warning:
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes/dk/ange/orion/servlet/format/jobs/PrerunWarnings$StabWarning.class
modified in the future.
[dependset] Warning:
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes/dk/ange/orion/servlet/format/jobs/PrerunWarnings$TooFewMovesWarning.class
modified in the future.
[dependset] Warning:
/mnt/crypt/orion/svn/repo3/servlet/frontend/build/classes/dk/ange/orion/servlet/format/jobs/PrerunWarnings.class
modified in the future.

BUILD SUCCESSFUL
Total time: 9 seconds
kim@raph:~/orion/svn/repo3/servlet/frontend$

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 43665] - dependset complaints about files from the future when they are 0.5s old

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665





------- Additional Comments From kimhanse@gmail.com  2007-10-22 02:38 -------
(In reply to comment #4)
> I do not think that this is due to mounted file systems.
> (despite the /mnt/crypt in the bug report).

/mnt/crypt is a local device mounted with encryption.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 43665] - dependset complaints about files from the future when they are 0.5s old

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665





------- Additional Comments From kimhanse@gmail.com  2007-10-22 02:31 -------
(In reply to comment #1)
> The whole thing about filesystem granularity is trouble; it is worse on windows.
> 
> e warn about clock differences because if you have a network mounted disk on a
> different clock, you are in deep trouble. 
> 
> 1. <date> selectors have a granularity of 0s on unix these days, I think. Now
> that Ant on DOS is NT only, we could perhaps tighten the 2s rule for windows,
> and allow some property to set the default granularity if you still build on FAT
> filesystems.

I added some debug statements to the ant code (version 1.7.0), it showed that
the granularity was 1000ms.

> 2. what does an ls -l of the specific files show, compared to the original file.?

I added some debug statements into the DependSet class, it showed that the files
 res.getLastModified() was around 500ms old compared to the
System.currentTimeMillis() used when creating the Date selector. I don't think
it should warn in that case, but it does.

Perhaps the granularity should be set to zero when generating the warning about
files from the future.

> 3. what does the clock test in ant -diagnostics print?

The only thing I could find about clock in that output was:
  Temp dir alignment with system clock is -413 ms

Running the diagnostics a lot of times gives me numbers from around -300ms to
-1100ms, but most were around -800ms.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 43665] - dependset complaints about files from the future when they are 0.5s old

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665


bodewig@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|dev@ant.apache.org          |notifications@ant.apache.org




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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 43665] - dependset complaints about files from the future when they are 0.5s old

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665





------- Additional Comments From jkf@apache.org  2007-10-22 02:59 -------
>From DependSet:

    private boolean uptodate(ResourceCollection src, ResourceCollection target) {
        org.apache.tools.ant.types.resources.selectors.Date datesel
            = new org.apache.tools.ant.types.resources.selectors.Date();
        datesel.setMillis(System.currentTimeMillis());
        datesel.setWhen(TimeComparison.AFTER);
        logFuture(targets, datesel);

To make matters worse the filesystem granularity is added by the
resourceselector in favour of matching.





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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 43665] - dependset complaints about files from the future when they are 0.5s old

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665





------- Additional Comments From stevel@apache.org  2007-10-22 02:15 -------
The whole thing about filesystem granularity is trouble; it is worse on windows.

e warn about clock differences because if you have a network mounted disk on a
different clock, you are in deep trouble. 

1. <date> selectors have a granularity of 0s on unix these days, I think. Now
that Ant on DOS is NT only, we could perhaps tighten the 2s rule for windows,
and allow some property to set the default granularity if you still build on FAT
filesystems.

2. what does an ls -l of the specific files show, compared to the original file.?
3. what does the clock test in ant -diagnostics print?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 43665] - dependset complaints about files from the future when they are 0.5s old

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665





------- Additional Comments From peterreilly@apache.org  2007-10-22 02:35 -------
I do not think that this is due to mounted file systems.
(despite the /mnt/crypt in the bug report).
The follows gives me with trunk ant.

src/example/Hello.java: |-
  package example; 
  public class Hello{}
build.xml:  |-
  <project name="d" default="run">
    <target name="run">
      <delete dir="classes"/>
      <mkdir dir="classes"/>
      <javac srcdir="src" destdir="classes" debug="yes"/>
      <dependset>
        <sources>
          <fileset dir="src" includes="**/*.java"/>
        </sources>
        <targets>
          <fileset dir="classes" includes="**/*.class"/>
        </targets>
      </dependset>
    </target>
  </project>

Result:
run:
Created dir: /work/reilly/learning/a/dependset/classes
Compiling 1 source file to /work/reilly/learning/a/dependset/classes
Warning: /work/reilly/learning/a/dependset/classes/example/Hello.class modified
in the future.

~/learning/a/dependset> ls -lR
.:
total 12
-rw-r--r--  1 reilly ccgrp01  393 Oct 22 09:44 build.xml
drwxr-xr-x  3 reilly ccgrp01 4096 Oct 22 09:46 classes
drwxr-xr-x  3 reilly ccgrp01 4096 Oct 22 09:41 src

./classes:
total 4
drwxr-xr-x  2 reilly ccgrp01 4096 Oct 22 09:46 example

./classes/example:
total 4
-rw-r--r--  1 reilly ccgrp01 256 Oct 22 09:46 Hello.class

./src:
total 4
drwxr-xr-x  2 reilly ccgrp01 4096 Oct 22 09:41 example

./src/example:
total 4
-rw-r--r--  1 reilly ccgrp01 41 Oct 22 09:41 Hello.java


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 43665] - dependset complaints about files from the future when they are 0.5s old

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43665>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43665





------- Additional Comments From jkf@apache.org  2007-10-22 02:25 -------
On windows NT this has already happened quite some time ago (1 ms).

Revision 278117 - (view) (download) (annotate) - [select for diffs]
Modified Thu Apr 7 19:59:35 2005 UTC (2 years, 6 months ago) by bruce
File length: 58537 byte(s)
Diff to previous 278110 (colored)

Round NTFS Granularity up rather than down


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org