chore(nix): Clean up rocksdb package

This commit is contained in:
Henry-Hiles authored and Ellis Git committed 2026-11-27 16:41:52 +00:00
1 parent 18c1ce48e2
commit d4d72c0b9e
2 files changed
+22 -37

No files matched your search

+2 -8
View File
@@ -16,10 +16,7 @@
pkgs.nodejs
pkgs.pkg-config
]
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.liburing
pkgs.rust-jemalloc-sys-unprefixed
];
++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.liburing;
env = {
LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.llvmPackages.libclang.lib ];
@@ -28,10 +25,7 @@
pkgs.stdenv.cc.cc.lib
pkgs.llvmPackages.libclang.lib
]
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.liburing
pkgs.jemalloc
]
++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.liburing
);
}
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
+20 -29
View File
@@ -1,36 +1,27 @@
{
# stdenv,
# enableJemalloc ? stdenv.hostPlatform.isLinux,
enableJemalloc ? false,
rocksdb,
fetchFromGitea,
rust-jemalloc-sys-unprefixed,
...
}:
(rocksdb.override {
# rocksdb fails to build with prefixed jemalloc, which is required on
# darwin due to [1]. In this case, fall back to building rocksdb with
# libc malloc. This should not cause conflicts, because all of the
# jemalloc symbols are prefixed.
#
# [1]: https://github.com/tikv/jemallocator/blob/ab0676d77e81268cd09b059260c75b38dbef2d51/jemalloc-sys/src/env.rs#L17
jemalloc = rust-jemalloc-sys-unprefixed;
inherit enableJemalloc;
}).overrideAttrs
({
version = "continuwuity-v0.5.0-unstable-2026-11-08";
src = fetchFromGitea {
domain = "forgejo.ellis.link";
owner = "continuwuation";
repo = "rocksdb";
rev = "722fa3219df4169610fda8962221a1ff74026fdb";
hash = "sha256-ZuXXp83Hgj0B5v499CNxa9oNQUS/ZKYOAZEhmarUifc=";
};
# RocksDB is built without jemalloc integration (the nixpkgs default). On Linux
# it still uses jemalloc at runtime, because continuwuity statically links an
# unprefixed jemalloc that replaces malloc/free process-wide. Linking RocksDB
# against a separate jemalloc puts two allocator instances in one process, which
# caused segfaults on db close/migration.
rocksdb.overrideAttrs ({
version = "continuwuity-v0.5.0-unstable-2026-11-08";
src = fetchFromGitea {
domain = "forgejo.ellis.link";
owner = "continuwuation";
repo = "rocksdb";
rev = "722fa3219df4169610fda8962221a1ff74026fdb";
hash = "sha256-ZuXXp83Hgj0B5v499CNxa9oNQUS/ZKYOAZEhmarUifc=";
};
# We have this already at https://forgejo.ellis.link/continuwuation/rocksdb/commit/a935c0273e1ba44eacf88ce3685a9b9831486155
# Unsetting `patches` so we don't have to revert it and make this nix exclusive
patches = [ ];
# We have this already at https://forgejo.ellis.link/continuwuation/rocksdb/commit/a935c0273e1ba44eacf88ce3685a9b9831486155
# Unsetting `patches` so we don't have to revert it and make this nix exclusive
patches = [ ];
# Unset postPatch, as our version override breaks version-specific sed calls in the original package
postPatch = "";
})
# Unset postPatch, as our version override breaks version-specific sed calls in the original package
postPatch = "";
})