-
Notifications
You must be signed in to change notification settings - Fork 377
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
All Bazel commands fail when changing a Go dependency when using Bzlmod extension #1855
Comments
This is tricky: We either need to avoid any dependency on the @tyler-french @linzhp What do you think? |
@fmeum thanks for looking at this. I feel it would be great if we can defer the fatal error so folks can still run go mod tidy through Bazel - as the err msg message suggests. Furthermore if we can wire up "bazel mod tidy" as a one stop shop to maintain Go dependencies in a big repo that would be awesome. |
@fmeum I'm running into this issue too, I made the missing sum(s) non fatal and it worked as expected: Dependency Bump:
|
…cy when using Bzlmod extension" (#1861) **What type of PR is this?** Bug fix **What package or component does this PR mostly affect?** Go bzlmod **What does this PR do? Why is it needed?** When trying to bump the version of a Go module in a repo that uses the `go_deps` bzlmod extension, we run into an issue wherein all Bazel commands fail with ` "Error in fail: No sum for <module>`. However the suggested fix is to run `bazel run @rules_go//go -- mod tidy` which fails with the same error, thus forcing us into a pickle. This PR changes this to a warning instead of an error after which the suggested fix works. **Which issues(s) does this PR fix?** Fixes #1855 --------- Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
What version of gazelle are you using?
0.38.0
What version of rules_go are you using?
0.48.0
What version of Bazel are you using?
7.2.1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
MacOS, Arm64
What did you do?
Checkout https://github.com/chenxiao0228/cobra/tree/bazel_demo
change "github.com/cpuguy83/go-md2man/v2 v2.0.4" -> "github.com/cpuguy83/go-md2man/v2 v2.0.3" in "go.mod"
run "bazel run gazelle", or any Bazel command "bazel build cobra", "bazel mod tidy"
What did you expect to see?
Be able to run "bazel run @rules_go//go -- mod tidy" to fetch the new version and add its hash in "go.sum"
Or even better
Be able to run "bazel mod tidy" so everything is up to date
What did you see instead?
All Bazel commands fail with "Error in fail: No sum for github.com/cpuguy83/go-md2man/v2@2.0.3 from parent-label-todo found. You may need to run: bazel run @rules_go//go -- mod tidy"
Even though Gazelle suggests "You may need to run: bazel run @rules_go//go -- mod tidy", the command fails with the same err msg.
The text was updated successfully, but these errors were encountered: