From 91600d608128bf48155c355ef9da0859a805a884 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 11 Sep 2025 15:32:30 +0100 Subject: [PATCH] fbthrift: 2025.04.21.00 -> 2025.09.15.00 Diff: https://github.com/facebook/fbthrift/compare/v2025.04.21.00...v2025.09.15.00 --- pkgs/by-name/fb/fbthrift/glog-0.7.patch | 24 +++++++-------- pkgs/by-name/fb/fbthrift/package.nix | 41 +++++++++++++++++-------- 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/pkgs/by-name/fb/fbthrift/glog-0.7.patch b/pkgs/by-name/fb/fbthrift/glog-0.7.patch index 23cff743614c..482815161012 100644 --- a/pkgs/by-name/fb/fbthrift/glog-0.7.patch +++ b/pkgs/by-name/fb/fbthrift/glog-0.7.patch @@ -1,17 +1,17 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index c6b2b2a810..1813c88e42 100644 +index 492bcccd9a..9c907a87a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -106,7 +106,7 @@ endif () +@@ -108,7 +108,7 @@ # Find required dependencies for thrift/lib if (THRIFT_LIB_ONLY OR build_all) find_package(Gflags REQUIRED) - find_package(Glog REQUIRED) + find_package(Glog CONFIG REQUIRED) - find_package(folly CONFIG REQUIRED) find_package(fizz CONFIG REQUIRED) find_package(wangle CONFIG REQUIRED) -@@ -119,7 +119,6 @@ if (THRIFT_LIB_ONLY OR build_all) + find_package(ZLIB REQUIRED) +@@ -120,7 +120,6 @@ find_package(Threads) include_directories( ${LIBGFLAGS_INCLUDE_DIR} @@ -23,7 +23,7 @@ diff --git a/thrift/example/cpp2/CMakeLists.txt b/thrift/example/cpp2/CMakeLists index afa28dad61..318860b3d6 100644 --- a/thrift/example/cpp2/CMakeLists.txt +++ b/thrift/example/cpp2/CMakeLists.txt -@@ -28,7 +28,7 @@ target_link_libraries( +@@ -28,7 +28,7 @@ thriftcpp2 chatroom-cpp2 ${LIBGFLAGS_LIBRARY} @@ -33,10 +33,10 @@ index afa28dad61..318860b3d6 100644 install( TARGETS example_server diff --git a/thrift/lib/cpp/CMakeLists.txt b/thrift/lib/cpp/CMakeLists.txt -index 6461588a86..8b6ed1b030 100644 +index 2c65e1f0a8..1e80060100 100644 --- a/thrift/lib/cpp/CMakeLists.txt +++ b/thrift/lib/cpp/CMakeLists.txt -@@ -45,7 +45,7 @@ target_link_libraries( +@@ -43,7 +43,7 @@ PUBLIC Folly::folly ${LIBGFLAGS_LIBRARY} @@ -45,7 +45,7 @@ index 6461588a86..8b6ed1b030 100644 ) add_library( -@@ -121,7 +121,7 @@ target_link_libraries( +@@ -121,7 +121,7 @@ Boost::boost Folly::folly wangle::wangle @@ -54,7 +54,7 @@ index 6461588a86..8b6ed1b030 100644 ${OPENSSL_LIBRARIES} ) -@@ -137,7 +137,7 @@ target_link_libraries( +@@ -137,7 +137,7 @@ thriftprotocol transport Folly::folly @@ -64,10 +64,10 @@ index 6461588a86..8b6ed1b030 100644 set(THRIFT1_HEADER_DIRS diff --git a/thrift/lib/cpp2/CMakeLists.txt b/thrift/lib/cpp2/CMakeLists.txt -index f941688ab0..b3609bbc62 100644 +index 03216f5d6f..5f31fc0c64 100644 --- a/thrift/lib/cpp2/CMakeLists.txt +++ b/thrift/lib/cpp2/CMakeLists.txt -@@ -75,7 +75,7 @@ target_link_libraries( +@@ -75,7 +75,7 @@ Folly::folly thriftmetadata thriftprotocol @@ -76,7 +76,7 @@ index f941688ab0..b3609bbc62 100644 ${LIBGFLAGS_LIBRARY} ) -@@ -206,7 +206,7 @@ target_link_libraries( +@@ -207,7 +207,7 @@ thrift Folly::folly wangle::wangle diff --git a/pkgs/by-name/fb/fbthrift/package.nix b/pkgs/by-name/fb/fbthrift/package.nix index 8d6ab8df0fb0..13bd7fe6b278 100644 --- a/pkgs/by-name/fb/fbthrift/package.nix +++ b/pkgs/by-name/fb/fbthrift/package.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "fbthrift"; - version = "2025.04.21.00"; + version = "2025.09.15.00"; outputs = [ # Trying to split this up further into `bin`, `out`, and `dev` @@ -39,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "facebook"; repo = "fbthrift"; tag = "v${finalAttrs.version}"; - hash = "sha256-W86jBqq0wC8ZYcE7MQ76rV3axPf7efXieEot6ahonUI="; + hash = "sha256-4u3SbbmSgtvnW3/VH3CfQrEddAlkQuUl9dmnGGKL4mE="; }; patches = [ @@ -48,16 +48,6 @@ stdenv.mkDerivation (finalAttrs: { ./remove-cmake-install-rpath.patch ./glog-0.7.patch - - # Backport upstream build system fixes. Remove on next update. - (fetchpatch { - url = "https://github.com/facebook/fbthrift/commit/638384afb83e5fae29a6483d20f9443b2342ca0b.patch"; - hash = "sha256-q0VgaQtwAEgDHZ6btOLSnKfkP2cXstFPxPNdX1wcdCg="; - }) - (fetchpatch { - url = "https://github.com/facebook/fbthrift/commit/350955beef40abec1e9d13112c9d2b7f95c29022.patch"; - hash = "sha256-SaCZ0iczj8He2wujWN08QpizsTsK6OhreroOHY9f0BA="; - }) ]; nativeBuildInputs = [ @@ -101,6 +91,33 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeFeature "CMAKE_SHARED_LINKER_FLAGS" "-Wl,-undefined,dynamic_lookup") ]; + # Fix a typo introduced by the following commit that causes hundreds + # of pointless rebuilds when installing: + # + postPatch = '' + substituteInPlace ThriftLibrary.cmake \ + --replace-fail .tcch .tcc + ''; + + # Copied from Homebrew; fixes the following build error: + # + # [ERROR:/nix/var/nix/b/5f3kn8spg6j0z0xlags8va6sq7/source/thrift/lib/thrift/RpcMetadata.thrift:1] unordered_map::at: key not found + # + # See: + # + # * + # * + # * + # + # I don’t know why we didn’t need this before the bump to 202 + # to 2025.09.08.00 when we’d been on LLVM 19 for an entire release + # cycle already, or why we’re getting different errors to those + # reports, or why this fixes the build anyway. Most of what I do to + # maintain these packages is copy compilation flags from Homebrew + # that scare me. I don’t have very much fun with these libraries, to + # be honest with you. + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-fno-assume-unique-vtables"; + passthru.updateScript = nix-update-script { }; meta = {