You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Judy Anderson <JA...@rocketsoftware.com> on 2007/12/24 21:52:54 UTC
CVS task failure: cannot rename
I am a new user of ANT, and the first problem I've been unable to solve on my own is a CVS problem. (I didn't construct the build.xml file myself; I was handed an incomplete project, on which I'm trying to come up to speed.)
<property name="cvs.quiet" value="true"/>
<macrodef name="cvs-checkout">
<attribute name="package"/>
<sequential>
<cvs cvsRoot=":pserver:${env.USERNAME}@rscvs02.rocketsoftware.com:/cvs/kbm" passfile="${env.CVS_PASSFILE}" package="@{package}" failonerror="true" output="@{package}.cvs.log" quiet="${cvs.quiet}"/>
...
<target name="cvs-checkout-bundle">
<cvs-checkout package="bundle"/>
</target>
Results in:
[cvs] cvs [checkout aborted]: cannot rename file .new.emp-common.jar to emp-common.jar: File exists
BUILD FAILED
However, when I use CVS update directly it works just fine.
The mentioned log file has a nice U line for the mentioned file (though as you see it didn't fully get updated.) I passed in -Dcvs.quiet=false but that just showed me "[cvs] cvs checkout: Updating" lines for each prior directory, as one would expect.
Searching for similar error messages found me other people who had cannot renames with Permission Denied, but that's not my problem. One person with CVS problems recommended using an EXEC task instead, which I'm considering, but wanted to see if there was any suggestion to how to debug this using the CVS task.
Extremely strangely, .java files got updated when I ran it on a different package. Now, unfortunately, I can't make spurious changes to the repository in order to experiment to fins out if it's only .jars, or only THAT .jar, or whatever. But it's very worrisome to have an unexplained failure in the build -- when this stuff goes live it'll be very bad to have it break at midnight like this!
I'm using Windows XP; I think the CVS repository is on a unix machine, but I don't honestly know (and I don't have access to that machine). I have Ant 1.7.0. What could have gone wrong with the CVS task, and what can I do to get more information about the problem? I hate mysterious messages!
Judy Anderson
Rocket Software
janderson@rocketsoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: CVS task failure: cannot rename
Posted by David Weintraub <qa...@gmail.com>.
Judy:
I can confirm that your CVS Archive does rest on a Unix machine
because the CVS Root is in a Unix format. However, that really
shouldn't make much difference.
I did find this little notice in the <cvs> task definition:
CVSNT Note: CVSNT prefers users to store the passwords inside the
registry. If the cvspass task and the passfile attribute don't seem to
work for you, the most likely reason is that CVSNT ignores your
.cvspass file completely. See bugzilla report 21657 for recommended
workarounds.
If you're executing on Windows, this may be a problem. I find that I
have to embed the CVS password inside my CVSROOT (yuck!).
The other thing is that I don't use the <cvs-checkout> command.
Instead, I use the <cvs> command and give it the "command" parameter:
<cvs
command="checkout"
cvsroot="${cvsroot}"
dest="${cvs.dest.dir}"
package="${cvs.package}"/>
You're gettina a "File exists" error which happens when a file you're
checking out already exists in the directory where you're checking
everything out.
Normally, you don't do a CVS checkout in Ant. After all, you don't get
the build.xml file until you do the initial checkout. Instead, you
should try the "update" command:
<cvs
command="update"
dest="${cvs.dest.dir}"/>
This will keep your working directory and only update the newer files.
It also won't change files that you've already modified. Instead, it
will merge your changes into the newer versions. If this isn't what
you want, you need to add the "-C" command line parameter to the <cvs>
task:
<cvs
command="update -C"
dest="${cvs.dest.dir}"/>
This will move your changes to .#filename.1.2.3.4 and then checkout a
clean copy of the file. Most likely, this isn't what you want.
My suggestion is to use the <cvs command="update"> without the "-C"
argument in your task.
On Dec 24, 2007 3:52 PM, Judy Anderson <JA...@rocketsoftware.com> wrote:
> I am a new user of ANT, and the first problem I've been unable to solve on my own is a CVS problem. (I didn't construct the build.xml file myself; I was handed an incomplete project, on which I'm trying to come up to speed.)
>
> <property name="cvs.quiet" value="true"/>
> <macrodef name="cvs-checkout">
> <attribute name="package"/>
> <sequential>
> <cvs cvsRoot=":pserver:${env.USERNAME}@rscvs02.rocketsoftware.com:/cvs/kbm" passfile="${env.CVS_PASSFILE}" package="@{package}" failonerror="true" output="@{package}.cvs.log" quiet="${cvs.quiet}"/>
> ...
>
> <target name="cvs-checkout-bundle">
> <cvs-checkout package="bundle"/>
> </target>
>
> Results in:
> [cvs] cvs [checkout aborted]: cannot rename file .new.emp-common.jar to emp-common.jar: File exists
>
> BUILD FAILED
>
> However, when I use CVS update directly it works just fine.
>
> The mentioned log file has a nice U line for the mentioned file (though as you see it didn't fully get updated.) I passed in -Dcvs.quiet=false but that just showed me "[cvs] cvs checkout: Updating" lines for each prior directory, as one would expect.
>
> Searching for similar error messages found me other people who had cannot renames with Permission Denied, but that's not my problem. One person with CVS problems recommended using an EXEC task instead, which I'm considering, but wanted to see if there was any suggestion to how to debug this using the CVS task.
>
> Extremely strangely, .java files got updated when I ran it on a different package. Now, unfortunately, I can't make spurious changes to the repository in order to experiment to fins out if it's only .jars, or only THAT .jar, or whatever. But it's very worrisome to have an unexplained failure in the build -- when this stuff goes live it'll be very bad to have it break at midnight like this!
>
> I'm using Windows XP; I think the CVS repository is on a unix machine, but I don't honestly know (and I don't have access to that machine). I have Ant 1.7.0. What could have gone wrong with the CVS task, and what can I do to get more information about the problem? I hate mysterious messages!
>
> Judy Anderson
> Rocket Software
> janderson@rocketsoftware.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: CVS task failure: cannot rename
Posted by Judy Anderson <JA...@rocketsoftware.com>.
Aha, indeed, the jar file was on my classpath. In my experiments I didn't explicitly change classpath within Ant, but I suppose it inherits from the environment. I rebooted my machine and the problem went away, but I may not have run the script that sets my default classpath when I ran the after-reboot test. Thanks for the tip. I guess I need to rework stuff so that I make sure no CVS-controlled files are on classpath before running the CVS tasks, and then re-add them when it's time to run the tasks that will require the new jars.
-----Original Message-----
From: Rick Genter [mailto:rgenter@silverlink.com]
Sent: Sunday, December 30, 2007 3:09 PM
To: Ant Users List
Subject: RE: CVS task failure: cannot rename
> From: Judy Anderson [mailto:JAnderson@rocketsoftware.com]
> Sent: Tuesday, December 25, 2007 1:51 PM
> To: Ant Users List
> Subject: RE: CVS task failure: cannot rename
>
> I have done some more experimentation with my problem. It
> only happens on binary files (flag "-kb"). CVS is doing a
> different kind of update that involves delete/rename. I
> tried using <exec> on cvs with no help.
>
> It seems that, although I can "del" such a file manually, I
> cannot use ant's <delete> task on one. So perhaps the
> problem is unrelated to CVS (well, excepting that the file
> was created by CVS.)
>
> <delete file="c:/bt/mainline/bundle/bundle.jar"/>
>
> [delete] Deleting: c:\bt\mainline\bundle\bundle.jar
>
> BUILD FAILED
> build.xml:9: Unable to delete file c:\bt\mainline\bundle\bundle.jar
>
> So, now I wonder if there's some weirdness within Ant about
> user permissions. I can delete a file I created by hand. I
> cannot see any interesting difference in the Properties
> dialog for either of these files in the explorer. (The CVS
> created files have a "Summary" tab, but my files don't. It
> is blank.) I'm really mystified. I wish that I had the
> Windows error code that led the <delete> task to decide it
> could not delete the file.
Judy,
Is it possible that the files in question are .jar files that are on the
classpath of other tasks that have been run during the build? If so,
it's possible that the JVM still has the .jar file open, in which case
you will not be able to delete it.
--
Rick Genter
Principal Software Engineer
Silverlink Communications
rgenter@silverlink.com
www.silverlink.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: CVS task failure: cannot rename
Posted by Rick Genter <rg...@silverlink.com>.
> From: Judy Anderson [mailto:JAnderson@rocketsoftware.com]
> Sent: Tuesday, December 25, 2007 1:51 PM
> To: Ant Users List
> Subject: RE: CVS task failure: cannot rename
>
> I have done some more experimentation with my problem. It
> only happens on binary files (flag "-kb"). CVS is doing a
> different kind of update that involves delete/rename. I
> tried using <exec> on cvs with no help.
>
> It seems that, although I can "del" such a file manually, I
> cannot use ant's <delete> task on one. So perhaps the
> problem is unrelated to CVS (well, excepting that the file
> was created by CVS.)
>
> <delete file="c:/bt/mainline/bundle/bundle.jar"/>
>
> [delete] Deleting: c:\bt\mainline\bundle\bundle.jar
>
> BUILD FAILED
> build.xml:9: Unable to delete file c:\bt\mainline\bundle\bundle.jar
>
> So, now I wonder if there's some weirdness within Ant about
> user permissions. I can delete a file I created by hand. I
> cannot see any interesting difference in the Properties
> dialog for either of these files in the explorer. (The CVS
> created files have a "Summary" tab, but my files don't. It
> is blank.) I'm really mystified. I wish that I had the
> Windows error code that led the <delete> task to decide it
> could not delete the file.
Judy,
Is it possible that the files in question are .jar files that are on the
classpath of other tasks that have been run during the build? If so,
it's possible that the JVM still has the .jar file open, in which case
you will not be able to delete it.
--
Rick Genter
Principal Software Engineer
Silverlink Communications
rgenter@silverlink.com
www.silverlink.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: CVS task failure: cannot rename
Posted by Chuck Holzwarth <ch...@yahoo.com>.
Judy,
Look at the ant exec task. You may find something by executing an "ls -l" of the directory and then the directory and file string. You also may want to issue a umask command. It is possible that while your ID has write permission, ant has been restricted, this could be the case if the setuid bit is set on the ant executable.
Judy Anderson <JA...@rocketsoftware.com> wrote: I have done some more experimentation with my problem. It only happens on binary files (flag "-kb"). CVS is doing a different kind of update that involves delete/rename. I tried using on cvs with no help.
It seems that, although I can "del" such a file manually, I cannot use ant's task on one. So perhaps the problem is unrelated to CVS (well, excepting that the file was created by CVS.)
[delete] Deleting: c:\bt\mainline\bundle\bundle.jar
BUILD FAILED
build.xml:9: Unable to delete file c:\bt\mainline\bundle\bundle.jar
So, now I wonder if there's some weirdness within Ant about user permissions. I can delete a file I created by hand. I cannot see any interesting difference in the Properties dialog for either of these files in the explorer. (The CVS created files have a "Summary" tab, but my files don't. It is blank.) I'm really mystified. I wish that I had the Windows error code that led the task to decide it could not delete the file.
-----Original Message-----
From: Judy Anderson [mailto:JAnderson@rocketsoftware.com]
Sent: Monday, December 24, 2007 3:53 PM
To: user@ant.apache.org
Subject: CVS task failure: cannot rename
I am a new user of ANT, and the first problem I've been unable to solve on my own is a CVS problem. (I didn't construct the build.xml file myself; I was handed an incomplete project, on which I'm trying to come up to speed.)
...
Results in:
[cvs] cvs [checkout aborted]: cannot rename file .new.emp-common.jar to emp-common.jar: File exists
BUILD FAILED
However, when I use CVS update directly it works just fine.
The mentioned log file has a nice U line for the mentioned file (though as you see it didn't fully get updated.) I passed in -Dcvs.quiet=false but that just showed me "[cvs] cvs checkout: Updating" lines for each prior directory, as one would expect.
Searching for similar error messages found me other people who had cannot renames with Permission Denied, but that's not my problem. One person with CVS problems recommended using an EXEC task instead, which I'm considering, but wanted to see if there was any suggestion to how to debug this using the CVS task.
Extremely strangely, .java files got updated when I ran it on a different package. Now, unfortunately, I can't make spurious changes to the repository in order to experiment to fins out if it's only .jars, or only THAT .jar, or whatever. But it's very worrisome to have an unexplained failure in the build -- when this stuff goes live it'll be very bad to have it break at midnight like this!
I'm using Windows XP; I think the CVS repository is on a unix machine, but I don't honestly know (and I don't have access to that machine). I have Ant 1.7.0. What could have gone wrong with the CVS task, and what can I do to get more information about the problem? I hate mysterious messages!
Judy Anderson
Rocket Software
janderson@rocketsoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
RE: CVS task failure: cannot rename
Posted by Judy Anderson <JA...@rocketsoftware.com>.
I have done some more experimentation with my problem. It only happens on binary files (flag "-kb"). CVS is doing a different kind of update that involves delete/rename. I tried using <exec> on cvs with no help.
It seems that, although I can "del" such a file manually, I cannot use ant's <delete> task on one. So perhaps the problem is unrelated to CVS (well, excepting that the file was created by CVS.)
<delete file="c:/bt/mainline/bundle/bundle.jar"/>
[delete] Deleting: c:\bt\mainline\bundle\bundle.jar
BUILD FAILED
build.xml:9: Unable to delete file c:\bt\mainline\bundle\bundle.jar
So, now I wonder if there's some weirdness within Ant about user permissions. I can delete a file I created by hand. I cannot see any interesting difference in the Properties dialog for either of these files in the explorer. (The CVS created files have a "Summary" tab, but my files don't. It is blank.) I'm really mystified. I wish that I had the Windows error code that led the <delete> task to decide it could not delete the file.
-----Original Message-----
From: Judy Anderson [mailto:JAnderson@rocketsoftware.com]
Sent: Monday, December 24, 2007 3:53 PM
To: user@ant.apache.org
Subject: CVS task failure: cannot rename
I am a new user of ANT, and the first problem I've been unable to solve on my own is a CVS problem. (I didn't construct the build.xml file myself; I was handed an incomplete project, on which I'm trying to come up to speed.)
<property name="cvs.quiet" value="true"/>
<macrodef name="cvs-checkout">
<attribute name="package"/>
<sequential>
<cvs cvsRoot=":pserver:${env.USERNAME}@rscvs02.rocketsoftware.com:/cvs/kbm" passfile="${env.CVS_PASSFILE}" package="@{package}" failonerror="true" output="@{package}.cvs.log" quiet="${cvs.quiet}"/>
...
<target name="cvs-checkout-bundle">
<cvs-checkout package="bundle"/>
</target>
Results in:
[cvs] cvs [checkout aborted]: cannot rename file .new.emp-common.jar to emp-common.jar: File exists
BUILD FAILED
However, when I use CVS update directly it works just fine.
The mentioned log file has a nice U line for the mentioned file (though as you see it didn't fully get updated.) I passed in -Dcvs.quiet=false but that just showed me "[cvs] cvs checkout: Updating" lines for each prior directory, as one would expect.
Searching for similar error messages found me other people who had cannot renames with Permission Denied, but that's not my problem. One person with CVS problems recommended using an EXEC task instead, which I'm considering, but wanted to see if there was any suggestion to how to debug this using the CVS task.
Extremely strangely, .java files got updated when I ran it on a different package. Now, unfortunately, I can't make spurious changes to the repository in order to experiment to fins out if it's only .jars, or only THAT .jar, or whatever. But it's very worrisome to have an unexplained failure in the build -- when this stuff goes live it'll be very bad to have it break at midnight like this!
I'm using Windows XP; I think the CVS repository is on a unix machine, but I don't honestly know (and I don't have access to that machine). I have Ant 1.7.0. What could have gone wrong with the CVS task, and what can I do to get more information about the problem? I hate mysterious messages!
Judy Anderson
Rocket Software
janderson@rocketsoftware.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org