You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by Dawid Weiss <da...@cs.put.poznan.pl> on 2005/06/03 10:12:00 UTC

Build.xml's symlink not working on CygWin [jira offline?]

Hi there,

JIRA seems to be offline, so here:

My CygWin installation reports an error when running a repeated 'ant 
jar' -- symlink fails with:

jar:
   [symlink] ln -s ./build/nutch-0.7-dev.jar D:\nutch\nutch\trunk/nutch.jar
   [symlink] ln: `D:\\nutch\\nutch\\trunk/nutch.jar': File exists

A quick and dirty hack is to attempt to delete the link:

$ svn diff build.xml
Index: build.xml
===================================================================
--- build.xml   (revision 179742)
+++ build.xml   (working copy)
@@ -101,6 +101,7 @@
        jarfile="${build.dir}/${final.name}.jar"
        basedir="${build.classes}"
      />
+    <delete failonerror="false" file="${basedir}/${name}.jar.lnk" />
      <symlink overwrite="true" link="${basedir}/${name}.jar"
               resource="${build.dir}/${final.name}.jar"/>
    </target>

Is anyone having the same issue?

Dawid

Re: Build.xml's symlink not working on CygWin [jira offline?]

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
> To minimize duplication of logic.  If there are two implementations of 
> something that must be maintained in parallel, then they're likely to 
> get out of sync.  All the more so if testing them requires different 
> operating systems.

Yeah... that was it :)

> Personally, I always use cygwin when developing on Windows.  I use it 
> for shell, ssh, svn, X, etc.  So, for me, cygwin is no burden.

I must agree with Andrzej that sometimes CygWin is a burden... Even 
though I like and use it a lot. I also understand that Nutch is a 
specific type of application and that users may be requested to do a 
little more then just download it, but still... I like having support 
for Windows shell scripts anyway.

Anyway, I posted a build.xml patch that converts all execs to plain ANT 
tasks to Andrzej.

Thanks for the response,
Dawid





Re: Build.xml's symlink not working on CygWin [jira offline?]

Posted by Doug Cutting <cu...@nutch.org>.
Andrzej Bialecki wrote:
> Dawid Weiss wrote:
>> Doug -- is there any strong rationale of having CygWin as the 
>> development shell for Windows?

To minimize duplication of logic.  If there are two implementations of 
something that must be maintained in parallel, then they're likely to 
get out of sync.  All the more so if testing them requires different 
operating systems.

> For my part I can't see any, except that the main "nutch" script 
> requires a Bourne-compatible shell.

Build.xml uses "exec" in a few places.  These would need to be fixed.

> IMHO it would be better to rewrite 
> to a *.bat file for Windows users, rather than require them to install 
> Cygwin. Tomcat catalina.bat scripts could provide excellent start - they 
> are well tested.

I might support this if the .bat file and the .sh file were driven by a 
common config file.  We'd need a table mapping command names to class 
names and one-line descriptions that could be used by both scripts.

Changes to classpath logic will still require both scripts to change, 
which will likely cause problems at some point, but perhaps fewer 
problems than are presently encountered with cygwin?

Personally, I always use cygwin when developing on Windows.  I use it 
for shell, ssh, svn, X, etc.  So, for me, cygwin is no burden.

Doug

Re: Build.xml's symlink not working on CygWin [jira offline?]

Posted by Andrzej Bialecki <ab...@getopt.org>.
Dawid Weiss wrote:
> 
> I support this wholeheartedly... I know having Windows on your desktop 
> might be a slap-in-the-face for some, but the reality is many of us work 
> in a hybrid environment.
> 
> I once posted a message asking for small adjustments to the build.xml 
> file that would make ANT build script usable under regular Windows shell 
> -- tarballs and such. I will be pleased to work on this if you want to; 
> takes a few minutes in fact.

That would be great - thanks! You can send it directly to me, I can 
commit this.

> 
> Doug -- is there any strong rationale of having CygWin as the 
> development shell for Windows?

For my part I can't see any, except that the main "nutch" script 
requires a Bourne-compatible shell. IMHO it would be better to rewrite 
to a *.bat file for Windows users, rather than require them to install 
Cygwin. Tomcat catalina.bat scripts could provide excellent start - they 
are well tested.

-- 
Best regards,
Andrzej Bialecki     <><
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


Re: Build.xml's symlink not working on CygWin [jira offline?]

Posted by Dawid Weiss <da...@cs.put.poznan.pl>.
I support this wholeheartedly... I know having Windows on your desktop 
might be a slap-in-the-face for some, but the reality is many of us work 
in a hybrid environment.

I once posted a message asking for small adjustments to the build.xml 
file that would make ANT build script usable under regular Windows shell 
-- tarballs and such. I will be pleased to work on this if you want to; 
takes a few minutes in fact.

Doug -- is there any strong rationale of having CygWin as the 
development shell for Windows?

Dawid

Andrzej Bialecki wrote:
> Dawid Weiss wrote:
> 
>>
>> Hi there,
>>
>> JIRA seems to be offline, so here:
>>
>> My CygWin installation reports an error when running a repeated 'ant 
>> jar' -- symlink fails with:
>>
>> jar:
>>   [symlink] ln -s ./build/nutch-0.7-dev.jar 
>> D:\nutch\nutch\trunk/nutch.jar
>>   [symlink] ln: `D:\\nutch\\nutch\\trunk/nutch.jar': File exists
>>
>> A quick and dirty hack is to attempt to delete the link:
>>
>> $ svn diff build.xml
>> Index: build.xml
>> ===================================================================
>> --- build.xml   (revision 179742)
>> +++ build.xml   (working copy)
>> @@ -101,6 +101,7 @@
>>        jarfile="${build.dir}/${final.name}.jar"
>>        basedir="${build.classes}"
>>      />
>> +    <delete failonerror="false" file="${basedir}/${name}.jar.lnk" />
>>      <symlink overwrite="true" link="${basedir}/${name}.jar"
>>               resource="${build.dir}/${final.name}.jar"/>
>>    </target>
>>
>> Is anyone having the same issue?
>>
>> Dawid
>>
>>
> 
> Same here. I don't think using symlinks on Windows is a good idea. I 
> think this should be replaced by a copy.
> 
> 

Re: Build.xml's symlink not working on CygWin [jira offline?]

Posted by Andrzej Bialecki <ab...@getopt.org>.
Dawid Weiss wrote:
> 
> Hi there,
> 
> JIRA seems to be offline, so here:
> 
> My CygWin installation reports an error when running a repeated 'ant 
> jar' -- symlink fails with:
> 
> jar:
>   [symlink] ln -s ./build/nutch-0.7-dev.jar D:\nutch\nutch\trunk/nutch.jar
>   [symlink] ln: `D:\\nutch\\nutch\\trunk/nutch.jar': File exists
> 
> A quick and dirty hack is to attempt to delete the link:
> 
> $ svn diff build.xml
> Index: build.xml
> ===================================================================
> --- build.xml   (revision 179742)
> +++ build.xml   (working copy)
> @@ -101,6 +101,7 @@
>        jarfile="${build.dir}/${final.name}.jar"
>        basedir="${build.classes}"
>      />
> +    <delete failonerror="false" file="${basedir}/${name}.jar.lnk" />
>      <symlink overwrite="true" link="${basedir}/${name}.jar"
>               resource="${build.dir}/${final.name}.jar"/>
>    </target>
> 
> Is anyone having the same issue?
> 
> Dawid
> 
> 

Same here. I don't think using symlinks on Windows is a good idea. I 
think this should be replaced by a copy.


-- 
Best regards,
Andrzej Bialecki     <><
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


Re: Build.xml's symlink not working on CygWin [jira offline?]

Posted by Doug Cutting <cu...@nutch.org>.
Dawid Weiss wrote:
> My CygWin installation reports an error when running a repeated 'ant 
> jar' -- symlink fails with:

The symlink was added for MapReduce, but, in the mapred branch I've 
reworked things so that it is no longer required.  It was a bad idea, 
since, as you've observerd, it doesn't work on Win32.

Doug