From 354a96d688469c33848745b3da81570231cf2f68 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 17 Oct 2025 19:44:55 -0400 Subject: [PATCH] chore: downgrade gRPC version for Windows compatibility - Changed gRPC version from v1.75.1 to v1.68.0 to resolve linker errors related to protobuf resource files on Windows. - Updated compatibility notes to reflect the stable version and reasons for the downgrade. Benefits: - Improves build stability on Windows by avoiding LNK1241 errors during linking. - Ensures better compatibility with clang-cl and MSVC toolchains. --- cmake/grpc.cmake | 14 ++++---------- cmake/grpc_windows.cmake | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cmake/grpc.cmake b/cmake/grpc.cmake index 5e3506e8..48a5beca 100644 --- a/cmake/grpc.cmake +++ b/cmake/grpc.cmake @@ -103,13 +103,6 @@ set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "" FORCE) set(protobuf_WITH_ZLIB ON CACHE BOOL "" FORCE) set(protobuf_MSVC_STATIC_RUNTIME ON CACHE BOOL "" FORCE) -# Disable protobuf version resource on Windows to avoid LNK1241 duplicate resource errors -# gRPC v1.75.1 protobuf generates version.res that gets linked multiple times -if(WIN32) - set(protobuf_RC_FILEVERSION "" CACHE STRING "" FORCE) - set(protobuf_DISABLE_RTTI ON CACHE BOOL "" FORCE) -endif() - # Abseil configuration set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "" FORCE) set(ABSL_ENABLE_INSTALL ON CACHE BOOL "" FORCE) @@ -125,15 +118,16 @@ endif() # Declare gRPC with platform-specific versions # - macOS/Linux: v1.75.1 (has ARM64 + modern Clang fixes) -# - Windows: v1.75.1 (better NASM/clang-cl support than v1.67.1) -set(_GRPC_VERSION "v1.75.1") +# - Windows: v1.68.0 (stable, no protobuf resource file issues) if(WIN32) - set(_GRPC_VERSION_REASON "Windows clang-cl + MSVC compatibility") + set(_GRPC_VERSION "v1.68.0") + set(_GRPC_VERSION_REASON "Windows clang-cl + MSVC compatibility, no protobuf LNK1241 errors") # Disable BoringSSL ASM to avoid NASM build issues on Windows # ASM optimizations cause NASM flag conflicts with clang-cl set(OPENSSL_NO_ASM ON CACHE BOOL "" FORCE) message(STATUS "Disabling BoringSSL ASM optimizations for Windows build compatibility") else() + set(_GRPC_VERSION "v1.75.1") set(_GRPC_VERSION_REASON "ARM64 macOS + modern Clang compatibility") endif() diff --git a/cmake/grpc_windows.cmake b/cmake/grpc_windows.cmake index 9d053d5d..caab5422 100644 --- a/cmake/grpc_windows.cmake +++ b/cmake/grpc_windows.cmake @@ -242,7 +242,7 @@ if(WIN32 AND YAZE_USE_VCPKG_GRPC) message(STATUS " vcpkg gRPC not found (expected if removed from vcpkg.json)") message(STATUS " Using FetchContent build (faster with caching)") message(STATUS " First build: ~10-15 min, subsequent: <1 min (cached)") - message(STATUS " Using gRPC v1.75.1 with Windows compatibility fixes") + message(STATUS " Using gRPC v1.68.0 (stable for Windows, no linker errors)") message(STATUS " Note: BoringSSL ASM disabled for clang-cl compatibility") message(STATUS "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━") endif()