rspamd: fix crashes by switching pcre2 -> pcre1

on x86-64 the impact should be also minimal because hyperscan is used
for performance critical regexes.
This commit is contained in:
Jörg Thalheim 2022-07-17 20:18:46 +02:00
parent 9eb60f25af
commit e9995a5ade

View file

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, cmake, perl { 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 , hyperscan, jemalloc, blas, lapack, lua, libsodium
, withBlas ? true , withBlas ? true
, withHyperscan ? stdenv.isx86_64 , withHyperscan ? stdenv.isx86_64
@ -23,12 +23,14 @@ stdenv.mkDerivation rec {
hardeningEnable = [ "pie" ]; hardeningEnable = [ "pie" ];
nativeBuildInputs = [ cmake pkg-config perl ]; 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.optional withHyperscan hyperscan
++ lib.optionals withBlas [ blas lapack ] ++ lib.optionals withBlas [ blas lapack ]
++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua; ++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua;
cmakeFlags = [ cmakeFlags = [
# pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908
"-DENABLE_PCRE2=OFF"
"-DDEBIAN_BUILD=ON" "-DDEBIAN_BUILD=ON"
"-DRUNDIR=/run/rspamd" "-DRUNDIR=/run/rspamd"
"-DDBDIR=/var/lib/rspamd" "-DDBDIR=/var/lib/rspamd"