Skip to content

Commit

Permalink
[nix] Use determinism to handle hash mismatch in chisel publishLocal
Browse files Browse the repository at this point in the history
Signed-off-by: Qiming Chu <[email protected]>
  • Loading branch information
Emin017 committed Feb 1, 2025
1 parent 2d5de8f commit 428636f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/chisel/nix/gcd/gcd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let
publishMillModule {
name = "chisel";
version = "9999";
outputHash = "sha256-fuorZlUbH+oDt6XGHBqMmOXaRHzZVntRgIln1NeYLeQ=";
outputHash = "sha256-wXDmafSEoJxg1mv6uleKtRDCuFuTdEt+FmiH6NO7anc=";
publishPhase = "mill -i unipublish.publishLocal";
nativeBuildInputs = [ git ];
};
Expand Down Expand Up @@ -54,7 +54,7 @@ let
fileset = unions [ ./../../build.mill ./../../common.mill ];
};
millDepModules = [ chisel ];
millDepsHash = "sha256-Vav1Svh06MUNO1KI0XcioxWbhGZnADXa0vOrbWDZI+U=";
millDepsHash = "sha256-saHZcLBulNESco16mqwgiPndFA/V+4uexnqgLCinuWs=";
};

editable = self.overrideAttrs (_: {
Expand Down
5 changes: 5 additions & 0 deletions templates/chisel/nix/pkgs/dependencies/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ pkgs
, stdenv
, mill
, add-determinism
, ...
}:
{ name
Expand Down Expand Up @@ -42,6 +43,10 @@ stdenv.mkDerivation {
runHook preInstall
mkdir -p $out/.ivy2
mv $TMPDIR/ivy/local $out/.ivy2/local
export SOURCE_DATE_EPOCH=1669810380
find $out -type f -name '*.jar' -exec '${add-determinism}/bin/add-determinism' -j "$NIX_BUILD_CORES" '{}' ';'
runHook postInstall
'';
}

0 comments on commit 428636f

Please sign in to comment.