fix(tvix/crate2nix-check): make drv less likely to be cached
The derivation name for the check will now be calculated from the hash of all Cargo related files (including in subdirs), this makes it less likely for the drv to be cached and for CI to miss an outdated Cargo.lock. Change-Id: I900e9355be3f8a9d6f01162e8ef0da4d8901af30 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11753 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
34d93f1d96
commit
9b77ce9f8f
1 changed files with 7 additions and 7 deletions
|
@ -185,13 +185,13 @@ in
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
# Important: we include the hash of the Cargo.lock file and
|
# Important: we include the hash of all Cargo related files in the derivation name.
|
||||||
# Cargo.nix file in the derivation name. This forces the FOD
|
# This forces the FOD to be rebuilt/re-verified whenever one of them changes.
|
||||||
# to be rebuilt/reverified whenever either of them changes.
|
name = "tvix-crate2nix-check-" + builtins.substring 0 8 (builtins.hashString "sha256"
|
||||||
name = "tvix-crate2nix-check-" +
|
(lib.concatMapStrings (f: builtins.hashFile "sha256" f)
|
||||||
(builtins.substring 0 8 (builtins.hashFile "sha256" ./Cargo.lock)) +
|
([ ./Cargo.toml ./Cargo.lock ] ++ (map (m: ./. + "/${m}/Cargo.toml") (lib.importTOML ./Cargo.toml).workspace.members))
|
||||||
"-" +
|
)
|
||||||
(builtins.substring 0 8 (builtins.hashFile "sha256" ./Cargo.nix));
|
);
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [ git cacert cargo ];
|
nativeBuildInputs = with pkgs; [ git cacert cargo ];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
|
Loading…
Reference in a new issue