Skip to content

Commit

Permalink
Applying local patch to workaround abseil/abseil-cpp/issues/1769
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nicolasnoble committed Oct 11, 2024
1 parent 3d456e0 commit f814b25
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SOURCE_DIR> ${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 <SOURCE_DIR> ${INSTALL_SRC_DEST_ARG} --dest-basename=grpc_1.54.3
)
#
# Build nlohmann/json
Expand Down
28 changes: 28 additions & 0 deletions tools/abseil_no_rebuild.patch
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 0 additions & 13 deletions tools/azure_no_deprecated.patch

This file was deleted.

0 comments on commit f814b25

Please sign in to comment.