From cf5377c60743cbeb7e3098206e1d0f77d4925a32 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Thu, 5 Jun 2025 15:07:58 +0200 Subject: [PATCH] Revert "stalwart-mail: build against system jemalloc" --- pkgs/by-name/st/stalwart-mail/package.nix | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index 6aa5c143921e..f60bc10cfe64 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -9,7 +9,6 @@ sqlite, foundationdb, zstd, - rust-jemalloc-sys-unprefixed, stdenv, nix-update-script, nixosTests, @@ -19,9 +18,6 @@ stalwartEnterprise ? false, }: -let - rocksdbJemalloc = rocksdb.override { enableJemalloc = true; }; -in rustPlatform.buildRustPackage (finalAttrs: { pname = "stalwart-mail" + (lib.optionalString stalwartEnterprise "-enterprise"); version = "0.12.2"; @@ -33,17 +29,6 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-P19jeEzFE8Gu6hqHZJiPoJ70r+zOmzOpEwfFqPQczZY="; }; - # rocksdb does not properly distinguish between pointers it has allocated itself - # and pointers which were passed in and might be registered with a different - # allocator, so we enable the unprefixed_malloc_on_supported_platforms to use - # jemalloc implicitly in the entire process. - postPatch = '' - for file in crates/main/Cargo.toml tests/Cargo.toml; do - substituteInPlace $file --replace-fail \ - 'jemallocator = "0.5.0"' 'jemallocator = { version = "0.5.0", features = ["unprefixed_malloc_on_supported_platforms"] }' - done - ''; - useFetchCargoVendor = true; cargoHash = "sha256-WVvDapCA9pTgOtPpbsK78u2AC2hUfo3sOejZ6pJSlQk="; @@ -58,8 +43,6 @@ rustPlatform.buildRustPackage (finalAttrs: { openssl sqlite zstd - rust-jemalloc-sys-unprefixed - rocksdbJemalloc ] ++ lib.optionals (stdenv.hostPlatform.isLinux && withFoundationdb) [ foundationdb ]; # Issue: https://github.com/stalwartlabs/stalwart/issues/1104 @@ -80,8 +63,8 @@ rustPlatform.buildRustPackage (finalAttrs: { env = { OPENSSL_NO_VENDOR = true; ZSTD_SYS_USE_PKG_CONFIG = true; - ROCKSDB_INCLUDE_DIR = "${rocksdbJemalloc}/include"; - ROCKSDB_LIB_DIR = "${rocksdbJemalloc}/lib"; + ROCKSDB_INCLUDE_DIR = "${rocksdb}/include"; + ROCKSDB_LIB_DIR = "${rocksdb}/lib"; }; postInstall = '' @@ -172,7 +155,7 @@ rustPlatform.buildRustPackage (finalAttrs: { __darwinAllowLocalNetworking = true; passthru = { - rocksdb = rocksdbJemalloc; # make used rocksdb version available (e.g., for backup scripts) + inherit rocksdb; # make used rocksdb version available (e.g., for backup scripts) webadmin = callPackage ./webadmin.nix { }; updateScript = nix-update-script { }; tests.stalwart-mail = nixosTests.stalwart-mail;