From 002f4b5b4a22786fc23787ab3dcf01ecc52e97d1 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 3 May 2024 15:33:38 -0400 Subject: [PATCH] tools: Don't write args.gn if unchanged (see #3681, see #3685) Now that args.gn is an input to the make_config_header target we don't want to invalidate the build unnecessarily by modifying the file if the contents are unchanged. --- tools/gclient_hook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gclient_hook.py b/tools/gclient_hook.py index c525984e3..85d59f1fe 100644 --- a/tools/gclient_hook.py +++ b/tools/gclient_hook.py @@ -5,7 +5,7 @@ from __future__ import absolute_import from __future__ import print_function -from file_util import make_dir, write_file +from file_util import make_dir, write_file_if_changed from gclient_util import * from gn_args import GetAllPlatformConfigs, GetConfigFileContents import issue_1999 @@ -140,7 +140,7 @@ for dir, config in configs.items(): make_dir(out_path, False) args_gn_path = os.path.join(out_path, 'args.gn') args_gn_contents = GetConfigFileContents(config) - write_file(args_gn_path, args_gn_contents) + write_file_if_changed(args_gn_path, args_gn_contents) # Generate the Ninja config. cmd = ['gn', 'gen', os.path.join('out', dir)]