prevent bindgen and dependents from building twice

See also <https://crane.dev/faq/rebuilds-bindgen.html>.
This commit is contained in:
Charles Hall 2024-05-05 00:23:36 -07:00
parent 21a4b9e5a1
commit 17eb354590
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -1,6 +1,7 @@
# Dependencies (keep sorted) # Dependencies (keep sorted)
{ craneLib { craneLib
, inputs , inputs
, jq
, lib , lib
, pkgsBuildHost , pkgsBuildHost
, rocksdb , rocksdb
@ -21,6 +22,7 @@ let
}; };
in in
{ {
NIX_OUTPATH_USED_AS_RANDOM_SEED = "randomseed";
CARGO_PROFILE = profile; CARGO_PROFILE = profile;
ROCKSDB_INCLUDE_DIR = "${rocksdb'}/include"; ROCKSDB_INCLUDE_DIR = "${rocksdb'}/include";
ROCKSDB_LIB_DIR = "${rocksdb'}/lib"; ROCKSDB_LIB_DIR = "${rocksdb'}/lib";
@ -63,6 +65,12 @@ let
# weirdness", pkgs.rustPlatform.bindgenHook on its own doesn't quite do the # weirdness", pkgs.rustPlatform.bindgenHook on its own doesn't quite do the
# right thing here. # right thing here.
pkgsBuildHost.rustPlatform.bindgenHook 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 in