nAnt integration and Source vault permissions
Moderator: SourceGear
-
- Posts: 18
- Joined: Tue Mar 23, 2004 7:39 pm
nAnt integration and Source vault permissions
I have integrated CC.NET, nAnt, and our Sourcevault repository fine except for one final permissions issue. I have a nAnt build script that will properly build the solution if all the files are in the working directory already, so I know the build script works. The problem is when I retrieve the latest source code through Vault programaticaly. nAnt will properly connect to Vault, download the source, build the project fine, but then fail when trying to write the .DLL and .PDB files.
If I set the permissions properly it will work building locally, but the second that I get the latest source it seems that the permissions get reset and then the files can't be written. Is there any settings in vault that can leave these two files to be not read only?
Thanks,
Christian
If I set the permissions properly it will work building locally, but the second that I get the latest source it seems that the permissions get reset and then the files can't be written. Is there any settings in vault that can leave these two files to be not read only?
Thanks,
Christian
-
- Posts: 18
- Joined: Tue Mar 23, 2004 7:39 pm
-
- Posts: 18
- Joined: Tue Mar 23, 2004 7:39 pm
OK, I propery added the -makewritable option and set the mergefile to overwrite as well. I am still getting the unable to write the projectname.dll to the directory even though everything else builds fine. I can use nAnt to build it fine once I manually change the permissions on the folder, but once I do another checkout from Sourcevault it fails again with "unable to write file" errors.
Is this .dll being used in a test or generated by a build? My guess is the error is not related to the "read-only" file attribute, but that the file is locked because it is in use by another application.
See if you can find out if any processes are still running which may have the file locked.
See if you can find out if any processes are still running which may have the file locked.
Jeff Clausius
SourceGear
SourceGear
-
- Posts: 18
- Joined: Tue Mar 23, 2004 7:39 pm
Here is the build output from the nAnt script:
This is the output when I check out the source prior to building. If I check out the source, and then change the folder permissions and build it works fine. But when I check out the source again it will not build bcause the permissions seem to be getting reset. The only thing that I am doing is building the solution, there are no tests being run. Thanks for the reply.
-------------
ignored
[compile] vbc : error BC31019: Unable to write to output file
'E:\EscapeHomes\SiteRoot\latest\DotNetNuke.dll': Access is denied.
[compile] vbc : error BC31019: Unable to write to output file
'E:\EscapeHomes\SiteRoot\latest\DotNetNuke.pdb': Access is denied.
[solution] Build failed.
[solution] Project 'dotnetnuke2' failed!
[solution] Continuing build with non-dependent projects.
[Core.Task:solution Generated Exception - [] <>]
Exception: NAnt.Core.BuildException
Message: E:\EscapeHomes\SiteRoot\TestNuke.build(39,6):
Project build failed.
Source: NAnt.VSNetTasks
at NAnt.VSNet.Tasks.SolutionTask.ExecuteTask()
at NAnt.Core.Task.Execute()
[Core.Project:Build failed. - [] <>]
Exception: NAnt.Core.BuildException
Message: E:\EscapeHomes\SiteRoot\TestNuke.build(39,6):
Project build failed.
Source: NAnt.VSNetTasks
at NAnt.VSNet.Tasks.SolutionTask.ExecuteTask()
at NAnt.Core.Task.Execute()
This is the output when I check out the source prior to building. If I check out the source, and then change the folder permissions and build it works fine. But when I check out the source again it will not build bcause the permissions seem to be getting reset. The only thing that I am doing is building the solution, there are no tests being run. Thanks for the reply.
-------------
ignored
[compile] vbc : error BC31019: Unable to write to output file
'E:\EscapeHomes\SiteRoot\latest\DotNetNuke.dll': Access is denied.
[compile] vbc : error BC31019: Unable to write to output file
'E:\EscapeHomes\SiteRoot\latest\DotNetNuke.pdb': Access is denied.
[solution] Build failed.
[solution] Project 'dotnetnuke2' failed!
[solution] Continuing build with non-dependent projects.
[Core.Task:solution Generated Exception - [] <>]
Exception: NAnt.Core.BuildException
Message: E:\EscapeHomes\SiteRoot\TestNuke.build(39,6):
Project build failed.
Source: NAnt.VSNetTasks
at NAnt.VSNet.Tasks.SolutionTask.ExecuteTask()
at NAnt.Core.Task.Execute()
[Core.Project:Build failed. - [] <>]
Exception: NAnt.Core.BuildException
Message: E:\EscapeHomes\SiteRoot\TestNuke.build(39,6):
Project build failed.
Source: NAnt.VSNetTasks
at NAnt.VSNet.Tasks.SolutionTask.ExecuteTask()
at NAnt.Core.Task.Execute()
-
- Posts: 18
- Joined: Tue Mar 23, 2004 7:39 pm
Here is the thing. This build directory is not the working /bin directory of the site. The following is the repeatable behavior of my actions with the build:
1. If change the "Read Only" property of the ouput directory to be not read only, the nAnt scripts work perfectly and the solution gets built.
2. When I get the latest version of the solution from vault, it seems to set the directory to be "Read Only" again, and then the build fails with the permissions issue. If I manually check out the files and the manually uncheck the "Read Only" box then the dlls can be copied and everything works fine.
There is no debugging process going on the server at the time. VS.NET is not even running.
Thank you for your suggestions. Any other ideas? Please let me know if you need additional information.
Thanks,
Christian
1. If change the "Read Only" property of the ouput directory to be not read only, the nAnt scripts work perfectly and the solution gets built.
2. When I get the latest version of the solution from vault, it seems to set the directory to be "Read Only" again, and then the build fails with the permissions issue. If I manually check out the files and the manually uncheck the "Read Only" box then the dlls can be copied and everything works fine.
There is no debugging process going on the server at the time. VS.NET is not even running.
Thank you for your suggestions. Any other ideas? Please let me know if you need additional information.
Thanks,
Christian
OK. So, if the build directory is not where the binaries are being run from, then it is probably a red-herring to suggest a process is locking the files.
Do you happen to know if Vault nAnt even supports the -makewritable flag? Perhaps the problem is with the nAnt task itself? The Vault nAnt tasks were written outside of SourceGear, so I wonder if looking in there would help?
FWIW, I just tried the following Command Line Client:It did get the files with the read-only attribute unset.
Do you happen to know if Vault nAnt even supports the -makewritable flag? Perhaps the problem is with the nAnt task itself? The Vault nAnt tasks were written outside of SourceGear, so I wonder if looking in there would help?
FWIW, I just tried the following Command Line Client:
Code: Select all
vault GET $/something -makewritable -user me -pass pass -server server -repository rep
Jeff Clausius
SourceGear
SourceGear
-
- Posts: 18
- Joined: Tue Mar 23, 2004 7:39 pm
Thanks, but I am not using the specific Vault tasks. I am just calling the generic vault.exe from a target. I am currently working on something that can change the directories permissions from the command line just after checking out the files and just prior to building the solution.
<target name="update">
<ifnot propertyexists="vault.executable">
<fail message="vault.executable property not set, so can't update" />
</ifnot>
<echo message="Vault Executable at [${vault.executable}]" />
<exec basedir="." program="${vault.executable}" commandline="GET $/DotNetNuke -host xxx.latitude38n.com -username xxx -password xxxx -repository EscapeHomes -destpath E:\EscapeHomes\siteroot\ -merge overwrite -makewritable" />
</target
<target name="update">
<ifnot propertyexists="vault.executable">
<fail message="vault.executable property not set, so can't update" />
</ifnot>
<echo message="Vault Executable at [${vault.executable}]" />
<exec basedir="." program="${vault.executable}" commandline="GET $/DotNetNuke -host xxx.latitude38n.com -username xxx -password xxxx -repository EscapeHomes -destpath E:\EscapeHomes\siteroot\ -merge overwrite -makewritable" />
</target