diff --git a/nix/overlays/native.nix b/nix/overlays/native.nix index 2ab55e3751..f7f60e0412 100644 --- a/nix/overlays/native.nix +++ b/nix/overlays/native.nix @@ -25,4 +25,11 @@ in { ldapSupport = false; brotliSupport = false; }; + + lmdb = prev.lmdb.overrideAttrs (attrs: { + patches = + optionalList attrs.patches ++ prev.lib.optional prev.stdenv.isDarwin [ + ../pkgs/lmdb/darwin-fsync.patch + ]; + }); } diff --git a/nix/pkgs/lmdb/darwin-fsync.patch b/nix/pkgs/lmdb/darwin-fsync.patch new file mode 100644 index 0000000000..961b8a1ffd --- /dev/null +++ b/nix/pkgs/lmdb/darwin-fsync.patch @@ -0,0 +1,13 @@ +diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c +index fe65e30..0070215 100644 +--- a/libraries/liblmdb/mdb.c ++++ b/libraries/liblmdb/mdb.c +@@ -2526,7 +2526,7 @@ mdb_env_sync(MDB_env *env, int force) + rc = ErrCode(); + } else + #endif +- if (MDB_FDATASYNC(env->me_fd)) ++ if (fcntl(env->me_fd, F_FULLFSYNC, 0)) + rc = ErrCode(); + } + }