From 57df9915df67453ca7e063cacb71d6632d4e6afa Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Fri, 11 Oct 2024 10:06:46 -0700 Subject: [PATCH] Applying local patch to workaround abseil/abseil-cpp/issues/1769 Until abseil integrates this fix upstream, grpc picks up the new version of abseil with the fix, and until triton upgrades the grpc dependency, this will alleviate the repeated build issues in the meantime. --- CMakeLists.txt | 4 +++- tools/abseil_no_rebuild.patch | 28 ++++++++++++++++++++++++++++ tools/azure_no_deprecated.patch | 13 ------------- 3 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 tools/abseil_no_rebuild.patch delete mode 100644 tools/azure_no_deprecated.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e98f4fe..f4889546 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,9 @@ ExternalProject_Add(grpc-repo TEST_COMMAND "" CMAKE_CACHE_ARGS -DCMAKE_CXX_STANDARD:STRING=${TRITON_MIN_CXX_STANDARD} - PATCH_COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src ${INSTALL_SRC_DEST_ARG} --dest-basename=grpc_1.54.3 + # TODO(nnoble): remove this patch when the fix for https://github.com/abseil/abseil-cpp/issues/1769 is integrated within our dependencies + PATCH_COMMAND patch -N -i ${CMAKE_CURRENT_SOURCE_DIR}/tools/abseil_no_rebuild.patch -d ${CMAKE_CURRENT_BINARY_DIR}/grpc-repo/src/grpc/third_party/abseil-cpp + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/install_src.py --src ${INSTALL_SRC_DEST_ARG} --dest-basename=grpc_1.54.3 ) # # Build nlohmann/json diff --git a/tools/abseil_no_rebuild.patch b/tools/abseil_no_rebuild.patch new file mode 100644 index 00000000..9b373922 --- /dev/null +++ b/tools/abseil_no_rebuild.patch @@ -0,0 +1,28 @@ +--- CMakeLists.txt 2024-10-11 14:03:51.391048256 -0700 ++++ CMakeLists-patched.txt 2024-10-11 14:04:21.902731994 -0700 +@@ -214,6 +214,7 @@ + PATTERN "*.h" + PATTERN "copts" EXCLUDE + PATTERN "testdata" EXCLUDE ++ PATTERN "options.h" EXCLUDE + ) + + file(READ "absl/base/options.h" ABSL_INTERNAL_OPTIONS_H_CONTENTS) +@@ -230,6 +231,17 @@ + ABSL_INTERNAL_OPTIONS_H_PINNED + "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") + endif() ++ set(ABSL_INTERNAL_OPTIONS_H_PINNED_GENERATE TRUE) ++ if (EXISTS "${CMAKE_BINARY_DIR}/options-pinned.h") ++ file(READ "${CMAKE_BINARY_DIR}/options-pinned.h" ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS) ++ if ("${ABSL_INTERNAL_OPTIONS_H_PINNED}" STREQUAL "${ABSL_INTERNAL_OPTIONS_PINNED_H_CONTENTS}") ++ set(ABSL_INTERNAL_OPTIONS_H_PINNED_GENERATE FALSE) ++ endif() ++ endif() ++ ++ if (ABSL_INTERNAL_OPTIONS_H_PINNED_GENERATE) ++ file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/options-pinned.h" CONTENT "${ABSL_INTERNAL_OPTIONS_H_PINNED}") ++ endif() + file(WRITE "${CMAKE_BINARY_DIR}/options-pinned.h" "${ABSL_INTERNAL_OPTIONS_H_PINNED}") + + install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h" diff --git a/tools/azure_no_deprecated.patch b/tools/azure_no_deprecated.patch deleted file mode 100644 index d625abdd..00000000 --- a/tools/azure_no_deprecated.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index dfb441e..af3dd36 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -173,7 +173,7 @@ target_link_libraries(azure-storage-lite Threads::Threads ${CURL_LIBRARIES} ${EX - if(MSVC) - target_compile_options(azure-storage-lite PRIVATE /W4 /WX /MP) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") -- target_compile_options(azure-storage-lite PRIVATE -Wall -Wextra -Werror -pedantic) -+ target_compile_options(azure-storage-lite PRIVATE -Wall -Wextra -Werror -pedantic -Wno-deprecated-declarations) - endif() - - if(BUILD_ADLS)