Revert "stalwart-mail: build against system jemalloc"
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user