diff --git a/litsupport/modules/profilegen.py b/litsupport/modules/profilegen.py --- a/litsupport/modules/profilegen.py +++ b/litsupport/modules/profilegen.py @@ -7,9 +7,10 @@ """Adjust runscript to set a different value to the LLVM_PROFILE_FILE environment variable for each execution.""" profilefile = context.tmpBase + ".profraw" - prefix = "env LLVM_PROFILE_FILE=%s " % profilefile context.profilefiles.append(profilefile) - return prefix + commandline + cmd = shellcommand.parse(commandline) + cmd.envvars.update({"LLVM_PROFILE_FILE": profilefile}) + return cmd.toCommandline() def _mutateScript(context, script): diff --git a/litsupport/shellcommand.py b/litsupport/shellcommand.py --- a/litsupport/shellcommand.py +++ b/litsupport/shellcommand.py @@ -32,12 +32,12 @@ if self.workdir is not None: result += "cd %s && " % quote(self.workdir) - res_list = [self.executable] + self.arguments - result += " ".join(map(quote, res_list)) - for key, value in self.envvars.items(): result += "%s=%s " % (key, quote(value)) + res_list = [self.executable] + self.arguments + result += " ".join(map(quote, res_list)) + if self.stdin is not None: result += " < %s" % quote(self.stdin) if self.stdout is not None: