From df9b3e25a125b678ee1b809dae445e820eda517e Mon Sep 17 00:00:00 2001 From: hoshinojyunn Date: Mon, 17 Aug 2026 17:59:10 +0800 Subject: [PATCH] [fix](be) Keep relocated storage sources out of unity builds ### What problem does this PR solve? Issue Number: None Related PR: #66052 Problem Summary: The Storage unity-build exclusions still referenced collection_statistics.cpp under storage/compaction after the source moved to storage/index/inverted/similarity. CMake rejects the stale path during configuration. Restoring the exclusion at its relocated path also changes unity batch composition and exposes duplicate anonymous-namespace helper names in variant_assembler.cpp and variant_storage_cell.cpp. Exclude variant_storage_cell.cpp from unity batching so the sources keep independent translation units. ### Release note None ### Check List (For Author) - Test: BE build target - cmake --build be/build_Release --target Storage -j192 - Behavior changed: No - Does this need documentation: No --- be/src/storage/CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/be/src/storage/CMakeLists.txt b/be/src/storage/CMakeLists.txt index 21e82183f58dff..807593f57905bd 100644 --- a/be/src/storage/CMakeLists.txt +++ b/be/src/storage/CMakeLists.txt @@ -55,10 +55,8 @@ pch_reuse(Storage) # FORMAT_*_ADD_JSON_NODE, RETURN_IF_ERROR_) must not leak into unity siblings # - the three heaviest template-instantiation TUs (predicate creators) which # would dominate any batch they join -# - compaction/collection_statistics.cpp: its test compiles it a second time -# by #including the .cpp; the test object must shadow a never-pulled archive -# member, but a unity batch is pulled in for its siblings and the linker -# sees a duplicate definition +# - segment/variant/v2/variant_storage_cell.cpp: it and variant_assembler.cpp +# define the same anonymous-namespace helper, which conflicts in one unity batch set(STORAGE_UNITY_SKIP ${CMAKE_CURRENT_SOURCE_DIR}/index/inverted/inverted_index_compound_reader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/index/inverted/inverted_index_fs_directory.cpp @@ -70,7 +68,8 @@ set(STORAGE_UNITY_SKIP ${CMAKE_CURRENT_SOURCE_DIR}/predicate/predicate_creator_comparison.cpp ${CMAKE_CURRENT_SOURCE_DIR}/predicate/predicate_creator_in_list_in.cpp ${CMAKE_CURRENT_SOURCE_DIR}/predicate/predicate_creator_in_list_not_in.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/compaction/collection_statistics.cpp) + ${CMAKE_CURRENT_SOURCE_DIR}/index/inverted/similarity/collection_statistics.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/segment/variant/v2/variant_storage_cell.cpp) if (ENABLE_VARIANT_NESTED_GROUP) # Out-of-tree module sources swapped into this target: unity hygiene # unaudited, keep them individual.