Skip to content

The error no such package ‘google/protobuf’ occurs in bazel test genc/ #323

@muramat21

Description

@muramat21

I could not do bazel test for genc and got an error.

I did the following steps as https://github.com/google/genc/blob/master/SETUP.md

git clone https://github.com/google/genc
cd genc
docker build -t genc .
docker run -it -v $PWD:/genc genc:latest /bin/bash -c "cd genc; /bin/bash"

Inside the running docker container instance, at the root of the repo, run:

bazel test genc/...

The error is:

ERROR: /genc/genc/python/base/BUILD:72:11: no such package 'google/protobuf': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /genc/google/protobuf and referenced by '//genc/python/base:to_from_value_proto'
ERROR: Analysis of target '//genc/python/interop/langchain:create_computation' failed; build aborted:
INFO: Elapsed time: 109.630s
INFO: 0 processes.
ERROR: Couldn't start the build. Unable to run tests
FAILED: Build did NOT complete successfully (77 packages loaded, 52 targets configured)
    currently loading: @rules_foreign_cc//toolchains ... (5 packages)
    Fetching repository @go_sdk; starting
    Fetching repository @rules_pkg; Cloning tags/0.10.1 of https://github.com/bazelbuild/rules_pkg.git
    Fetching repository @rust_darwin_x86_64__wasm32-unknown-unknown__stable; starting
    Fetching repository @rust_freebsd_x86_64__wasm32-wasi__stable; starting
    Fetching repository @remotejdk17_macos_toolchain_config_repo; starting
    Fetching repository @rust_freebsd_x86_64__wasm32-wasi__nightly; starting
    Fetching repository @local_jdk; starting
    Fetching repository @remotejdk17_linux_toolchain_config_repo; starting ... (38 fetches)
Protobuf, an external dependency library of genc, seems to be missing.

/genc/google/protobuf directory is still not created after running the bazel test

But there is /root/.cache/bazel/_bazel_root/715d91338ce19255fccde512098e4d79/external/com_google_protobuf

How can I make it work?

My environment is OS : Ubuntu 22.04.5 LTS Docker : 26.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions