<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I'm using Buildbot version: 1.3.0. Is there a way to perform a
specific ShellCommand as a preface for the shell of a subsequent
ShellCommand or for multiple, subsequent ShellCommands?<br>
<br>
I'd like a Step or set of Steps to perform the following sequence of
commands on our Linux-based builders:
<p><font face="Courier New, Courier, monospace">module load intel</font></p>
<p><font face="Courier New, Courier, monospace">cmake
-DCMAKE_Fortran_COMPILER=ifort ../</font><font face="Courier
New, Courier, monospace"><font face="Courier New, Courier,
monospace">prj</font>/my_project</font></p>
<p><font face="Courier New, Courier, monospace">make all</font></p>
<p>The first command here prepares the environment (PATH and
LD_LIBRARY_PATH) and possibly makes some other changes to select
the desired version of, and acquire the floating license for, the
compiler used by the two subsequent commands.</p>
<p>The step needs have haltOnFailure=False for the first command,
but haltOnFailure=True for the two subsequent commands.</p>
<p>The option to use <br>
</p>
<p><font face="Courier New, Courier, monospace">steps.ShellCommand(</font></p>
<p><font face="Courier New, Courier, monospace"> command=['module',
'load', 'intel',</font></p>
<p><font face="Courier New, Courier, monospace"> ';',</font></p>
<p><font face="Courier New, Courier, monospace"> 'cmake', '-DCMAKE_Fortran_COMPILER=ifort',
'../prj/my_project'],</font></p>
<p><font face="Courier New, Courier, monospace">
haltOnFailure=True)</font></p>
<p>and <br>
</p>
<p><font face="Courier New, Courier, monospace">steps.ShellCommand(</font></p>
<p><font face="Courier New, Courier, monospace">
command=['module', 'load', 'intel',</font></p>
<p><font face="Courier New, Courier, monospace"> ';',</font></p>
<p><font face="Courier New, Courier, monospace"> 'make',
'all'],</font></p>
<p><font face="Courier New, Courier, monospace">
haltOnFailure=True)</font></p>
<p><font face="Courier New, Courier, monospace"><font face="Courier
New, Courier, monospace"><br>
</font> </font></p>
<p>has the problem that the haltOnFailure=True applies to the first
command (module load intel) as well as the subsequent command,
which is not desired.</p>
<p>Another option, to use</p>
<p><font face="Courier New, Courier, monospace">steps.ShellSequence(commands
= [</font></p>
<p><font face="Courier New, Courier, monospace">
util.ShellArg(command = ['module', 'load', 'intel'],
haltOnFailure=False),</font></p>
<p><font face="Courier New, Courier, monospace">
util.ShellArg(command = ['cmake',
'-DCMAKE_Fortran_COMPILER=ifort', '../prj/my_project'],
haltOnFailure=True),</font></p>
<p><font face="Courier New, Courier, monospace">
util.ShellArg(command = ['make', 'all'], haltOnFailure=True),</font></p>
<p><font face="Courier New, Courier, monospace"> ])</font><br>
</p>
<p>has the problem that the preparation of the shell environment by
the first <font face="Courier New, Courier, monospace">ShellArg</font>
does not apply to the next two <font face="Courier New, Courier,
monospace">ShellArg</font>s.<br>
</p>
<p>Is there some adjust to either of these options to get what I
need? Or is there some other way to get what I need?</p>
<p>If there were a way to set the Builder so the '<font
face="Courier New, Courier, monospace">module load intel</font>'
command automatically applies to all its build steps, that would
suffice for my purposes. <br>
</p>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
Greg Bullock
NorthWest Research Associates
301 Webster St.
Monterey, CA 93940
(831) 582-4907
<a class="moz-txt-link-abbreviated" href="mailto:greg@nwra.com">greg@nwra.com</a>
</pre>
</body>
</html>