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:
parent
39b1a84c55
commit
e67afc23df
1 changed files with 6 additions and 6 deletions
12
flake.nix
12
flake.nix
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue