You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by bool <ma...@yahoo.co.uk> on 2010/06/09 13:37:55 UTC

subant task scans .svn folders

I am using the following build.xml using subant task. After executing ant
find_java on console, I see that when I do "truss -p <pid of ant java
process>" 
I see .svn folders being scanned and opened by ant. Is this expected? How
can I prevent .svn folders from getting scanned and opened.  I am using
ant1.7.1


==============================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="Base" default="find_java" basedir=".">
    <description> Build file </description>

    <target name="find_java">
    <subant target="clean_generated_java_files" defaultexcludes="true">
             <fileset dir="${basedir}"
                 includes="**/build.xml"
                 defaultexcludes="true">
             </fileset>
    </subant>
    </target>

</project>
==============================================================



truss -p <pid of ant java process> results in the following log.



/2:    
stat64("/projects/base/src/java/.svn/text-base/package.html.svn-base",
0xFE3EDCA0) = 0
/2:    
stat64("/projects/base/src/java/.svn/text-base/package.html.svn-base",
0xFE3EDCA0) = 0
/2:     stat64("/projects/base/src/java.svn/tmp", 0xFE3EDD00) = 0
/2:     stat64("/projects/base/src/java/.svn/tmp", 0xFE3EDC70) = 0
/2:     stat64("/projects/base/src/java/.svn/tmp", 0xFE3EDCA0) = 0
/2:     openat(-3041965, "/projects/base/src/java/.svn/tmp",
O_RDONLY|O_NDELAY|O_LARGEFILE) = 56

-- 
View this message in context: http://old.nabble.com/subant-task-scans-.svn-folders-tp28829117p28829117.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: subant task scans .svn folders

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-06-10, bool wrote:

>>> This sounds like a bug.

> If this is a bug, will this be fixed in future releases ?

Yes.  It would be good if you opened a Bugzilla issue for it.

I have already added a few JUnit tests to Ant's svn trunk and they
indicate things would be working as expected.  Currently I'm waiting for
the right combination of "time available" and "access to operating
system that allows me to trace syscalls" for trying to reproduce your
case.

> Any idea when ?

As usual in OS land the answer is "when it's done".  We've had twenty
months between 1.7.1 and 1.8.0 and three between 1.8.0 and 1.8.1 - I'd
hope we'll be closer to the last interval before we release 1.8.2 (which
would project it to late summer, early autumn).

So far we haven't made any major changes in trunk and the bugs we've
fixed are more "annoying" than major (yours makes scanning slower than
it has to be but doesn't cause ant to do wrong things).

Stefan

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


Re: subant task scans .svn folders

Posted by bool <ma...@yahoo.co.uk>.


Stefan Bodewig wrote:
> 
> On 2010-06-09, bool wrote:
> 
>> Michael Ludwig-6 wrote:
> 
>>> Maybe worth trying with 1.8.1.
> 
>> Just tried this, but found that .svn folders are being scanned and
>> opened.
> 
> In general, this shouldn't happen.  DirectoryScanner is supposed to see
> that .svn/ dirs can never hold any included files - I'd expect
> contentsExcluded to return false for the directories and thus avoid the
> scan.
> 
> This sounds like a bug.
> 
>> Also I did not find any option to exclude certain directories patterns
>> (**/.svn/**) when using subant task from ant documentation
>> http://ant.apache.org/manual/Tasks/subant.html
> 
> You don't do that at the task level but at the level of the nested
> fileset.  Since your example uses defaultexcludes="true" and the default
> excludes already contain **/.svn/** this shouldn't change anything.
> Unless you have used the <defaultexcludes> task to modify the list of
> patterns, that is.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


>> This sounds like a bug.

If this is a bug, will this be fixed in future releases ? Any idea when ?

This has performance implications as file system scanning can be very slow
depending on the filer and we would definitely not want Ant to scan .svn
folders.



>> Unless you have used the <defaultexcludes> task to modify the list of
>> patterns, that is.

No. I did not modify <defaultexcludes>







-- 
View this message in context: http://old.nabble.com/subant-task-scans-.svn-folders-tp28829117p28838840.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: subant task scans .svn folders

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-06-10, Stefan Bodewig wrote:

> I've opened <https://issues.apache.org/bugzilla/show_bug.cgi?id=49420>

Fixed in svn trunk, will be fixed in 1.8.2.  I'm just running Ant's test
suite to ensure my change doesn't cause any regressions.

Stefan

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


Re: subant task scans .svn folders

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-06-09, Stefan Bodewig wrote:

> This sounds like a bug.

OK, let me try to reproduce this:

stefan@machine:/tmp/testbed$ mkdir -p .svn/foo/bar
stefan@machine:/tmp/testbed$ mkdir -p dummy/.svn/foo/bar
stefan@machine:/tmp/testbed$ echo '<project><target name="hello"><echo>hello</echo></target></project>' > dummy/sub.xml
stefan@machine:/tmp/testbed$ echo '<project><property name="def" value="true"/><subant target="hello"><fileset dir="." includes="**/sub.xml" defaultexcludes="${def}"/></subant></project>' > build.xml
stefan@machine:/tmp/testbed$ ant
Buildfile: /tmp/testbed/build.xml

hello:
     [echo] hello

BUILD SUCCESSFUL
Total time: 1 second

so we have a build file build.xml invoking sub.xml via subant and it
works.  We also have two .svn subdirs and a property def controlling
default excludes.

stefan@machine:/tmp/testbed$ strace -f ant 2>&1 | fgrep .svn   
[pid 19650] open("/tmp/testbed/dummy/.svn", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
[pid 19650] open("/tmp/testbed/dummy/.svn/foo", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
[pid 19650] open("/tmp/testbed/dummy/.svn/foo/bar", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
[pid 19650] open("/tmp/testbed/.svn", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
[pid 19650] open("/tmp/testbed/.svn/foo", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
[pid 19650] open("/tmp/testbed/.svn/foo/bar", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17

this confirms your truss findings.  I've opened
<https://issues.apache.org/bugzilla/show_bug.cgi?id=49420>

Stefan

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


Re: subant task scans .svn folders

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-06-09, bool wrote:

> Michael Ludwig-6 wrote:

>> Maybe worth trying with 1.8.1.

> Just tried this, but found that .svn folders are being scanned and opened.

In general, this shouldn't happen.  DirectoryScanner is supposed to see
that .svn/ dirs can never hold any included files - I'd expect
contentsExcluded to return false for the directories and thus avoid the
scan.

This sounds like a bug.

> Also I did not find any option to exclude certain directories patterns
> (**/.svn/**) when using subant task from ant documentation
> http://ant.apache.org/manual/Tasks/subant.html

You don't do that at the task level but at the level of the nested
fileset.  Since your example uses defaultexcludes="true" and the default
excludes already contain **/.svn/** this shouldn't change anything.
Unless you have used the <defaultexcludes> task to modify the list of
patterns, that is.

Stefan

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


Re: subant task scans .svn folders

Posted by bool <ma...@yahoo.co.uk>.


Michael Ludwig-6 wrote:
> 
> bool schrieb am 09.06.2010 um 04:37 (-0700):
>> I am using the following build.xml using subant task. After executing
>> ant find_java on console, I see that when I do "truss -p <pid of ant
>> java process>" I see .svn folders being scanned and opened by ant. Is
>> this expected?
> 
> Don't know. I wouldn't expect that to happen. Is this behaviour specific
> to Ant running the <subant> task?
> 
>> I am using ant1.7.1
> 
> Maybe worth trying with 1.8.1.
> 
> -- 
> Michael Ludwig
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


>> Is this behaviour specific to Ant running the <subant> task?

Yes. You can reproduce this by executing find_java target in the build.xml I
pasted and do a truss -p <pid> after finding the pid of java process.

>> Maybe worth trying with 1.8.1.

Just tried this, but found that .svn folders are being scanned and opened.



Also I did not find any option to exclude certain directories patterns
(**/.svn/**) when using subant task from ant documentation
http://ant.apache.org/manual/Tasks/subant.html



-- 
View this message in context: http://old.nabble.com/subant-task-scans-.svn-folders-tp28829117p28831022.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: subant task scans .svn folders

Posted by Michael Ludwig <mi...@gmx.de>.
bool schrieb am 09.06.2010 um 04:37 (-0700):
> I am using the following build.xml using subant task. After executing
> ant find_java on console, I see that when I do "truss -p <pid of ant
> java process>" I see .svn folders being scanned and opened by ant. Is
> this expected?

Don't know. I wouldn't expect that to happen. Is this behaviour specific
to Ant running the <subant> task?

> I am using ant1.7.1

Maybe worth trying with 1.8.1.

-- 
Michael Ludwig

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


Re: subant task scans .svn folders

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-06-09, bool wrote:

> ==============================================================
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="Base" default="find_java" basedir=".">
>     <description> Build file </description>

>     <target name="find_java">
>     <subant target="clean_generated_java_files" defaultexcludes="true">
>              <fileset dir="${basedir}"
>                  includes="**/build.xml"
>                  defaultexcludes="true">
>              </fileset>
>     </subant>
>     </target>

> </project>
> ==============================================================

I haven't actually tried it, but from the root cause of the bug you can
probably work around this by - against all intuiton - make the .svn
directories included, like in

              <fileset dir="${basedir}"
                  defaultexcludes="true">
                <include name="**/build.xml"/>
                <include name="**/.svn"/>
              </fileset>

This should avoid the code path taken for directories that are
themselves not included which is the only one that was unguarded against
recursively excluded directories.

Stefan

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