Skip to content

[BUG] Bazel 9 compatibility issues #462

@ash2k

Description

@ash2k

Description

I'm trying to build my project, that uses protovalidate, with Bazel 9.

Steps to Reproduce

Expected Behavior

Successful build.

Actual Behavior

The build is failing:

bazel test -- //...
ERROR: .../external/protovalidate+/proto/protovalidate/buf/validate/BUILD.bazel:39:1: name 'cc_proto_library' is not defined (did you mean 'proto_library'?)
ERROR: .../external/protovalidate+/proto/protovalidate/buf/validate/BUILD.bazel: no such target '@@protovalidate+//proto/protovalidate/buf/validate:validate_proto': target 'validate_proto' not declared in package 'proto/protovalidate/buf/validate' defined by .../external/protovalidate+/proto/protovalidate/buf/validate/BUILD.bazel
ERROR: /Users/mike/src/gitlab-agent/pkg/agentcfg/BUILD.bazel:7:18: no such target '@@protovalidate+//proto/protovalidate/buf/validate:validate_proto': target 'validate_proto' not declared in package 'proto/protovalidate/buf/validate' defined by .../external/protovalidate+/proto/protovalidate/buf/validate/BUILD.bazel and referenced by '//pkg/agentcfg:proto'

Screenshots/Logs

Environment

  • Operating System:
  • Version:
  • Compiler/Toolchain:
  • Protobuf Compiler & Version:
  • Protovalidate Version:

Possible Solution

As the error says, cc_proto_library is not imported properly. It used to be a built-in rule but that is no longer the case with Bazel 9. It must be imported from here.

Additional Context

Ideally this project should switch from the deprecated rules_proto to protobuf. This would make it possible to use pre-built protoc too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions