0

Can someone help in solving this error that i am getting while doing build.

7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: The "CustomBuild" task failed unexpectedly.

7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: System.IO.IOException: The process cannot access the file 'C:\Users\corrsha\AppData\Local\Temp\tmp6360215f89e24e42a21d91b81f09e212.cmd' because it is being used by another process. 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: at System.IO.File.InternalDelete(String path, Boolean checkHost) 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: at System.IO.File.Delete(String path) 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.Execute() 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute() 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 7>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

this is part of the jenkinsfile that i am using that is checked by the buildserver during the build `

    stage('clean workspace')

    stage('build')
    {
        bat '''
            call "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat" x86
        set REPO_VERSION=%BUILD_NUMBER%
            cd win32
            mkdir build
            cd build        
            "C:\\Program Files (x86)\\CMake\\bin\\cmake.exe" -G "Visual Studio 10 2010" -DCMAKE_INSTALL_PREFIX:PATH=D:/Jenkins_Workspace/UnifiedAutomationsdk_Test -DVERSION_PATCH=1 -DREPO_VERSION=%REPO_VERSION% -DSYSTEM_NAME=windows ..\\UaSdkCppBundleSource
            rem MSBuild INSTALL.vcxproj /p:Configuration=Debug 
            rem MSBuild PACKAGE.vcxproj /p:Configuration=Debug /verbosity:detailed
            MSBuild INSTALL.vcxproj /p:Configuration=Release
            MSBuild PACKAGE.vcxproj /p:Configuration=Release /verbosity:detailed
        '''`

It keeps throwing this error even if i try to build locally. But a colleague of mine tried from his system to build locally and the build succeeded. I am at a loss. Please help.

JenkinsNewbie1989
  • 91
  • 1
  • 3
  • 15
  • 1
    Possible duplicate of [The process cannot access the file because it is being used by another process](https://stackoverflow.com/questions/877889/the-process-cannot-access-the-file-because-it-is-being-used-by-another-process) – Melebius Jun 22 '17 at 10:26
  • This is not a duplicate of these other issues unfortunately. My colleague is able to successfully build using the same binaries but i keep getting these errors.I am really at a loss now. I tried checking my permissions. I have full permissions on all these files. I tried deleting the file that is locking and doing build again. Again the build gets failed with the same error. what could I have differently on my system that makes it impossible to do this build. Even the jenkins build gets the same error. – JenkinsNewbie1989 Jul 03 '17 at 11:33
  • Do you do parallel builds? Meaning do you have more then one build executor in Jenkins? – Florian Jul 05 '17 at 07:25
  • no parallel builds. its just one executor. – JenkinsNewbie1989 Jul 05 '17 at 13:44
  • @JenkinsNewbie1989 have you solve this? I am literally having the same issue. Sometimes I try to build and it builds fine, sometimes it doesn't. Same in jenkins. – Daniel Santos Jul 20 '17 at 17:33
  • This issue cleared of once added CMAKE_SUPPRESS_REGENERATION=true on the cmake command syntax . this will cause CMake to not put in the rules that re-run CMake. This might be useful if you want to use the generated build files on another machine. I hope that works for you also. Good luck. – JenkinsNewbie1989 Aug 03 '17 at 07:34

1 Answers1

0

This file "C:\Users\SVC-jenkins-build\AppData\Local\Temp\tmp543d2674154c40a7943c76bcf0dce710.cmd" is beign used by some process and cannot be replaced. close/delete it manually. Also try to close and reopen VS.

igorc
  • 2,024
  • 2
  • 17
  • 29