commit 6635506128b3227346d012389dd994aae44e94a8
parent d9e44cf6434958015dffb4d5a09c3bcfe7b84341
Author: Alex Hochheiden <ahochheiden@mozilla.com>
Date: Tue, 16 Dec 2025 18:26:51 +0000
Bug 1991995 - Prevent gradle configuration cache invalidation from unnecessary writes to `config_status_deps.in` r=nalexander,firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D271522
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure.py b/configure.py
@@ -32,6 +32,7 @@ from mach.site import (
from mozbuild.backend.configenvironment import PartialConfigEnvironment
from mozbuild.configure import TRACE, ConfigureSandbox
from mozbuild.pythonutil import iter_modules_in_path
+from mozbuild.util import FileAvoidWrite
if "MOZ_CONFIGURE_BUILDSTATUS" in os.environ:
@@ -259,8 +260,9 @@ def config_status(config, execute=True):
partial_config.write_vars(sanitized_config)
# Write out a file so the build backend knows to re-run configure when
- # relevant Python changes.
- with open("config_status_deps.in", "w", encoding="utf-8", newline="\n") as fh:
+ # relevant Python changes. Use FileAvoidWrite to only write if the
+ # deps_content has changed to avoid invalidating Gradle's configuration cache
+ with FileAvoidWrite("config_status_deps.in") as fh:
for f in sorted(
itertools.chain(
config["CONFIG_STATUS_DEPS"],