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

Temporal Go SDK can not be used with bazel_gazelle 0.32+ #1331

Closed
saumitrabhave opened this issue Dec 23, 2023 · 6 comments
Closed

Temporal Go SDK can not be used with bazel_gazelle 0.32+ #1331

saumitrabhave opened this issue Dec 23, 2023 · 6 comments

Comments

@saumitrabhave
Copy link

Expected Behavior

The prject should build fine

Actual Behavior

Error is produced is bazel build like

/external/com_github_grpc_ecosystem_grpc_gateway/runtime/BUILD.bazel:5:11: no such package '@go_googleapis//google/api': The repository '@go_googleapis' could not be resolved: Repository '@go_googleapis' is not defined and referenced by '@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library'

Steps to Reproduce the Problem

  1. go get go.temporal.io/sdk [ this gets v1.25.1 which also adds github.com/grpc-ecosystem/grpc-gateway v1.16.0 as dependency]
  2. bazel run //:gazelle-update-repos
  3. bazel build the project

Specifications

Errors:

  • io_bazel_rules_go: 0.42
  • bazel_gazelle: 0.33

Works Fine with

  • io_bazel_rules_go: 0.40
  • bazel_gazelle: 0.31.1

Additional Details

I am a noob in bazel and go build tool chains in general but with whatever I could see there might be multiple issues at play. even to build with older versions(as mentioned above) I had to add build_naming_convention = "go_default_library", #keep to the com_github_grpc_ecosystem_grpc_gateway dependency.

Even after adding this, if I increase the bazelle_gazelle version, it still errors out with error above. I think it has something to do with the fact that bazelle_gazelle stopped resolving go and proto imports to @go_googleapis since 0.32 as per https://github.com/bazelbuild/bazel-gazelle/releases. and that is where the injection point is for the error I am facing.

@Quinn-With-Two-Ns
Copy link
Contributor

I am not super familiar with bazel, but is the problem really with github.com/grpc-ecosystem/grpc-gateway does the same issue exist with github.com/grpc-ecosystem/grpc-gateway/v2? Since that is what the head of the repo uses.

@SpencerC
Copy link

Slightly different problem with Bzlmod, but also traces back to grpc-gateway:

ERROR: /private/var/tmp/_bazel_spencerconnaughton/9b09d78e8f2190e9af61aa37bcab571e/external/gazelle~0.35.0~go_deps~io_temporal_go_api/internal/temporalgateway/BUILD.bazel:3:11: no such target '@gazelle~0.35.0~go_deps~com_github_grpc_ecosystem_grpc_gateway//runtime:runtime': target 'runtime' not declared in package 'runtime' defined by /private/var/tmp/_bazel_spencerconnaughton/9b09d78e8f2190e9af61aa37bcab571e/external/gazelle~0.35.0~go_deps~com_github_grpc_ecosystem_grpc_gateway/runtime/BUILD.bazel (Tip: use `query "@@gazelle~0.35.0~go_deps~com_github_grpc_ecosystem_grpc_gateway//runtime:*"` to see all the targets in that package) and referenced by '@gazelle~0.35.0~go_deps~io_temporal_go_api//internal/temporalgateway:temporalgateway'

Hopefully will be fixed by #1365

@Quinn-With-Two-Ns
Copy link
Contributor

@SpencerC I am not sure how your PR is related to this issue.

Note: grpc-gateway is already updated to v2 on the head of the repo

@SpencerC
Copy link

@Quinn-With-Two-Ns oops, got my gRPC packages mixed up! It works on HEAD. @saumitrabhave try go get go.temporal.io/sdk@94a5f5f81f98b9351a0df0dd6833582e83052a0e.

@saumitrabhave
Copy link
Author

Thanks @Quinn-With-Two-Ns and @SpencerC ... let me check and get back

@Quinn-With-Two-Ns
Copy link
Contributor

Quinn-With-Two-Ns commented Mar 13, 2024

Closing since the Go SDK now uses grpc-gateway v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants