Skip to content

Commit 65f847a

Browse files
meteorcloudycopybara-github
authored andcommitted
Polish lockfile error message
Changed "Lock file" to "MODULE.bazel.lock" so that it's more specific. RELNOTES: None PiperOrigin-RevId: 581976554 Change-Id: Ib29d9f0ef0e9fd5535ce90d36dc2b89cdc159429
1 parent 560327f commit 65f847a

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelDepGraphFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public SkyValue compute(SkyKey skyKey, Environment env)
9797
throw new BazelDepGraphFunctionException(
9898
ExternalDepsException.withMessage(
9999
Code.BAD_MODULE,
100-
"Lock file is no longer up-to-date because: %s. "
100+
"MODULE.bazel.lock is no longer up-to-date because: %s. "
101101
+ "Please run `bazel mod deps --lockfile_mode=update` to update your lockfile.",
102102
String.join(", ", diffLockfile)),
103103
Transience.PERSISTENT);

src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private SingleExtensionEvalValue tryGettingValueFromLockFile(
286286
throw new SingleExtensionEvalFunctionException(
287287
ExternalDepsException.withMessage(
288288
Code.BAD_MODULE,
289-
"Lock file is no longer up-to-date because: %s. "
289+
"MODULE.bazel.lock is no longer up-to-date because: %s. "
290290
+ "Please run `bazel mod deps --lockfile_mode=update` to update your lockfile.",
291291
String.join(", ", extDiff)),
292292
Transience.PERSISTENT);

src/test/py/bazel/bzlmod/bazel_lockfile_test.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ def testLockfileErrorMode(self):
203203
self.AssertExitCode(exit_code, 48, stderr)
204204
self.assertIn(
205205
(
206-
'ERROR: Error computing the main repository mapping: Lock file is'
207-
' no longer up-to-date because: the root MODULE.bazel has been'
208-
' modified, the value of --check_direct_dependencies flag has'
209-
' been modified. Please run'
206+
'ERROR: Error computing the main repository mapping:'
207+
' MODULE.bazel.lock is no longer up-to-date because: the root'
208+
' MODULE.bazel has been modified, the value of'
209+
' --check_direct_dependencies flag has been modified. Please run'
210210
' `bazel mod deps --lockfile_mode=update` to update your lockfile.'
211211
),
212212
stderr,
@@ -248,10 +248,11 @@ def testLocalOverrideWithErrorMode(self):
248248
self.AssertExitCode(exit_code, 48, stderr)
249249
self.assertIn(
250250
(
251-
'ERROR: Error computing the main repository mapping: Lock file is'
252-
' no longer up-to-date because: The MODULE.bazel file has changed'
253-
' for the overriden module: bar. Please run'
254-
' `bazel mod deps --lockfile_mode=update` to update your lockfile.'
251+
'ERROR: Error computing the main repository mapping:'
252+
' MODULE.bazel.lock is no longer up-to-date because: The'
253+
' MODULE.bazel file has changed for the overriden module: bar.'
254+
' Please run `bazel mod deps --lockfile_mode=update` to update your'
255+
' lockfile.'
255256
),
256257
stderr,
257258
)
@@ -575,7 +576,7 @@ def testUpdateModuleExtensionErrorMode(self):
575576
self.AssertExitCode(exit_code, 48, stderr)
576577
self.assertIn(
577578
(
578-
'ERROR: Lock file is no longer up-to-date because: The '
579+
'ERROR: MODULE.bazel.lock is no longer up-to-date because: The '
579580
'implementation of the extension '
580581
"'ModuleExtensionId{bzlFileLabel=//:extension.bzl, "
581582
"extensionName=lockfile_ext, isolationKey=Optional.empty}' or one "
@@ -762,8 +763,8 @@ def testChangeEnvVariableInErrorMode(self):
762763
self.AssertExitCode(exit_code, 48, stderr)
763764
self.assertIn(
764765
(
765-
'ERROR: Lock file is no longer up-to-date because: The environment'
766-
' variables the extension'
766+
'ERROR: MODULE.bazel.lock is no longer up-to-date because: The'
767+
' environment variables the extension'
767768
" 'ModuleExtensionId{bzlFileLabel=//:extension.bzl,"
768769
" extensionName=lockfile_ext, isolationKey=Optional.empty}' depends"
769770
' on (or their values) have changed. Please run'
@@ -842,9 +843,9 @@ def testOldVersion(self):
842843
self.AssertExitCode(exit_code, 48, stderr)
843844
self.assertIn(
844845
(
845-
'ERROR: Error computing the main repository mapping: Lock file is'
846-
' no longer up-to-date because: the version of the lockfile is not'
847-
' compatible with the current Bazel. Please run'
846+
'ERROR: Error computing the main repository mapping:'
847+
' MODULE.bazel.lock is no longer up-to-date because: the version of'
848+
' the lockfile is not compatible with the current Bazel. Please run'
848849
' `bazel mod deps --lockfile_mode=update` to update your lockfile.'
849850
),
850851
stderr,

0 commit comments

Comments
 (0)