|
|
|
[
Permlink
| « Hide
]
Robin Shen [29/Sep/10 12:36 AM]
Working directory of batch/shell build step will not used to search executables as explained in the property description. If you substitute the command with "cmd /c build.cmd", the step will succeed even without prepending the full path.
Yesh, you're right about .cmd
But actual problem was I could not run .exe-file. Example above was simplified attempt to reproduce the problem. Replace command of first step (see above step2 ) "cmd /c copy d:\temp\BeelineBillAnalysisTests.exe ." (w/o quotes) So we take known file (console test application in this case) and copy it to configuration workspace (we can replace this with building of an app to workspace dir but for the test I don't wanna wait until application is built) And then command of step 2 (see above step 3) is "BeelineBillAnalysisTests.exe" and we've got 10:21:47,206 [master>run-on-node@NEAN2:8811] INFO - Fetching input files... 10:21:47,347 [master>run-on-node@NEAN2:8811] INFO - Running step... 10:21:47,349 [master>run-on-node@NEAN2:8811] DEBUG - Executing command: BeelineBillAnalysisTests.exe 10:21:47,350 [master>run-on-node@NEAN2:8811] DEBUG - Command working directory: D:\Program Files\QBuildAgent\workspace\root\test-nodes 10:21:47,353 [master>run-on-node@NEAN2:8811] INFO - Executing post-execute script... 10:21:47,354 [master>run-on-node@NEAN2:8811] ERROR - Step 'run-on-node' is failed. java.lang.RuntimeException: java.io.IOException: Cannot run program "BeelineBillAnalysisTests.exe" (in directory "D:\Program Files\QBuildAgent\workspace\root\test-nodes"): CreateProcess error=2, ?? ??????? ????? ????????? ???? at com.pmease.quickbuild.execution.CommandExecutor.runAndGetResult(CommandExecutor.java:215) at com.pmease.quickbuild.plugin.basis.CommandBuildStep.run(CommandBuildStep.java:228) at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$68f44831.CGLIB$run$11(<generated>) at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$68f44831$$FastClassByCGLIB$$c5bbde35.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215) at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:271) at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$68f44831.run(<generated>) at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:449) at com.pmease.quickbuild.stepsupport.StepJob.execute(StepJob.java:34) at com.pmease.quickbuild.grid.GridJob.run(GridJob.java:120) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Cannot run program "BeelineBillAnalysisTests.exe" (in directory "D:\Program Files\QBuildAgent\workspace\root\test-nodes"): CreateProcess error=2, ?? ??????? ????? ????????? ???? at java.lang.ProcessBuilder.start(Unknown Source) at com.pmease.quickbuild.execution.CommandExecutor.runAndGetResult(CommandExecutor.java:213) ... 10 more Caused by: java.io.IOException: CreateProcess error=2, ?? ??????? ????? ????????? ???? at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 12 more Is it expected behaviour? As for me it is not And, yes, it works again "cmd /c BeelineBillAnalysisTests.exe" but it is a workaround, is not it? What am I missing? Why application cannot be run in a current folder without command shell? The reason behind this is that the current directory specified for command is not included (which is a JDK ProcessBuilder limitation) in PATH to search for command itself. The workflow is to find command first then set its working directory.
We can probably enhance QuickBuild to prefix the command with path of working directory automatically to make it less confusing.
|