From 4a24a29780835addf10a2a21fe1f7d80c78f8a64 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 13 Oct 2023 20:39:22 -0700 Subject: [PATCH] Avoid double counting lite test protos This is likely the cause of our macos cmake flakes. Both the lite and full tests trigger codegen of the lite protos, but there's no dependency between them. This creates a race condition, where it's possible for the files to be invalid by the time one of their builds is triggered. This is consistent with the error message we see: liblibtest_common_lite.a(unittest_lite.pb.cc.o) has no symbols PiperOrigin-RevId: 573381442 --- cmake/tests.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/tests.cmake b/cmake/tests.cmake index 6b7707b984fb..489ca65c2a61 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -15,7 +15,6 @@ set(tests_protos ${protobuf_test_protos_files} ${compiler_test_protos_files} ${util_test_protos_files} - ${lite_test_protos} ) set(protoc_cpp_args) @@ -120,6 +119,7 @@ if (MSVC) endif() target_link_libraries(tests libtest_common + libtest_common_lite ${protobuf_LIB_PROTOC} ${protobuf_LIB_PROTOBUF} ${protobuf_ABSL_USED_TARGETS} @@ -131,6 +131,7 @@ add_executable(fake_plugin ${fake_plugin_files} ${common_test_files}) target_include_directories(fake_plugin PRIVATE ${ABSL_ROOT_DIR}) target_link_libraries(fake_plugin libtest_common + libtest_common_lite ${protobuf_LIB_PROTOC} ${protobuf_LIB_PROTOBUF} ${protobuf_ABSL_USED_TARGETS} @@ -142,6 +143,7 @@ add_executable(test_plugin ${test_plugin_files} ${common_test_files}) target_include_directories(test_plugin PRIVATE ${ABSL_ROOT_DIR}) target_link_libraries(test_plugin libtest_common + libtest_common_lite ${protobuf_LIB_PROTOC} ${protobuf_LIB_PROTOBUF} ${protobuf_ABSL_USED_TARGETS}