-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
bazel mod tidy
fails when nothing changes
#21651
Comments
@Wyverald Looks like two separate bugs to me. I can fix the exit code behavior, but not sure what the stack trace is about. |
@tyler-french Could you share where |
@bazel-io fork 7.1.1 |
@fmeum This is just a bug in our wrapper, it is succeeding, just not recognizing Let me remove this from the Bug
|
Here's our MODULE.bazel file with many things redacted:
|
sorry, I haven't had time yet (busy with some other stuff today). Will take a look in a bit if you can't get to it! |
I can reproduce this locally. What's quite interesting is that It's likely that this regressed when I removed the name attribute from the lockfile. I can dig deeper and submit a fix. |
Buildozer has a non-zero exit code if it didn't make any changes. Work towards bazelbuild#21651 Closes bazelbuild#21657. PiperOrigin-RevId: 615184752 Change-Id: Ib89928974e2cd014cec968193d35fd74e2d01261
Buildozer has a non-zero exit code if it didn't make any changes. Work towards bazelbuild#21651 Closes bazelbuild#21657. Commit bazelbuild@98f29db PiperOrigin-RevId: 615184752 Change-Id: Ib89928974e2cd014cec968193d35fd74e2d01261 Co-authored-by: Fabian Meumertzheim <[email protected]>
* Fixes a crash when using a non-registry override with a specified version: ``` Caused by: java.lang.NullPointerException: null value in entry: foo=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33) at com.google.common.collect.ImmutableMapEntry.<init>(ImmutableMapEntry.java:54) at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:345) at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:454) at com.google.devtools.build.lib.bazel.bzlmod.Module.getRepoMappingWithBazelDepsOnly(Module.java:67) at com.google.devtools.build.lib.bazel.bzlmod.BazelDepGraphFunction.getExtensionUsagesById(BazelDepGraphFunction.java:233) at com.google.devtools.build.lib.bazel.bzlmod.BazelDepGraphFunction.compute(BazelDepGraphFunction.java:126) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:464) ``` * Fixes a crash for root modules with no extension usages: ``` Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Map.keySet()" because the return value of "com.google.common.collect.ImmutableMap.get(Object)" is null at com.google.devtools.build.lib.bazel.bzlmod.BazelModTidyFunction.compute(BazelModTidyFunction.java:85) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:464) ``` Fixes bazelbuild#21651 Closes bazelbuild#21686. PiperOrigin-RevId: 615826860 Change-Id: I22be3fd53d0dc97aec92afe3dc51a9d6b7e60c98
* Fixes a crash when using a non-registry override with a specified version: ``` Caused by: java.lang.NullPointerException: null value in entry: foo=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33) at com.google.common.collect.ImmutableMapEntry.<init>(ImmutableMapEntry.java:54) at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:345) at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:454) at com.google.devtools.build.lib.bazel.bzlmod.Module.getRepoMappingWithBazelDepsOnly(Module.java:67) at com.google.devtools.build.lib.bazel.bzlmod.BazelDepGraphFunction.getExtensionUsagesById(BazelDepGraphFunction.java:233) at com.google.devtools.build.lib.bazel.bzlmod.BazelDepGraphFunction.compute(BazelDepGraphFunction.java:126) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:464) ``` * Fixes a crash for root modules with no extension usages: ``` Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Map.keySet()" because the return value of "com.google.common.collect.ImmutableMap.get(Object)" is null at com.google.devtools.build.lib.bazel.bzlmod.BazelModTidyFunction.compute(BazelModTidyFunction.java:85) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:464) ``` Fixes bazelbuild#21651 Closes bazelbuild#21686. PiperOrigin-RevId: 615826860 Change-Id: I22be3fd53d0dc97aec92afe3dc51a9d6b7e60c98
* Fixes a crash when using a non-registry override with a specified version: ``` Caused by: java.lang.NullPointerException: null value in entry: foo=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33) at com.google.common.collect.ImmutableMapEntry.<init>(ImmutableMapEntry.java:54) at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:345) at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:454) at com.google.devtools.build.lib.bazel.bzlmod.Module.getRepoMappingWithBazelDepsOnly(Module.java:67) at com.google.devtools.build.lib.bazel.bzlmod.BazelDepGraphFunction.getExtensionUsagesById(BazelDepGraphFunction.java:233) at com.google.devtools.build.lib.bazel.bzlmod.BazelDepGraphFunction.compute(BazelDepGraphFunction.java:126) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:464) ``` * Fixes a crash for root modules with no extension usages: ``` Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Map.keySet()" because the return value of "com.google.common.collect.ImmutableMap.get(Object)" is null at com.google.devtools.build.lib.bazel.bzlmod.BazelModTidyFunction.compute(BazelModTidyFunction.java:85) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:464) ``` Fixes #21651 Closes #21686. Commit 77369dc PiperOrigin-RevId: 615826860 Change-Id: I22be3fd53d0dc97aec92afe3dc51a9d6b7e60c98 Co-authored-by: Fabian Meumertzheim <[email protected]>
A fix for this issue has been included in Bazel 7.1.1 RC1. Please test out the release candidate and report any issues as soon as possible. |
I hit this with 7.1.1
Twiddling a little bit with the module file it sometimes prints this warning:
|
@stagnation Could you try deleting your lockfile once? If the lockfile was generated by pre-7.1.1 |
Cheers, I guess that works or something similar. I just tried a build with last_green which kicked it just right to start working again. |
Description of the bug:
MODULE.bazel is correct, I then run
bazel mod tidy
and get an error:Next, I mess up the formatting (but not the syntax), and run
bazel mod tidy
again, and it succeeds:Next, I run it again, and Bazel crashes
This will continue with all
--enable_bzlmod
builds untilMODULE.bazel.lock
is deletedWhich category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
See description
Which operating system are you running Bazel on?
Linux AMD 64
What is the output of
bazel info release
?% bazel info release Starting local Bazel server and connecting to it... INFO: Invocation ID: f7b2a282-a126-4ed2-9b9b-a7eab1906e22 release 7.1.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
https://github.com/bazelbuild/bazel/pull/21265/files
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: