rules_proto_grpc icon indicating copy to clipboard operation
rules_proto_grpc copied to clipboard

4.6.0 in WORKSPACE mode not working with Bazel 7.0.0

Open ash2k opened this issue 1 year ago • 3 comments

Issue Description

Trying to upgrade to Bazel 7.0.0 in workspace mode, but the build is failing.

I think https://github.com/grpc/grpc dependency needs to be updated to pick up updates to https://github.com/bazelbuild/apple_support/ to fix the problem?

Log Output

ERROR: Traceback (most recent call last):
        File "/Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/build_bazel_rules_apple/apple/internal/rule_support.bzl", line 226, column 36, in <toplevel>
                deps_cfg = apple_common.multi_arch_split,
Error: 'apple_common' value has no field or method 'multi_arch_split'
INFO: Repository rules_python instantiated at:
  /Users/mike/src/gitlab-agent/WORKSPACE:192:25: in <toplevel>
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/rules_proto/proto/repositories.bzl:29:14: in rules_proto_dependencies
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/bazel_tools/tools/build_defs/repo/utils.bzl:240:18: in maybe
Repository rule http_archive defined at:
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in <toplevel>
INFO: Repository go_sdk instantiated at:
  /Users/mike/src/gitlab-agent/WORKSPACE:172:23: in <toplevel>
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/io_bazel_rules_go/go/private/sdk.bzl:712:28: in go_register_toolchains
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/io_bazel_rules_go/go/private/sdk.bzl:317:25: in go_download_sdk
Repository rule go_download_sdk_rule defined at:
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/io_bazel_rules_go/go/private/sdk.bzl:135:39: in <toplevel>
INFO: Repository protobuf~3.19.6 instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in <toplevel>
INFO: Repository build_bazel_apple_support instantiated at:
  /Users/mike/src/gitlab-agent/WORKSPACE:219:10: in <toplevel>
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/com_github_grpc_grpc/bazel/grpc_deps.bzl:427:21: in grpc_deps
Repository rule http_archive defined at:
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in <toplevel>
INFO: Repository build_bazel_rules_swift instantiated at:
  /Users/mike/src/gitlab-agent/WORKSPACE:198:23: in <toplevel>
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/rules_proto_grpc/repositories.bzl:470:28: in rules_proto_grpc_repos
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/rules_proto_grpc/repositories.bzl:485:24: in build_bazel_rules_swift
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/rules_proto_grpc/repositories.bzl:367:25: in _generic_dependency
Repository rule http_archive defined at:
  /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in <toplevel>
ERROR: error loading package '@@com_github_grpc_grpc//src/compiler': at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:34:6: at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/build_bazel_rules_apple/apple/ios.bzl:26:5: at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/build_bazel_rules_apple/apple/internal/testing/ios_rules.bzl:22:5: at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/build_bazel_rules_apple/apple/internal/testing/apple_test_bundle_support.bzl:66:5: initialization of module 'apple/internal/rule_support.bzl' failed
ERROR: /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/rules_proto_grpc/ruby/BUILD.bazel:13:13: error loading package '@@com_github_grpc_grpc//src/compiler': at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:34:6: at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/build_bazel_rules_apple/apple/ios.bzl:26:5: at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/build_bazel_rules_apple/apple/internal/testing/ios_rules.bzl:22:5: at /Volumes/ramdisk/ee85e5f34b46f84c839cbc56b75dd5db/external/build_bazel_rules_apple/apple/internal/testing/apple_test_bundle_support.bzl:66:5: initialization of module 'apple/internal/rule_support.bzl' failed and referenced by '@@rules_proto_grpc//ruby:grpc_ruby_plugin'
ERROR: Analysis of target '//build:extract_generated_proto' failed; build aborted: Analysis failed
INFO: Elapsed time: 4.373s, Critical Path: 0.35s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED: 
    Fetching repository @@com_github_envoyproxy_protoc_gen_validate; Restarting.
    Fetching repository @@bazel_gazelle_go_repository_config; Restarting.
    Fetching repository @@bazel_gazelle_go_repository_cache; Restarting.
    Fetching repository @@org_golang_google_grpc_cmd_protoc_gen_go_grpc; Restarting.
    Fetching repository @@org_golang_google_protobuf; Restarting.
    Fetching repository @@bazel_tools~cc_configure_extension~local_config_cc; starting
    Fetching https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.6.zip
    Fetching https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/apple_support/releases/download/0.11.0/apple_support.0.11.0.tar.gz ... (9 fetches)
make: *** [Makefile:48: internal-regenerate-proto] Error 1

rules_proto_grpc Version

4.6.0

Bazel Version

7.0.0

OS

macOS

Link to Demo Repo

No response

MODULE.bazel or WORKSPACE Content

No response

BUILD Content

No response

Proto Content

No response

Any Other Content

No response

ash2k avatar Jan 06 '24 04:01 ash2k

https://github.com/bazelbuild/rules_apple/pull/2034

https://github.com/bazelbuild/rules_apple/issues/2035

ash2k avatar Jan 06 '24 04:01 ash2k

This has been fixed in HEAD for gRPC, so once they release a new version after 1.60.0 rules_proto_grpc just needs to upgrade to that version

binoche9 avatar Jan 22 '24 15:01 binoche9

Seems that it has been released 1.62.0 already

imkebe avatar Feb 26 '24 19:02 imkebe

Version 5.0.0 should have the version of grpc that resolves this. Let me know if you still see the problem after upgrading

aaliddell avatar Jul 31 '24 15:07 aaliddell

Thanks! I managed to move to bzlmod a few weeks ago, so I don't know if this is still an issue.

ash2k avatar Jul 31 '24 23:07 ash2k