It's all about the answers!

Ask a question

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

Kamal Sharma (132) | 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\ line 427
Error: Unable to initialize file
Can't open perl script ".\YY\": 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.5k414) | answered Mar 17 '17, 4:13 a.m.

I believe this issue is similar to this post.

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

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\" 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.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.