From d89daca98ef9f66af88b8f70a872ae7c09684e01 Mon Sep 17 00:00:00 2001 From: ep-12221 Date: Thu, 18 Jun 2026 11:11:31 +0800 Subject: [PATCH 1/5] Root cause: The Windows SDK's winnt.h defines OPTIONAL as an empty macro (SAL annotation). This caused the OPTIONAL enum value in the `enum class ObReqCheckSumCheckLevel` within ob_req_packet_code.h to be expanded to nothing by the preprocessor, resulting in a syntax error (expected identifier). Additionally, CMakeLists.txt had duplicate links to zstd_objs.lib and lz4-all.lib. Fix: Added `#ifdef`/`#undef OPTIONAL` before the enum definition to resolve the macro conflict. Removed the duplicate library references in CMakeLists.txt (which were already covered by zstd_1_3_8_objs.lib). Impact: Affects only Windows platform compilation; no impact on Linux/macOS. DIMA: 2026061800116825248 --- deps/oblib/src/rpc/frame/ob_req_packet_code.h | 5 +++++ src/observer/CMakeLists.txt | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deps/oblib/src/rpc/frame/ob_req_packet_code.h b/deps/oblib/src/rpc/frame/ob_req_packet_code.h index 2c7d89834..86d422ebf 100644 --- a/deps/oblib/src/rpc/frame/ob_req_packet_code.h +++ b/deps/oblib/src/rpc/frame/ob_req_packet_code.h @@ -90,6 +90,11 @@ enum ObReqPacketCode : int32_t // obcall transport header so the config path keeps compiling. The accessor names // keep the rpc_checksum wording because they mirror the _rpc_checksum config. // --------------------------------------------------------------------------- +// `OPTIONAL` is an (empty) macro in the Windows SDK (winnt.h). Undefine it so +// the enumerator below is not eaten by the preprocessor on MSVC/clang-cl. +#ifdef OPTIONAL +#undef OPTIONAL +#endif enum class ObReqCheckSumCheckLevel { INVALID, diff --git a/src/observer/CMakeLists.txt b/src/observer/CMakeLists.txt index 8a8ae594b..5631970dd 100644 --- a/src/observer/CMakeLists.txt +++ b/src/observer/CMakeLists.txt @@ -521,9 +521,7 @@ if(WIN32) endif() # oblib_add_extra_objects creates separate .lib files not merged into oblib.lib on Windows target_link_libraries(observer_without_bolt PRIVATE - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd/zstd_objs.lib - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/lz4/lz4-all.lib) + ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib) # Itanium ABI _Unwind_* stubs (Windows uses SEH; PL unwinding non-functional) target_sources(observer_without_bolt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/win32_unwind_stubs.c) endif() From d60fa2205a2ef2d64214fea4f934d143afa093d8 Mon Sep 17 00:00:00 2001 From: ep-12221 Date: Thu, 18 Jun 2026 11:18:07 +0800 Subject: [PATCH 2/5] fix ai code --- src/observer/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/observer/CMakeLists.txt b/src/observer/CMakeLists.txt index 5631970dd..0a1f8bf66 100644 --- a/src/observer/CMakeLists.txt +++ b/src/observer/CMakeLists.txt @@ -521,8 +521,10 @@ if(WIN32) endif() # oblib_add_extra_objects creates separate .lib files not merged into oblib.lib on Windows target_link_libraries(observer_without_bolt PRIVATE - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib) - # Itanium ABI _Unwind_* stubs (Windows uses SEH; PL unwinding non-functional) + ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib + ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd/zstd_objs.lib + ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/lz4/lz4-all.lib) + # Itanium ABI _Unwind_* stubs (Windows uses SEH; PL unwinding non-functional) target_sources(observer_without_bolt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/win32_unwind_stubs.c) endif() target_link_libraries(observer_without_bolt From 491d7b38bb0c1749d05a8a347f1003864da0ec85 Mon Sep 17 00:00:00 2001 From: ep-12221 Date: Thu, 18 Jun 2026 11:19:29 +0800 Subject: [PATCH 3/5] fix space --- src/observer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/observer/CMakeLists.txt b/src/observer/CMakeLists.txt index 0a1f8bf66..8b6a5ed1e 100644 --- a/src/observer/CMakeLists.txt +++ b/src/observer/CMakeLists.txt @@ -524,7 +524,7 @@ if(WIN32) ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd/zstd_objs.lib ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/lz4/lz4-all.lib) - # Itanium ABI _Unwind_* stubs (Windows uses SEH; PL unwinding non-functional) + # Itanium ABI _Unwind_* stubs (Windows uses SEH; PL unwinding non-functional) target_sources(observer_without_bolt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/win32_unwind_stubs.c) endif() target_link_libraries(observer_without_bolt From 940042d6902bd6005775eccca9dd58c82e5943a1 Mon Sep 17 00:00:00 2001 From: ep-12221 Date: Thu, 18 Jun 2026 11:30:47 +0800 Subject: [PATCH 4/5] fix(build): remove dangling zstd/zstd_objs.lib link reference on Windows The zstd target was replaced by zstd_1_3_8; the stale link reference broke clean builds (ninja: missing and no known rule to make it). Existing dirty build dirs masked the issue via a leftover .lib file. Co-Authored-By: Claude Opus 4.6 <[REDACTED_EMAIL]> --- src/observer/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/observer/CMakeLists.txt b/src/observer/CMakeLists.txt index 8b6a5ed1e..cee67b4fc 100644 --- a/src/observer/CMakeLists.txt +++ b/src/observer/CMakeLists.txt @@ -522,8 +522,7 @@ if(WIN32) # oblib_add_extra_objects creates separate .lib files not merged into oblib.lib on Windows target_link_libraries(observer_without_bolt PRIVATE ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd/zstd_objs.lib - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/lz4/lz4-all.lib) + ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/lz4/lz4-all.lib) # Itanium ABI _Unwind_* stubs (Windows uses SEH; PL unwinding non-functional) target_sources(observer_without_bolt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/win32_unwind_stubs.c) endif() From 15b926b9c9cb87774c3cb3098d47fcfda072f54c Mon Sep 17 00:00:00 2001 From: ep-12221 Date: Thu, 18 Jun 2026 12:01:31 +0800 Subject: [PATCH 5/5] remove unused dependence --- src/observer/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/observer/CMakeLists.txt b/src/observer/CMakeLists.txt index cee67b4fc..5631970dd 100644 --- a/src/observer/CMakeLists.txt +++ b/src/observer/CMakeLists.txt @@ -521,8 +521,7 @@ if(WIN32) endif() # oblib_add_extra_objects creates separate .lib files not merged into oblib.lib on Windows target_link_libraries(observer_without_bolt PRIVATE - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib - ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/lz4/lz4-all.lib) + ${CMAKE_BINARY_DIR}/deps/oblib/src/lib/compress/zstd_1_3_8/zstd_1_3_8_objs.lib) # Itanium ABI _Unwind_* stubs (Windows uses SEH; PL unwinding non-functional) target_sources(observer_without_bolt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/win32_unwind_stubs.c) endif()