Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.0.0] Polish lockfile error message #20191

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public SkyValue compute(SkyKey skyKey, Environment env)
throw new BazelDepGraphFunctionException(
ExternalDepsException.withMessage(
Code.BAD_MODULE,
"Lock file is no longer up-to-date because: %s. "
"MODULE.bazel.lock is no longer up-to-date because: %s. "
+ "Please run `bazel mod deps --lockfile_mode=update` to update your lockfile.",
String.join(", ", diffLockfile)),
Transience.PERSISTENT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private SingleExtensionEvalValue tryGettingValueFromLockFile(
throw new SingleExtensionEvalFunctionException(
ExternalDepsException.withMessage(
Code.BAD_MODULE,
"Lock file is no longer up-to-date because: %s. "
"MODULE.bazel.lock is no longer up-to-date because: %s. "
+ "Please run `bazel mod deps --lockfile_mode=update` to update your lockfile.",
String.join(", ", extDiff)),
Transience.PERSISTENT);
Expand Down
29 changes: 15 additions & 14 deletions src/test/py/bazel/bzlmod/bazel_lockfile_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ def testLockfileErrorMode(self):
self.AssertExitCode(exit_code, 48, stderr)
self.assertIn(
(
'ERROR: Error computing the main repository mapping: Lock file is'
' no longer up-to-date because: the root MODULE.bazel has been'
' modified, the value of --check_direct_dependencies flag has'
' been modified. Please run'
'ERROR: Error computing the main repository mapping:'
' MODULE.bazel.lock is no longer up-to-date because: the root'
' MODULE.bazel has been modified, the value of'
' --check_direct_dependencies flag has been modified. Please run'
' `bazel mod deps --lockfile_mode=update` to update your lockfile.'
),
stderr,
Expand Down Expand Up @@ -248,10 +248,11 @@ def testLocalOverrideWithErrorMode(self):
self.AssertExitCode(exit_code, 48, stderr)
self.assertIn(
(
'ERROR: Error computing the main repository mapping: Lock file is'
' no longer up-to-date because: The MODULE.bazel file has changed'
' for the overriden module: bar. Please run'
' `bazel mod deps --lockfile_mode=update` to update your lockfile.'
'ERROR: Error computing the main repository mapping:'
' MODULE.bazel.lock is no longer up-to-date because: The'
' MODULE.bazel file has changed for the overriden module: bar.'
' Please run `bazel mod deps --lockfile_mode=update` to update your'
' lockfile.'
),
stderr,
)
Expand Down Expand Up @@ -575,7 +576,7 @@ def testUpdateModuleExtensionErrorMode(self):
self.AssertExitCode(exit_code, 48, stderr)
self.assertIn(
(
'ERROR: Lock file is no longer up-to-date because: The '
'ERROR: MODULE.bazel.lock is no longer up-to-date because: The '
'implementation of the extension '
"'ModuleExtensionId{bzlFileLabel=//:extension.bzl, "
"extensionName=lockfile_ext, isolationKey=Optional.empty}' or one "
Expand Down Expand Up @@ -762,8 +763,8 @@ def testChangeEnvVariableInErrorMode(self):
self.AssertExitCode(exit_code, 48, stderr)
self.assertIn(
(
'ERROR: Lock file is no longer up-to-date because: The environment'
' variables the extension'
'ERROR: MODULE.bazel.lock is no longer up-to-date because: The'
' environment variables the extension'
" 'ModuleExtensionId{bzlFileLabel=//:extension.bzl,"
" extensionName=lockfile_ext, isolationKey=Optional.empty}' depends"
' on (or their values) have changed. Please run'
Expand Down Expand Up @@ -842,9 +843,9 @@ def testOldVersion(self):
self.AssertExitCode(exit_code, 48, stderr)
self.assertIn(
(
'ERROR: Error computing the main repository mapping: Lock file is'
' no longer up-to-date because: the version of the lockfile is not'
' compatible with the current Bazel. Please run'
'ERROR: Error computing the main repository mapping:'
' MODULE.bazel.lock is no longer up-to-date because: the version of'
' the lockfile is not compatible with the current Bazel. Please run'
' `bazel mod deps --lockfile_mode=update` to update your lockfile.'
),
stderr,
Expand Down
Loading