Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thrift: 0.18.1 -> 0.20.0 #296770

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions pkgs/by-name/th/thrift/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
lib,
stdenv,
fetchFromGitHub,
boost,
zlib,
libevent,
openssl,
python3,
cmake,
pkg-config,
bison,
pkgsBuildHost,
flex,
glibcLocales,
nix-update-script,
testers,
static ? stdenv.hostPlatform.isStatic,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "thrift";
version = "0.20.0";

src = fetchFromGitHub {
owner = "apache";
repo = "thrift";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-cwFTcaNHq8/JJcQxWSelwAGOLvZHoMmjGV3HBumgcWo=";
};

strictDeps = true;

# Workaround to make the Python wrapper not drop this package:
# pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
pythonPath = [ ];

nativeBuildInputs = [
bison
cmake
flex
pkg-config
(python3.pythonOnBuildForHost.withPackages (ps: [
ps.setuptools
ps.tornado
ps.twisted
]))
];

buildInputs = [ boost ];

propagatedBuildInputs = [
libevent
openssl
zlib
];

postPatch = ''
# Python 3.10 related failures:
# SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
# AttributeError: module 'collections' has no attribute 'Hashable'
substituteInPlace test/py/RunClientServer.py \
--replace "'FastbinaryTest.py'," "" \
--replace "'TestEof.py'," "" \
--replace "'TestFrozen.py'," ""

# these functions are removed in Python3.12
substituteInPlace test/py/SerializationTest.py \
--replace-fail "assertEquals" "assertEqual" \
--replace-fail "assertNotEquals" "assertNotEqual"
'';

preConfigure = ''
export PY_PREFIX=$out
'';

cmakeFlags =
[
(lib.cmakeBool "BUILD_JAVASCRIPT" false)
(lib.cmakeBool "BUILD_NODEJS" false)
(lib.cmakeBool "WITH_STATIC_LIB" static)
(lib.cmakeBool "Boost_USE_STATIC_LIBS" static)
(lib.cmakeBool "OPENSSL_USE_STATIC_LIBS" static)
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
"-DTHRIFT_COMPILER=${pkgsBuildHost.thrift}/bin/thrift"
];

nativeCheckInputs = [ glibcLocales ];

checkPhase =
let
disabledTests =
[
"PythonTestSSLSocket"
"PythonThriftTNonblockingServer"
"python_test"
]
++ lib.optionals stdenv.isDarwin [
# Tests that hang up in the Darwin sandbox
"SecurityTest"
"SecurityFromBufferTest"

# fails on hydra, passes locally
"concurrency_test"

# Tests that fail in the Darwin sandbox when trying to use network
"UnitTests"
"TInterruptTest"
"TServerIntegrationTest"
"processor"
"TNonblockingServerTest"
"TNonblockingSSLServerTest"
"StressTest"
"StressTestConcurrent"
"StressTestNonBlocking"
];
in
''
runHook preCheck

export LD_LIBRARY_PATH=$PWD/lib
export DYLD_LIBRARY_PATH=$PWD/lib
ctest -E '^${lib.concatStringsSep "|" disabledTests}$'

runHook postCheck
'';

enableParallelChecking = false;

passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "thrift -version";
};
updateScript = nix-update-script { };
};

meta = with lib; {
description = "Library for scalable cross-language services";
mainProgram = "thrift";
homepage = "https://thrift.apache.org/";
changelog = "https://github.com/apache/thrift/blob/v${finalAttrs.version}/CHANGES.md";
license = licenses.asl20;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [
bjornfor
anthonyroussel
];
};
})
147 changes: 0 additions & 147 deletions pkgs/development/libraries/thrift/default.nix

This file was deleted.

12 changes: 0 additions & 12 deletions pkgs/development/libraries/thrift/disable-failing-test.patch

This file was deleted.

2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24309,8 +24309,6 @@ with pkgs;

theft = callPackage ../development/libraries/theft { };

thrift = callPackage ../development/libraries/thrift { };

tidyp = callPackage ../development/libraries/tidyp { };

tidal-hifi = callPackage ../applications/audio/tidal-hifi { };
Expand Down