<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Jan 4, 2016, at 1:50 PM, Chris Spencer <<a href="mailto:chrisspen@gmail.com" class="">chrisspen@gmail.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">How do you configure a builder to run a specific script in your source?<br class=""><br class="">I have a "runtests" script in my code which creates the Python virtualenv, creates an in-memory test database, and runs all unittests, but when I enter a builder command like "cd src/myproject; runtests", I get the error:<br class=""><br class="">    Upon execvpe cd src/myproject; ./runtests ['cd src/myproject; ./runtests'] in environment id 140610380051352<br class="">    :Traceback (most recent call last):<br class="">      File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 403, in _fork<br class="">        path, uid, gid, executable, args, environment)<br class="">      File "/usr/lib/python2.7/dist-packages/twisted/internet/process.py", line 453, in _execChild<br class="">        os.execvpe(executable, args, environment)<br class="">      File "/usr/lib/python2.7/os.py", line 353, in execvpe<br class="">        _execvpe(file, args, env)<br class="">      File "/usr/lib/python2.7/os.py", line 368, in _execvpe<br class="">        func(file, *argrest)<br class="">    OSError: [Errno 2] No such file or directory<br class=""></div></div></div></div></blockquote><div class=""><div dir="ltr" class=""><div class=""><div class=""><br class=""></div><div class="">This is subtle, but it's the first item addressed here: <a href="http://trac.buildbot.net/wiki/FAQ" class="">http://trac.buildbot.net/wiki/FAQ</a></div><div class=""><br class=""></div><div class="">The third question clarifies the "command=" parameter: passing a Python string is like calling system(): good for simple commands, but can break in unexpected ways. If you enclose the string in a list, it's more like calling exec*(), where you are specifying the contents of argv[].</div><div class=""><br class=""></div></div></div></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">presumably because Buildbot's default CWD is not the same as my code's clone directory.<br class=""></div><div class=""><br class=""></div>The tutorial (<a href="http://docs.buildbot.net/current/tutorial/tour.html" class="">http://docs.buildbot.net/current/tutorial/tour.html</a>) is a little confusing. It calls "trial pyflakes", which is a globally-accessible command, so it's not clear how Buildbot knows where anything is. How do I construct my command to reference Buildbot's CWD and the location where it checks-out my code?<br class=""></div></div></div></blockquote></div><div class=""><br class=""></div><div class="">I'm not sure where in the documentation this is more formally specified, but in 0.8.x, the initial working directory for a ShellCommand is 'build' under the directory listed in the 'workdir' property. If in doubt as to what this expands to, check the stdio log for the step. This should be mostly transparent once the command parameter above is fixed.</div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div class="">-- </div><div class="">Charles Lepple</div><div class="">clepple@gmail</div><div class=""><br class=""></div></span><br class="Apple-interchange-newline">

</div>
<br class=""></body></html>