def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): cmd = cmd or [exe_path] env_cmd = [] if env: env_cmd += ['env'] env_cmd += ['%s=%s' % (k, v) for k, v in env.items()] if work_dir == '.': work_dir = os.getcwd() if not self.is_windows: out, err, rc = executeCommand(env_cmd + cmd, cwd=work_dir) else: out, err, rc = executeCommand(cmd, cwd=work_dir, env=self._build_windows_env(env)) return (env_cmd + cmd, out, err, rc)
def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): # import pprint # pprint.pprint(vars(self)) # pprint.pprint(vars(self.config)) # pprint.pprint(vars(self.config.lit_config)) # pprint.pprint(vars(self.config.config)) # print "exe_path=", exe_path, "cmd=", cmd, "cwd=", work_dir, "file_deps=", file_deps, "env=", env # if env is not None: # self.config.lit_config.warning('Cannot handle env yet: ' + str(env)) if file_deps: return cmd, str(file_deps), 'Cannot handle file_deps yet', 7 if cmd is not None and cmd != [exe_path]: return cmd, cmd, 'Cannot handle extra cmd args yet', 7 exe_path = os.path.realpath(exe_path) test_exec_root = os.path.realpath(self.config.config.test_exec_root) assert exe_path.startswith(test_exec_root), exe_path + " doesn't start with " + str(test_exec_root) suffix = os.path.relpath(exe_path, test_exec_root) target = os.path.join(self.target_dir, suffix) if not os.path.isdir(os.path.dirname(target)): try: os.makedirs(os.path.dirname(target)) except OSError as e: if e.errno == errno.EEXIST: pass # concurrent TOCTOU else: raise cp_cmd = ["cp", "-f", exe_path, target] out, err, rc = executeCommand(cp_cmd) return cp_cmd, out, err, rc
def add_cxx_flags(self, flags): out, err, exit_code = executeCommand(['xcrun', '--show-sdk-path']) if exit_code != 0: self.full_config.lit_config.warning("Could not determine macOS SDK path! stderr was " + err) if exit_code == 0 and out: sdk_path = out.strip() self.full_config.lit_config.note('using SDKROOT: %r' % sdk_path) assert isinstance(sdk_path, str) flags += ["-isysroot", sdk_path]
def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): cmd = cmd or [exe_path] if work_dir == '.': work_dir = os.getcwd() if env: env = self.merge_environments(os.environ, env) out, err, rc = executeCommand(cmd, cwd=work_dir, env=env) return (cmd, out, err, rc)
def add_cxx_compile_flags(self, flags): if self.full_config.use_deployment: _, name, _ = self.full_config.config.deployment cmd = ['xcrun', '--sdk', name, '--show-sdk-path'] else: cmd = ['xcrun', '--show-sdk-path'] out, err, exit_code = executeCommand(cmd) if exit_code != 0: self.full_config.lit_config.warning("Could not determine macOS SDK path! stderr was " + err) if exit_code == 0 and out: sdk_path = out.strip() self.full_config.lit_config.note('using SDKROOT: %r' % sdk_path) assert isinstance(sdk_path, str) flags += ["-isysroot", sdk_path]
def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): cmd = cmd or [exe_path] if work_dir == '.': work_dir = os.getcwd() if env: env = self.merge_environments(os.environ, env) for dep in file_deps: if os.path.isdir(dep): shutil.copytree(dep, os.path.join(work_dir, os.path.basename(dep)), symlinks=True) else: shutil.copy2(dep, work_dir) out, err, rc = executeCommand(cmd, cwd=work_dir, env=env) return (cmd, out, err, rc)
def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None): cmd = cmd or [exe_path] if work_dir == '.': work_dir = os.getcwd() out, err, rc = executeCommand(cmd, cwd=work_dir, env=env) return (cmd, out, err, rc)