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

go_deps issues with bzlmod lockfile #1586

Closed
Sovietaced opened this issue Jul 25, 2023 · 1 comment
Closed

go_deps issues with bzlmod lockfile #1586

Sovietaced opened this issue Jul 25, 2023 · 1 comment

Comments

@Sovietaced
Copy link

Sovietaced commented Jul 25, 2023

What version of gazelle are you using?

0.31.1

What version of rules_go are you using?

0.39.1

What version of Bazel are you using?

6.3.0

Does this issue reproduce with the latest releases of all the above?

Unsure

What operating system and processor architecture are you using?

ubuntu x86

What did you do?

I added a new go dependency to code, build files, and the use_repo call in MODULE.bazel. I ran bazel build //<my go target>.

What did you expect to see?

I expected Bazel to build the go targets normally.

What did you see instead?

ERROR: /home/jparraga/code/<redacted>/BUILD.bazel:5:11: no such package '@gazelle~0.31.1~go_deps~com_github_rs_cors//': The repository '@gazelle~0.31.1~go_deps~com_github_rs_cors' could not be resolved: Repository '@gazelle~0.31.1~go_deps~com_github_rs_cors' is not defined and referenced by '//<redacted>'

By default the bzlmod lockfile operates under the update mode, which should recompute the bzlmod lockfile during builds. Instead of recomputing the bzlmod lockfile, I just get nonsensical build failures like above. If I delete the old bzlmod lockfile and re-run the build, it generates a new, working bzlmod lockfile and the build succeeds.

It seems that the bzlmod lockfile isn't playing nice with dependency loading via module extensions? I am not sure if this issue can be resolved, but I just wanted to report it in case others encountered it.

@fmeum
Copy link
Member

fmeum commented Jul 27, 2023

This is bazelbuild/bazel#19068. Bazel 6.3.1 will disable the lockfile by default, 6.4.0 is expected to have the fix.

@fmeum fmeum closed this as completed Aug 9, 2023
@fmeum fmeum closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2023
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

No branches or pull requests

2 participants