You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature description:
Set default package visibility to public for proto files since they can be seen as an api specification
Problem it solves or use case:
A user of protovalidate may decide to provide their own protobuf definitions for others to use and to generate code based on them. With bazel this is more difficult because they are not publicly exported with the github.com/bufbuild/protovalidate-go.
This can be worked around by either copying them in the 3rd party protos or copying them via a git_repository. With either option it's easy to be out of sync with the go dependency as time passes.
This is useful when working with other individuals or teams that have not transitioned to buf
Proposed implementation or solution:
Define default package visibility as public
:> bazel build :protovalidate
ERROR: /users/foo/projects/my-project/proto/BUILD.bazel:4:10: in pkg_files rule //proto:protovalidate: target '@buf_deps//buf/validate:expression.proto' is not visible from target '//proto:protovalidate'. Check the visibility declaration of the former target if you think the dependency is legitimate. To set the visibility of that source file target, use the exports_files() function
ERROR: /users/foo/projects/my-project/proto/BUILD.bazel:4:10: in pkg_files rule //proto:protovalidate: target '@buf_deps//buf/validate:validate.proto' is not visible from target '//proto:protovalidate'. Check the visibility declaration of the former target if you think the dependency is legitimate. To set the visibility of that source file target, use the exports_files() function
ERROR: /users/foo/projects/my-project/proto/BUILD.bazel:4:10: Analysis of target '//proto:protovalidate' failed
ERROR: Analysis of target '//proto:protovalidate' failed; build aborted:
INFO: Elapsed time: 0.620s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 2 targets configured)
The text was updated successfully, but these errors were encountered:
Feature description:
Set default package visibility to public for proto files since they can be seen as an api specification
Problem it solves or use case:
A user of protovalidate may decide to provide their own protobuf definitions for others to use and to generate code based on them. With bazel this is more difficult because they are not publicly exported with the
github.com/bufbuild/protovalidate-go
.This can be worked around by either copying them in the 3rd party protos or copying them via a git_repository. With either option it's easy to be out of sync with the go dependency as time passes.
This is useful when working with other individuals or teams that have not transitioned to
buf
Proposed implementation or solution:
Define default package visibility as public
Contribution:
If approved and I can raise a pull-request with the abode change added to the BUILD.bazel
Examples or references:
The deprecated
protoc-gen-validate
BUILD.bzazelGoogle APIs BUILD.bazel
These references allow shipping proto dependenices together with the user's proto definitions.
Additional context:
Bazel query
Our usecase
The text was updated successfully, but these errors were encountered: