diff --git a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelDepGraphFunction.java b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelDepGraphFunction.java index ef7423d7d1ec75..dc36b382f5e9d7 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelDepGraphFunction.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelDepGraphFunction.java @@ -127,7 +127,7 @@ public SkyValue compute(SkyKey skyKey, Environment env) ImmutableBiMap extensionUniqueNames = calculateUniqueNameForUsedExtensionId(extensionUsagesById); - if (!lockfileMode.equals(LockfileMode.OFF)) { + if (lockfileMode.equals(LockfileMode.UPDATE)) { // This will keep all module extension evaluation results, some of which may be stale due to // changed usages. They will be removed in BazelLockFileModule. BazelLockFileValue updateLockfile =