From 28f0ad90622e7797ccd519d428bfc9532ba5d376 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Mon, 14 Oct 2024 09:02:42 -0700 Subject: [PATCH] Applying local patch to workaround abseil/abseil-cpp/issues/1769 (#60) 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 | 29 +++++++++++++++++++++++++++++ tools/azure_no_deprecated.patch | 13 ------------- 3 files changed, 32 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..2c8b3250 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 || true + 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..0e5b0b37 --- /dev/null +++ b/tools/abseil_no_rebuild.patch @@ -0,0 +1,29 @@ +--- CMakeLists.txt 2024-10-11 14:53:24.305084638 -0700 ++++ CMakeLists.txt 2024-10-11 14:53:35.288981516 -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,7 +231,17 @@ + ABSL_INTERNAL_OPTIONS_H_PINNED + "${ABSL_INTERNAL_OPTIONS_H_CONTENTS}") + endif() +- file(WRITE "${CMAKE_BINARY_DIR}/options-pinned.h" "${ABSL_INTERNAL_OPTIONS_H_PINNED}") ++ 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() + + install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/absl/base 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)