Skip to content

protos does not have mandatory providers: 'PyInfo' or 'CcInfo'. #3004

Closed
@gfrankliu

Description

@gfrankliu

We recently upgraded the bazel module versions in MODULE.bazel, including rules_python to the latest 1.4.1. Now bazel build of py_library target which has a dep of proto fails with the error that the protos don't have mandatory providers: 'PyInfo' or 'CcInfo'. Everything works fine before the upgrade.

If I move the protos from "deps" to "srcs", the py_library build will succeed.

I compared my BUILD file with this example and find I don't explicitly load py_library. I then added load("@rules_python//python:defs.bzl", "py_library" to my BUILD, then the error about not have mandatory providers: 'PyInfo' or 'CcInfo' goes away. Is this "load" line mandatory now? I am using bazel 7.4.1 if that matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions