fix dynamic builds with liburing
The original implementation of this was really weird, so I restructed it a lot while debugging, and am just gonna leave the restructured version. Root cause of the segfault seems to be that upstream nixpkgs liburing derivation is generating both static and dynamic libraries, causing rocksdb to statically link liburing in a dynamic build, pulling in some allocator stuff at the same time. I created a PR[1] to fix this upstream, but it probably won't be available on nixos-unstable for quite a while, so we can also patch it locally. [1]: https://github.com/NixOS/nixpkgs/pull/314945
This commit is contained in:
parent
a08f90b161
commit
b4cd8e9140
2 changed files with 27 additions and 21 deletions
18
flake.nix
18
flake.nix
|
@ -42,6 +42,24 @@
|
|||
(builtins.fromJSON (builtins.readFile ./flake.lock))
|
||||
.nodes.rocksdb.original.ref;
|
||||
});
|
||||
# TODO: remove once https://github.com/NixOS/nixpkgs/pull/314945 is available
|
||||
liburing = pkgs.liburing.overrideAttrs (old: {
|
||||
# the configure script doesn't support these, and unconditionally
|
||||
# builds both static and dynamic libraries.
|
||||
configureFlags = pkgs.lib.subtractLists
|
||||
[ "--enable-static" "--disable-shared" ]
|
||||
old.configureFlags;
|
||||
|
||||
postInstall = old.postInstall + ''
|
||||
# we remove the extra outputs
|
||||
#
|
||||
# we need to do this to prevent rocksdb from trying to link the
|
||||
# static library in a dynamic stdenv
|
||||
rm $out/lib/liburing*${
|
||||
if pkgs.stdenv.hostPlatform.isStatic then ".so*" else ".a"
|
||||
}
|
||||
'';
|
||||
});
|
||||
});
|
||||
|
||||
scopeHost = mkScope pkgsHost;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue