From 17eb3545906d21f2ed18f0f0f917a4638f12ef6c Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 5 May 2024 00:23:36 -0700 Subject: [PATCH] prevent bindgen and dependents from building twice See also . --- nix/pkgs/default/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nix/pkgs/default/default.nix b/nix/pkgs/default/default.nix index 8cfeac8e..d5accf32 100644 --- a/nix/pkgs/default/default.nix +++ b/nix/pkgs/default/default.nix @@ -1,6 +1,7 @@ # Dependencies (keep sorted) { craneLib , inputs +, jq , lib , pkgsBuildHost , rocksdb @@ -21,6 +22,7 @@ let }; in { + NIX_OUTPATH_USED_AS_RANDOM_SEED = "randomseed"; CARGO_PROFILE = profile; ROCKSDB_INCLUDE_DIR = "${rocksdb'}/include"; ROCKSDB_LIB_DIR = "${rocksdb'}/lib"; @@ -63,6 +65,12 @@ let # weirdness", pkgs.rustPlatform.bindgenHook on its own doesn't quite do the # right thing here. pkgsBuildHost.rustPlatform.bindgenHook + + # We don't actually depend on `jq`, but crane's `buildPackage` does, but + # its `buildDepsOnly` doesn't. This causes those two derivations to have + # differing values for `NIX_CFLAGS_COMPILE`, which contributes to spurious + # rebuilds of bindgen and its depedents. + jq ]; }; in