Skip to content

Commit

Permalink
Applying local patch to workaround abseil/abseil-cpp/issues/1769 (#60)
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 authored Oct 14, 2024
1 parent 3d456e0 commit 28f0ad9
Show file tree
Hide file tree
Showing 3 changed files with 32 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
29 changes: 29 additions & 0 deletions tools/abseil_no_rebuild.patch
Original file line number Diff line number Diff line change
@@ -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
13 changes: 0 additions & 13 deletions tools/azure_no_deprecated.patch

This file was deleted.

0 comments on commit 28f0ad9

Please sign in to comment.