rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

fix: Upgrade protobuf from 21.7 to 23.1/24.4

Open comius opened this issue 1 year ago • 1 comments
trafficstars

The older protobuf version (21.7) is still using legacy struct providers. If used rules_python will fail after the default of --incompatible_disallow_struct_provider_syntax is changed.

Only 23.1 is on BCR (that's why using this version in MODULE.bazel). Unpatched 23.1 fails with no such attribute 'exec_tools' in 'genrule' rule. Protobuf v24.4 and 25.3. fails on Windows. That's why using 26.1

Issue: https://github.com/bazelbuild/bazel/issues/19467

comius avatar Apr 05 '24 09:04 comius

cc @haberman, @mkruskal-google, on Windows platform protoc fails to build. I tried versions 24.4, 25.3, 26.1.

Bazel version 7.1.1 without bzlmod

(version 23.1 with bzlmod works, but only because of a patch in https://github.com/bazelbuild/bazel-central-registry/blob/main/modules/protobuf/23.1/patches/0007-bazel-Get-rid-of-exec_tools.-13401.patch

failures are:

(10:32:00) ERROR: C:/b/y5tfdgmr/external/com_google_protobuf/src/google/protobuf/compiler/BUILD.bazel:97:11: Compiling src/google/protobuf/compiler/command_line_interface.cc [for tool] failed: (Exit 2): cl.exe failed: error executing CppCompile command (from target @@com_google_protobuf//src/google/protobuf/compiler:command_line_interface)

external/com_google_protobuf/src/google/protobuf/compiler/command_line_interface.cc(12): fatal error C1083: Cannot open include file: 'google/protobuf/compiler/command_line_interface.h': No such file or directory

(10:32:00) ERROR: C:/b/y5tfdgmr/external/com_google_protobuf/src/google/protobuf/compiler/csharp/BUILD.bazel:22:11: Compiling src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc [for tool] failed: (Exit 2): cl.exe failed: error executing CppCompile command (from target @@com_google_protobuf//src/google/protobuf/compiler/csharp:csharp)

external/com_google_protobuf/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc(8): fatal error C1083: Cannot open include file: 'google/protobuf/compiler/csharp/csharp_source_generator_base.h': No such file or directory

comius avatar Apr 05 '24 13:04 comius