It's all about the answers!

Ask a question

Build scripts fails via RTC build definition but passes when invoked manually.


Kamal Sharma (131) | asked Mar 16 '17, 1:56 a.m.

 I have a .CMD file which when run on build server, works perfectly fine.

I have now created a RTC build definition in which i am trying to call the above .cmd file.
When i am requesting a personal build using above build definition, it fails with this error

Trouble initializing at D:\RTCsandbox2\XX\build....\Build\Engine\Src\ScmExec.pl line 427
Error: Unable to initialize file
Can't open perl script ".\YY\ZZ.pl": No such file or directory
Developer build script finished with errors
Build failed. Exit value was 1.

When i checked build scripts, it seems to be trying to set environment variable and may be unable to do so, resulting in not able to find files. This is happening when invoking build scripts via RTC build definition.
Manually it works fine. 
Any pointers will be helpful, thanks in advance.

Accepted answer


permanent link
Donald Nong (14.4k314) | answered Mar 17 '17, 4:13 a.m.

I believe this issue is similar to this post.
https://jazz.net/forum/questions/236871/how-to-specify-the-build-script-directory

Basically, if your script calls other scripts using relative paths, you need to make sure the current working directory is the correct one.

Kamal Sharma selected this answer as the correct answer

Comments
Kamal Sharma commented Mar 20 '17, 3:40 a.m.

 Thanks Donald Nong. As you informed, My RTC Build definition was not pointing to correct working directory. Working fine now. thanks again.


One other answer



permanent link
Lily Wang (4.9k714) | answered Mar 17 '17, 1:54 a.m.

From the information you provided, I could not see why the error is related to the environment variable. Is the full path of the perl script ".\YY\ZZ.pl" set by an environment variable?
In that case, you may add some debug in your build script to check if the environment variable is set properly. You can also add a build property in the build definition and configure the "Environment variables" in the "Command Line" tab of the build definition.

Your answer


Register or to post your answer.