diff --git a/llvm/utils/collect_and_build_with_pgo.py b/llvm/utils/collect_and_build_with_pgo.py --- a/llvm/utils/collect_and_build_with_pgo.py +++ b/llvm/utils/collect_and_build_with_pgo.py @@ -164,8 +164,8 @@ cwd=None, check=False, silent_unless_error=False): - print( - 'Running `%s` in %s' % (cmd, shlex.quote(cwd or os.getcwd()))) + print('(cd %s && %s)' % (shlex.quote(cwd or os.getcwd()), + ' '.join([shlex.quote(arg) for arg in cmd]))) if self.dry_run: return @@ -236,7 +236,10 @@ def _run_fresh_cmake(env, cmake, target_dir): - if not env.dry_run: + if env.dry_run: + print('rm -rf %s' % shlex.quote(target_dir)) + print('mkdir -p %s' % shlex.quote(target_dir)) + else: try: shutil.rmtree(target_dir) except FileNotFoundError: