From 8628da085e376891df611eec0e61b795b9676056 Mon Sep 17 00:00:00 2001 From: Konstantin Tsoy Date: Tue, 8 Oct 2024 14:40:13 -0700 Subject: [PATCH] Fix OSS build Summary: X-link: https://github.com/facebookincubator/zstrong/pull/1007 X-link: https://github.com/facebook/proxygen/pull/518 https://github.com/facebook/proxygen/issues/510 git patches on Windows OSS proxygen builds been failing for a while because of new lines Windows vs Unix. I re-generated the patches on Windows and that seems to fix it, and it also works for linux builds so seems fine. Reviewed By: afrind, bigfootjon Differential Revision: D63148510 fbshipit-source-id: 0ee605896820784335c1acd2a3e22b3bdf8394f1 --- .../boost_comparator_operator_fix.patch | 2 +- .../zlib_dont_build_more_than_needed.patch | 67 ++++++++++--------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/build/fbcode_builder/patches/boost_comparator_operator_fix.patch b/build/fbcode_builder/patches/boost_comparator_operator_fix.patch index 3771f2fff..45ee266b0 100644 --- a/build/fbcode_builder/patches/boost_comparator_operator_fix.patch +++ b/build/fbcode_builder/patches/boost_comparator_operator_fix.patch @@ -8,4 +8,4 @@ diff --git a/boost/serialization/strong_typedef.hpp b/boost/serialization/strong + bool operator==(const T& lhs) const {return t == lhs;} \ bool operator<(const D& rhs) const {return t < rhs.t;} \ }; - + diff --git a/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch b/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch index 2ef115714..fee675526 100644 --- a/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch +++ b/build/fbcode_builder/patches/zlib_dont_build_more_than_needed.patch @@ -1,33 +1,34 @@ -diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt ---- ../zlib-1.3.1/CMakeLists.txt 2024-01-22 10:32:37.000000000 -0800 -+++ ./CMakeLists.txt 2024-01-23 13:14:09.870289968 -0800 -@@ -149,10 +149,8 @@ - set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) - endif(MINGW) - --add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -+add_library(zlib ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) --add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) --target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) - set_target_properties(zlib PROPERTIES SOVERSION 1) - -@@ -169,7 +167,7 @@ - - if(UNIX) - # On unix-like platforms the library is almost always called libz -- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) -+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) - if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)) - set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") - endif() -@@ -179,7 +177,7 @@ - endif() - - if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) -- install(TARGETS zlib zlibstatic -+ install(TARGETS zlib - RUNTIME DESTINATION "${INSTALL_BIN_DIR}" - ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +diff -Naur ../zlib-1.3.1/CMakeLists.txt ./CMakeLists.txt +--- ../zlib-1.3.1/CMakeLists.txt 2024-01-22 10:32:37.000000000 -0800 ++++ ./CMakeLists.txt 2024-01-23 13:14:09.870289968 -0800 +@@ -149,10 +149,8 @@ + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) + endif(MINGW) + +-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++add_library(zlib ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) + +@@ -169,7 +167,7 @@ + + if(UNIX) + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +@@ -179,7 +177,7 @@ + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) + \ No newline at end of file