From 1e4eeccb0f23f245ff8b65a51de03cda38632df4 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 11 Feb 2020 19:30:22 +0530 Subject: configure_file: Also copy timestamps to avoid useless rebuilds If we always copy files over without timestamps, we're forcing a (probably unnecessary) rebuild. Also include a test for this. --- mesonbuild/interpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index d824e3c..09f7ff5 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -4006,7 +4006,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self raise InterpreterException('Exactly one input file must be given in copy mode') os.makedirs(os.path.join(self.environment.build_dir, self.subdir), exist_ok=True) shutil.copyfile(inputs_abs[0], ofile_abs) - shutil.copymode(inputs_abs[0], ofile_abs) + shutil.copystat(inputs_abs[0], ofile_abs) else: # Not reachable raise AssertionError -- cgit v1.1