rules_foreign_cc icon indicating copy to clipboard operation
rules_foreign_cc copied to clipboard

Repository '@proto_bazel_features' is not defined.

Open noajshu opened this issue 6 months ago • 3 comments

I am trying to upgrade to the latest version 0.14.0 of rules_foreign. I followed the directions here: 0.14.0 which say to add the following to my WORKSPACE:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_foreign_cc",
    sha256 = "e0f0ebb1a2223c99a904a565e62aa285bf1d1a8aeda22d10ea2127591624866c",
    strip_prefix = "rules_foreign_cc-0.14.0",
    url = "https://github.com/bazel-contrib/rules_foreign_cc/releases/download/0.14.0/rules_foreign_cc-0.14.0.tar.gz",
)

load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")

# This sets up some common toolchains for building targets. For more details, please see
# https://bazel-contrib.github.io/rules_foreign_cc/0.14.0/flatten.html#rules_foreign_cc_dependencies
rules_foreign_cc_dependencies()

# If you're not already using bazel_skylib, bazel_features or rules_python,
# you'll need to add these calls as well.

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

However, I get the following error:

% bazelisk clean --expunge && bazelisk build src:libgmpwrap
INFO: Starting clean (this may take a while). Consider using --async if the clean takes more than several minutes.
Starting local Bazel server and connecting to it...
ERROR: /Users/noah/projects/xortools/src/BUILD:321:11: error loading package '@gmp//': at /private/var/tmp/_bazel_noah/dcdf7a6a0781e7e496421bcb37aad59e/external/rules_cc/cc/defs.bzl:16:6: at /private/var/tmp/_bazel_noah/dcdf7a6a0781e7e496421bcb37aad59e/external/com_google_protobuf/bazel/cc_proto_library.bzl:3:6: at /private/var/tmp/_bazel_noah/dcdf7a6a0781e7e496421bcb37aad59e/external/com_google_protobuf/bazel/private/bazel_cc_proto_library.bzl:13:6: at /private/var/tmp/_bazel_noah/dcdf7a6a0781e7e496421bcb37aad59e/external/com_google_protobuf/bazel/common/proto_info.bzl:3:6: Unable to find package for @proto_bazel_features//:features.bzl: The repository '@proto_bazel_features' could not be resolved: Repository '@proto_bazel_features' is not defined. and referenced by '//src:libgmpwrap'
ERROR: Analysis of target '//src:libgmpwrap' failed; build aborted: Analysis failed
INFO: Elapsed time: 4.770s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (40 packages loaded, 173 targets configured)
    currently loading: @gmp//
    Fetching repository @local_config_cc; Running xcode-locator

I noticed that it is missing proto_bazel_features and I wonder if there could be a step missing from the suggested WORKSPACE configuration to load this dependency.

Thanks!

noajshu avatar May 04 '25 22:05 noajshu