push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 492bcccd9a..9c907a87a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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(fizz CONFIG REQUIRED)
find_package(wangle CONFIG REQUIRED)
find_package(ZLIB REQUIRED)
@@ -120,7 +120,6 @@
find_package(Threads)
include_directories(
${LIBGFLAGS_INCLUDE_DIR}
- ${GLOG_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${ZSTD_INCLUDE_DIRS}
${Xxhash_INCLUDE_DIR}
diff --git a/thrift/example/cpp2/CMakeLists.txt b/thrift/example/cpp2/CMakeLists.txt
index afa28dad61..318860b3d6 100644
--- a/thrift/example/cpp2/CMakeLists.txt
+++ b/thrift/example/cpp2/CMakeLists.txt
@@ -28,7 +28,7 @@
thriftcpp2
chatroom-cpp2
${LIBGFLAGS_LIBRARY}
- ${GLOG_LIBRARIES}
+ glog::glog
)
install(
TARGETS example_server
diff --git a/thrift/lib/cpp/CMakeLists.txt b/thrift/lib/cpp/CMakeLists.txt
index 2c65e1f0a8..1e80060100 100644
--- a/thrift/lib/cpp/CMakeLists.txt
+++ b/thrift/lib/cpp/CMakeLists.txt
@@ -43,7 +43,7 @@
PUBLIC
Folly::folly
${LIBGFLAGS_LIBRARY}
- ${GLOG_LIBRARIES}
+ glog::glog
)
add_library(
@@ -121,7 +121,7 @@
Boost::boost
Folly::folly
wangle::wangle
- ${GLOG_LIBRARIES}
+ glog::glog
${OPENSSL_LIBRARIES}
)
@@ -137,7 +137,7 @@
thriftprotocol
transport
Folly::folly
- ${GLOG_LIBRARIES}
+ glog::glog
)
set(THRIFT1_HEADER_DIRS
diff --git a/thrift/lib/cpp2/CMakeLists.txt b/thrift/lib/cpp2/CMakeLists.txt
index 03216f5d6f..5f31fc0c64 100644
--- a/thrift/lib/cpp2/CMakeLists.txt
+++ b/thrift/lib/cpp2/CMakeLists.txt
@@ -75,7 +75,7 @@
Folly::folly
thriftmetadata
thriftprotocol
- ${GLOG_LIBRARIES}
+ glog::glog
${LIBGFLAGS_LIBRARY}
)
@@ -207,7 +207,7 @@
thrift
Folly::folly
wangle::wangle
- ${GLOG_LIBRARIES}
+ glog::glog
thrift-core
)

View File

@@ -0,0 +1,140 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
ninja,
openssl,
gflags,
glog,
folly,
fizz,
wangle,
zlib,
zstd,
xxHash,
mvfst,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "fbthrift";
version = "2025.09.15.00";
outputs = [
# Trying to split this up further into `bin`, `out`, and `dev`
# causes issues with circular references due to the installed CMake
# files referencing the path to the compiler.
"out"
"lib"
];
src = fetchFromGitHub {
owner = "facebook";
repo = "fbthrift";
tag = "v${finalAttrs.version}";
hash = "sha256-4u3SbbmSgtvnW3/VH3CfQrEddAlkQuUl9dmnGGKL4mE=";
};
patches = [
# Map `$NIX_BUILD_TOP` to `/build` in the Thrift compiler output to
# avoid reproducibility issues on Darwin.
./scrub-build-directory-from-output.patch
# Remove a line that breaks the build due to the CMake classic of
# incorrect path concatenation.
./remove-cmake-install-rpath.patch
./glog-0.7.patch
];
nativeBuildInputs = [
cmake
ninja
];
buildInputs = [
openssl
gflags
glog
folly
fizz
wangle
zlib
zstd
];
propagatedBuildInputs = [
mvfst
xxHash
];
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "thriftpy" false)
# TODO: Cant figure out where the C++ tests are wired up in the
# CMake build, if anywhere, and this requires Python.
#(lib.cmakeBool "enable_tests" finalAttrs.finalPackage.doCheck)
(lib.cmakeFeature "BIN_INSTALL_DIR" "${placeholder "out"}/bin")
(lib.cmakeFeature "INCLUDE_INSTALL_DIR" "${placeholder "out"}/include")
(lib.cmakeFeature "LIB_INSTALL_DIR" "${placeholder "lib"}/lib")
(lib.cmakeFeature "CMAKE_INSTALL_DIR" "${placeholder "out"}/lib/cmake/fbthrift")
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Homebrew sets this, and the shared library build fails without
# it. I dont know, either. It scares me.
(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:
# <https://github.com/facebook/fbthrift/commit/58038399cefc0c2256ce4ef5444dee37147cbf07>
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:
#
# * <https://github.com/facebook/fbthrift/issues/618>
# * <https://github.com/facebook/fbthrift/issues/607>
# * <https://github.com/Homebrew/homebrew-core/blob/2135255c78d026541a4106fa98580795740db694/Formula/f/fbthrift.rb#L52-L55>
#
# I dont know why we didnt need this before the bump to 202
# to 2025.09.08.00 when wed been on LLVM 19 for an entire release
# cycle already, or why were 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 dont 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 = {
description = "Facebook's branch of Apache Thrift";
mainProgram = "thrift1";
homepage = "https://github.com/facebook/fbthrift";
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
pierreis
kylesferrazza
emily
techknowlogick
];
};
})

View File

@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6b2b2a810..497dcd3d94 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,6 @@
set(CMAKE_INSTALL_DIR lib/cmake/fbthrift CACHE STRING
"The subdirectory where CMake package config files should be installed")
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Add root dir so qualified includes work, e.g. #include "thrift/compiler/*.h".

View File

@@ -0,0 +1,36 @@
diff --git a/thrift/compiler/generate/t_mstch_cpp2_generator.cc b/thrift/compiler/generate/t_mstch_cpp2_generator.cc
index d232df5158..96d15efbda 100644
--- a/thrift/compiler/generate/t_mstch_cpp2_generator.cc
+++ b/thrift/compiler/generate/t_mstch_cpp2_generator.cc
@@ -1116,6 +1116,13 @@
mstch::node autogen_path() {
std::string path = service_->program()->path();
std::replace(path.begin(), path.end(), '\\', '/');
+ // Ensure output reproducibility for Nix builds.
+ if (auto nix_build_top = std::getenv("NIX_BUILD_TOP")) {
+ auto prefix = std::string(nix_build_top) + "/";
+ if (path.starts_with(prefix)) {
+ path.replace(0, prefix.length(), "/build/");
+ }
+ }
return path;
}
mstch::node cpp_includes() {
diff --git a/thrift/compiler/generate/t_whisker_generator.cc b/thrift/compiler/generate/t_whisker_generator.cc
index 99a6ac14af..fa91a05247 100644
--- a/thrift/compiler/generate/t_whisker_generator.cc
+++ b/thrift/compiler/generate/t_whisker_generator.cc
@@ -572,6 +572,13 @@
// use posix path separators, even on windows, for autogen comment
// to avoid spurious fixture regen diffs
std::replace(path.begin(), path.end(), '\\', '/');
+ // Ensure output reproducibility for Nix builds.
+ if (auto nix_build_top = std::getenv("NIX_BUILD_TOP")) {
+ auto prefix = std::string(nix_build_top) + "/";
+ if (path.starts_with(prefix)) {
+ path.replace(0, prefix.length(), "/build/");
+ }
+ }
return path;
});
def.property("namespaces", [&](const t_program& self) -> map::ptr {