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

[cmd/fetch_repo] make cache corruption failures more clear #1782

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

tyler-french
Copy link
Contributor

@tyler-french tyler-french commented Apr 11, 2024

This failure was confusing to our users. We should make more clear error messages in cases when a GOMODCACHE might be corrupt.

Resolves #1774

Example failure:

ERROR: /home/user/go-code/WORKSPACE:69:26: fetching go_repository rule //external:com_github_bazelbuild_remote_apis: Traceback (most recent call last):
        File "/home/user/.cache/bazel/_bazel_tfrench/b97476d719d716accead0f2d5b93104f/external/bazel_gazelle/internal/go_repository.bzl", line 263, column 17, in _go_repository_impl
                fail("failed to fetch %s: %s" % (ctx.name, result.stderr))
Error in fail: failed to fetch com_github_bazelbuild_remote_apis: fetch_repo: resulting module with sum h1:xhO5v3Ac039HesaPqoVUwOy4WhRRJbmo9om245kp+AY=; expected sum h1:xhO5v3Ac039HesaPqoVUwOy4WhRRJbmo9om245kp+AY=, Please try clearing your module cache directory "/home/user/go-code/pkg/mod"
ERROR: Error computing the main repository mapping: no such package '@@com_github_bazelbuild_remote_apis//': failed to fetch com_github_bazelbuild_remote_apis: fetch_repo: resulting module with sum h1:xhO5v3Ac039HesaPqoVUwOy4WhRRJbmo9om245kp+AY=; expected sum h1:xhO5v3Ac039HesaPqoVUwOy4WhRRJbmo9om245kp+AY=, Please try clearing your module cache directory "/home/user/go-code/pkg/mod"
INFO: Build Event Protocol files produced successfully.
Computing main repo mapping: 
WARNING:Bazel failed with exit code 1

@tyler-french tyler-french merged commit cc40a33 into bazelbuild:master Apr 12, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new gazelle v0.36.0 fails with Go sum mismatches
2 participants