[Scons-users] chdir and parallel builds

Brian Cody brian.j.cody at gmail.com
Tue Jul 7 09:27:56 EDT 2015


Yeah, it's broken as far as we're concerned. I'm not sure why it doesn't
work this way inside SCons, but we have a workarounds module with this
function:

def execute_in_directory(env, dir, command, shell=False):
    # http://scons.tigris.org/issues/show_bug.cgi?id=2597
    proc = subprocess.Popen(command, env=_get_current_environment(env),
cwd=dir, shell=shell)
    return proc.wait()

def _get_current_environment(env):
    asciienv = {}
    for key in env['ENV']:
        asciienv[key] = str(env['ENV'][key])
    if not isinstance(env['ENV']['PATH'], basestring):
        asciienv['PATH'] = os.pathsep.join(env['ENV']['PATH'])
    return asciienv

If there's an easier way...

On Tue, Jul 7, 2015 at 9:23 AM, Ora <orshalev at gmail.com> wrote:

> Hi,
>
> I'm having trouble using the chdir parameter when using the parallel build
> option (-j).
>
> Scons changes the directory properly, but does not change it back
> immediately when the builder finishes.
>
> At this stage in the build, the builders are called sequentially, with
> each one requiring the result of the previous build in order to advance to
> the next one, but the directory is only changed back a couple of builders
> down the line.
>
> Is there a way around this problem?
>
>
> Thanks,
> Ora
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150707/ff8e75aa/attachment.html>


More information about the Scons-users mailing list