1

这是我当前设置的简要说明。我们用

Git:修订控制系统 Phabricator:代码审查 Jenkins:用于持续集成和运行构建。插件:Phabricator 微分,windows slaves 插件

Jenkins 设置有一个 linux master 和 windows & Mac Slaves。我还在项目上启用了 Phabricator Differential,并在所有 Jenkins 节点上安装了奥术师。

在运行 Windows 项目时,构建失败并显示以下错误消息,指出它无法arc在指定的文件夹中找到。但是我可以从文件夹手动运行 arc,我确保环境变量设置正确。有没有人之前遇到过这个问题吗?

 `The system cannot find the file specified
    FATAL: command execution failed
    java.io.IOException: Cannot run program "sh" (in directory "C:\Users\Jenkins\workspace\windows_project"): CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at hudson.Proc$LocalProc.<init>(Proc.java:244)
        at hudson.Proc$LocalProc.<init>(Proc.java:216)
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
        at hudson.Launcher$ProcStarter.start(Launcher.java:382)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
        at hudson.remoting.UserRequest.perform(UserRequest.java:121)
        at hudson.remoting.UserRequest.perform(UserRequest.java:49)
        at hudson.remoting.Request$2.run(Request.java:325)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at hudson.remoting.Engine$1$1.run(Engine.java:69)
        at java.lang.Thread.run(Thread.java:745)
        at ......remote call to winbuild2(Native Method)
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1361)
        at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
        at hudson.remoting.Channel.call(Channel.java:753)
        at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929)
        at hudson.Launcher$ProcStarter.start(Launcher.java:382)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
        at hudson.model.Build$BuildExecution.build(Build.java:205)
        at hudson.model.Build$BuildExecution.doRun(Build.java:162)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
        at hudson.model.Run.execute(Run.java:1744)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:374)
    Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        at hudson.Proc$LocalProc.<init>(Proc.java:244)
        at hudson.Proc$LocalProc.<init>(Proc.java:216)
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
        at hudson.Launcher$ProcStarter.start(Launcher.java:382)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114)
        at hudson.remoting.UserRequest.perform(UserRequest.java:121)
        at hudson.remoting.UserRequest.perform(UserRequest.java:49)
        at hudson.remoting.Request$2.run(Request.java:325)`

弧错误信息:

[windows_box_testing] $ arc call-conduit differential.querydiffs
The system cannot find the file specified
FATAL: Cannot run program "arc" (in directory "C:\Users\Jenkins\workspace\windows_box_testing"): CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "arc" (in directory "C:\Users\Jenkins\workspace\windows_box_testing"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
4

1 回答 1

0

正如安德斯所说,日志显示Cannot run program "sh". 当你arc在盒子上运行时,你是从 Windows 命令提示符运行它还是打开一个类似 linux 的 shell。

例如,当我需要arc在 Windows 上运行命令时,在登录时,我通常会启动 Git Bash,它确实有一个 sh 版本。然而,为了让那台机器启动并作为一个带有 arc 的构建服务器,我需要安装 Cygwin 并让 Jenkins 在那里运行脚本。

我希望这有帮助。

于 2016-01-20T15:35:34.473 回答