Avoid calling absl::InitializeLog in protoc with MSVC

The recent github runner image update changes the MSVC version, and InitializeLog now crashes in optimized builds.  Until Abseil works with MSVC, we can just log to stderr in protoc.

PiperOrigin-RevId: 641024759
pull/17053/head
Mike Kruskal 8 months ago committed by Copybara-Service
parent 3fe3459973
commit 81c0ec381a
  1. 4
      protos/protos_extension_lock_test.cc
  2. 3
      src/google/protobuf/compiler/main.cc
  3. 3
      src/google/protobuf/compiler/main_no_generators.cc

@ -102,6 +102,8 @@ void TestConcurrentExtensionAccess(::protos::ExtensionRegistry registry) {
test_theme();
test_theme_extension();
}
#ifndef _MSC_VER
// TODO Re-enable this once github runner issue is resolved.
TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothLazy) {
::upb::Arena arena;
@ -120,5 +122,7 @@ TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothEager) {
{{&theme, &ThemeExtension::theme_extension}, arena});
}
#endif // _MSC_VER
} // namespace
} // namespace protos_generator::test::protos

@ -35,7 +35,10 @@ namespace protobuf {
namespace compiler {
int ProtobufMain(int argc, char* argv[]) {
#ifndef _MSC_VER
// TODO Re-enable this once github runner issue is resolved.
absl::InitializeLog();
#endif // !_MSC_VER
CommandLineInterface cli;
cli.AllowPlugins("protoc-");

@ -19,7 +19,10 @@ namespace compiler {
// This is a version of protoc that has no built-in code generators.
// See go/protobuf-toolchain-protoc
int ProtocMain(int argc, char* argv[]) {
#ifndef _MSC_VER
// TODO Re-enable this once github runner issue is resolved.
absl::InitializeLog();
#endif // !_MSC_VER
CommandLineInterface cli;
cli.AllowPlugins("protoc-");

Loading…
Cancel
Save