diff --git a/bolt/utils/nfc-check-setup.py b/bolt/utils/nfc-check-setup.py --- a/bolt/utils/nfc-check-setup.py +++ b/bolt/utils/nfc-check-setup.py @@ -61,6 +61,8 @@ subprocess.run( shlex.split("cmake --build . --target llvm-bolt"), cwd=args.build_dir ) + # preserve llvm-bolt's timestamp to trick Ninja not to rebuild it + stat = os.stat(bolt_path) # rename llvm-bolt os.replace(bolt_path, f"{bolt_path}.new") # memorize the old hash for logging @@ -96,6 +98,8 @@ f.write(ini) # symlink llvm-bolt-wrapper os.symlink(wrapper_path, bolt_path) + # restore original [am]time on symlink + os.utime(bolt_path, (stat.st_atime, stat.st_mtime)) if args.switch_back: if stash: subprocess.run(shlex.split("git stash pop"), cwd=source_dir) @@ -108,8 +112,7 @@ ) print( f"Build directory {args.build_dir} is ready to run BOLT tests, e.g.\n" - "\tbin/llvm-lit -sv tools/bolt/test\nor\n" - "\tbin/llvm-lit -sv tools/bolttests" + "\tninja check-bolt" )