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

Problems with 'validate_proto' not declared in package 'validate' #1199

Open
GiulianoWF opened this issue Dec 11, 2024 · 0 comments
Open

Problems with 'validate_proto' not declared in package 'validate' #1199

GiulianoWF opened this issue Dec 11, 2024 · 0 comments
Labels
Bazel Bazel related issues C++ C++ language support Good First Issue Newcomer-friendly issue Help Wanted Community support requested

Comments

@GiulianoWF
Copy link

Curently when I try to build my project I get:

ERROR: Traceback (most recent call last):
        File "/home/user/.cache/bazel/_bazel_user/43633c363e7fef7d5294d9a3f2e8c154/external/protoc-gen-validate~/validate/BUILD", line 3, column 47, in <toplevel>
                load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library")
Error: file '@rules_cc//cc:defs.bzl' does not contain symbol 'cc_proto_library'
ERROR: /home/user/.cache/bazel/_bazel_user/43633c363e7fef7d5294d9a3f2e8c154/external/protoc-gen-validate~/validate/BUILD: no such target '@@protoc-gen-validate~//validate:validate_proto': target 'validate_proto' not declared in package 'validate' defined by /home/user/.cache/bazel/_bazel_user/43633c363e7fef7d5294d9a3f2e8c154/external/protoc-gen-validate~/validate/BUILD

It seams that the version of rules_cc that is being used does not correspond to the version expected by protoc-gen-validate?

my modules:

bazel_dep(name = "protoc-gen-validate", version = "1.0.4")
bazel_dep(name = "rules_proto_grpc_cpp", version = "5.0.0")
bazel_dep(name = "grpc", version = "1.68.0")
bazel_dep(name = "protobuf", version = "27.1")
bazel_dep(name = "abseil-cpp", version = "20240116.2")
bazel_dep(name = "zlib", version = "1.3.1.bcr.3")

and the config:

bazel_dep(name = "toolchains_protoc", version = "0.3.6")

protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
protoc.toolchain(
    google_protobuf = "com_google_protobuf",
    version = "v27.1",
)
use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")

register_toolchains("@toolchains_protoc_hub//:all")

Any idea what can I do?

@rodaine rodaine added Help Wanted Community support requested Good First Issue Newcomer-friendly issue C++ C++ language support Bazel Bazel related issues labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bazel Bazel related issues C++ C++ language support Good First Issue Newcomer-friendly issue Help Wanted Community support requested
Projects
None yet
Development

No branches or pull requests

2 participants