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

Bazel build with disable_global flag to use generated .pb.go as is #1859

Closed

Conversation

rytswd
Copy link

@rytswd rytswd commented Dec 4, 2020

References to other Issues or PRs

Fixes #1847

Brief description of what is fixed or changed

Disable proto generation from Bazel, and rely on generated code

The command used was:
bazel run gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories --build_file_proto_mode=disable_global
# gazelle:go_grpc_compilers //:go_apiv2, //:go_grpc, //protoc-gen-grpc-gateway:go_gen_grpc_gateway

proto_library(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't users in not-go sill need to depend on the proto_library?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like having both proto_library and and go_library would cause some build warning with Gazelle command. If there is a way to keep both, I agree that would be ideal - but I'm not sure how to achieve that 😥

@rytswd
Copy link
Author

rytswd commented Dec 4, 2020

I have now turned off openapi build - this is definitely less than ideal, and we probably need some setup that can pull in .proto as they are. Need to research more on what can be done to achieve build to use .pb.go, while allowing openapi build to use .proto.

@codecov-io
Copy link

Codecov Report

Merging #1859 (3746cdc) into master (1fdec78) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1859   +/-   ##
=======================================
  Coverage   58.07%   58.07%           
=======================================
  Files          34       34           
  Lines        3754     3754           
=======================================
  Hits         2180     2180           
  Misses       1301     1301           
  Partials      273      273           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fdec78...3746cdc. Read the comment docs.

@rytswd
Copy link
Author

rytswd commented Dec 7, 2020

Closing as I got a workaround for this from consuming code.
#1847 (comment)

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

Successfully merging this pull request may close these issues.

Building with Bazel not compatible when using Gazelle and disable_global
3 participants