为什么Jenkins在使用MSBuild时忽略%PATH%变量? [英] Why is Jenkins ignoring the %PATH% variable when using MSBuild?

查看:232
本文介绍了为什么Jenkins在使用MSBuild时忽略%PATH%变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用Jenkins来编译我用Delphi创建的MSBuild项目。我将MSBuild插件安装到Jenkins并进行配置。我正在为我的构建作业选择具体的配置。

I am trying to use Jenkins to compile my MSBuild project created with Delphi. I have the MSBuild plugin installed into Jenkins and configured. I'm choosing the specific configuration for my build job.

我已经设置了所有Delphi编译器所需的Jenkins环境变量(从rsvars.bat为你Delphi类型。)

I have set all the environmental variables in Jenkins that are required by the Delphi compiler (from rsvars.bat for you Delphi types.)

该项目在命令行上编译得很好。如果我在命令行上执行,MSBuild会报告一个不错的大胖PATH(正确的)作为用于调用Delphi编译器的命令行的一部分。

The project compiles just fine on the command line. If I do it on the command line, MSBuild reports a nice big fat PATH (the correct one) as part of the command line it uses to call the Delphi compiler.

但是,当我尝试使用Jenkins时,结果是完全不同的:

However, when I try to use it with Jenkins, the result is quite different:

C:\Program Files (x86)\Embarcadero\RAD Studio\8.0\bin\dcc32.exe -$D- -$L- -$Y- --no-config -B -Q -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DRELEASE -K00400000   HTMLWriterTestApp.dpr   
  Embarcadero Delphi for Win32 compiler version 22.0
  Copyright (c) 1983,2010 Embarcadero Technologies, Inc.



。这个信息是从命令行运行的。

Noet the complete lack of a path, or any other information about were to find what the compiler needs. This information is there when I run from the command line.

任何人都可以想到为什么詹金斯无法得到正确的PATH信息?

Can anyone think of any reason why Jenkins is failing to get the correct PATH information?

推荐答案

根据您运行Jenkins的方式,可能没有您习惯看到的完整路径。例如,如果您将Jenkins作为Windows服务运行并且填充了您的USERS PATH变量,则不一定会为SYSTEM用户填充。在这种情况下,请将服务使用的登录帐户修改为您的帐户,而不是系统帐户。

Depending on how you run Jenkins, it may not have the full path line that you are used to seeing. For example, if you run Jenkins as a Windows Service and have your USERS PATH variable populated, you won't necessarily have it populated for the SYSTEM user. In this case, modify the Logon Account used by the Service to be your account, rather than a system one.

这篇关于为什么Jenkins在使用MSBuild时忽略%PATH%变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆