Skip to content

[BUG]: Bzlmod: ignore_directories not defined in REPO.bazel, breaks Bazel build #128

@mmorel-35

Description

@mmorel-35

Description

I'm trying to use protovalidate-cc as a dependency in a Bazel project with bzlmod (MODULE.bazel).
I followed the documentation and added:

bazel_dep(name = "protovalidate-cc", version = "1.0.0-rc.6")

When building, I encounter an error related to ignore_directories not being defined in REPO.bazel.

Steps to Reproduce

  1. Add the following to MODULE.bazel:
    bazel_dep(name = "protovalidate-cc", version = "1.0.0-rc.6")
  2. Reference the C++ validator in a Bazel rule:
    deps = ["@protovalidate-cc//buf/validate:validator"]
  3. Run bazel build //...

Expected Behavior

Bazel should fetch and build protovalidate-cc successfully, allowing use of the validator target in C++ rules.

Actual Behavior

Bazel fails with the following error:

ERROR: /home/codespace/.cache/bazel/_bazel_codespace/.../external/protovalidate-cc~/REPO.bazel:15:1: name 'ignore_directories' is not defined
ERROR: error loading package '@@protovalidate-cc~//buf/validate': bad REPO.bazel file
ERROR: /workspaces/xds/udpa/annotations/BUILD:5:18: error loading package '@@protovalidate-cc~//buf/validate': bad REPO.bazel file and referenced by '//udpa/annotations:pkg_cc_proto'
ERROR: Analysis of target '//udpa/annotations:pkg_cc_proto' failed; build aborted: Analysis failed

Screenshots/Logs

See error log above.

Environment

  • Operating System: Ubuntu 24.04.2 LTS (Codespaces)
  • Version: Ubuntu 24.04.2 LTS
  • Compiler/Toolchain: Bazel (bzlmod)
  • Protobuf Compiler & Version: protoc 3.17.3
  • Protovalidate Version: 1.0.0-rc.6

Possible Solution

It seems the macro ignore_directories is referenced in REPO.bazel but not defined, causing the build to fail. Is there a workaround or a fix for this issue? Is protovalidate-cc fully compatible with bzlmod, or is there a recommended way to use it with Bazel modules?

Additional Context

This issue blocks usage of protovalidate-cc with bzlmod. The error occurs even when following the official documentation for bzlmod integration.

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