Skip to content

Commit aa7fcb3

Browse files
mkruskal-googlezhangskz
authored andcommitted
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
1 parent 316f493 commit aa7fcb3

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

protos/protos_extension_lock_test.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ void TestConcurrentExtensionAccess(::protos::ExtensionRegistry registry) {
102102
test_theme();
103103
test_theme_extension();
104104
}
105+
#ifndef _MSC_VER
106+
// TODO Re-enable this once github runner issue is resolved.
105107

106108
TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothLazy) {
107109
::upb::Arena arena;
@@ -120,5 +122,7 @@ TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothEager) {
120122
{{&theme, &ThemeExtension::theme_extension}, arena});
121123
}
122124

125+
#endif // _MSC_VER
126+
123127
} // namespace
124128
} // namespace protos_generator::test::protos

src/google/protobuf/compiler/main.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ namespace protobuf {
3535
namespace compiler {
3636

3737
int ProtobufMain(int argc, char* argv[]) {
38+
#ifndef _MSC_VER
39+
// TODO Re-enable this once github runner issue is resolved.
3840
absl::InitializeLog();
41+
#endif // !_MSC_VER
3942

4043
CommandLineInterface cli;
4144
cli.AllowPlugins("protoc-");

src/google/protobuf/compiler/main_no_generators.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ namespace compiler {
1919
// This is a version of protoc that has no built-in code generators.
2020
// See go/protobuf-toolchain-protoc
2121
int ProtocMain(int argc, char* argv[]) {
22+
#ifndef _MSC_VER
23+
// TODO Re-enable this once github runner issue is resolved.
2224
absl::InitializeLog();
25+
#endif // !_MSC_VER
2326

2427
CommandLineInterface cli;
2528
cli.AllowPlugins("protoc-");

0 commit comments

Comments
 (0)