feat: don't rebuild dependencies(of the crate) if the hash changes

It used to rebuild all of the dependencies of the crate, because I
embed the hash in the program, and when commiting there is a new hash.
("revision" or "hash", it is just the git hash)

Now it only rebuilds the final crate, so there is caching again. :)
This commit is contained in:
Tamipes 2026-01-12 13:53:58 +01:00
parent 39b1a84c55
commit e67afc23df

View file

@ -41,12 +41,6 @@
# Additional darwin specific inputs can be set here
pkgs.libiconv
];
# Additional environment variables can be set directly
# MY_CUSTOM_VAR = "some value";
COMMIT_HASH = builtins.substring 0 7 (
if self ? rev then self.rev else "NoDHash"
);
};
craneLibLLvmTools = craneLib.overrideToolchain
@ -64,6 +58,12 @@
# artifacts from above.
my-crate = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts;
# Additional environment variables can be set directly
# MY_CUSTOM_VAR = "some value";
COMMIT_HASH = builtins.substring 0 7 (
if self ? rev then self.rev else "NoDHash"
);
});
in
{