From e9995a5aded046f2a4440b68f06e0833fd8bb35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 17 Jul 2022 20:18:46 +0200 Subject: [PATCH] rspamd: fix crashes by switching pcre2 -> pcre1 on x86-64 the impact should be also minimal because hyperscan is used for performance critical regexes. --- pkgs/servers/mail/rspamd/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/mail/rspamd/default.nix b/pkgs/servers/mail/rspamd/default.nix index a720500380e..05d71c9bad3 100644 --- a/pkgs/servers/mail/rspamd/default.nix +++ b/pkgs/servers/mail/rspamd/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, cmake, perl -, glib, luajit, openssl, pcre2, pkg-config, sqlite, ragel, icu +, glib, luajit, openssl, pcre, pkg-config, sqlite, ragel, icu , hyperscan, jemalloc, blas, lapack, lua, libsodium , withBlas ? true , withHyperscan ? stdenv.isx86_64 @@ -23,12 +23,14 @@ stdenv.mkDerivation rec { hardeningEnable = [ "pie" ]; nativeBuildInputs = [ cmake pkg-config perl ]; - buildInputs = [ glib openssl pcre2 sqlite ragel icu jemalloc libsodium ] + buildInputs = [ glib openssl pcre sqlite ragel icu jemalloc libsodium ] ++ lib.optional withHyperscan hyperscan ++ lib.optionals withBlas [ blas lapack ] ++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua; cmakeFlags = [ + # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908 + "-DENABLE_PCRE2=OFF" "-DDEBIAN_BUILD=ON" "-DRUNDIR=/run/rspamd" "-DDBDIR=/var/lib/rspamd"