Skip to content

Commit

Permalink
Avoid double counting lite test protos
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mkruskal-google authored and copybara-github committed Oct 14, 2023
1 parent 4b301ad commit 4a24a29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down

0 comments on commit 4a24a29

Please sign in to comment.