Skip to content
/ bits Public

Commit aed8a7e

Browse files
committed
Fix deps hash determinism by deleting Maven timestamp files
Maven writes ephemeral files (*.lastUpdated, resolver-status.properties, _remote.repositories) that contain timestamps, causing hash instability between builds. Delete these files to make the fixed-output derivation deterministic, matching the approach used by nixpkgs buildMavenPackage. Linux hashes set to lib.fakeHash - CI will report correct values.
1 parent af4b2a1 commit aed8a7e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

pkgs/bits-uberjar/default.nix

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828

2929
# Fixed-output derivation hash for deps, per platform.
3030
# To update: set your platform's hash to lib.fakeHash, build, copy from error.
31-
# Darwin hash is updated locally; Linux hashes from CI output.
31+
# Darwin hash updated locally; Linux hashes from CI output.
3232
depsHash =
3333
{
34-
"aarch64-darwin" = "sha256-eA8CEscn7qsgAtSwJ4ba5SfCN+yDnE+uFo+ucp7oZbo=";
35-
"aarch64-linux" = "sha256-XstFJyp7SZe+t4ctVAXI2VssF0O7LjPp6PPzW2gE1n8=";
36-
"x86_64-linux" = "sha256-azy37je1iTqryhhe/kluPpltVADTtF+BOFBNmEi73u4=";
34+
"aarch64-darwin" = "sha256-egkUQylaFsOWb1LO8FH143/1P6htR6Qvy/Xj4csO/cg=";
35+
"aarch64-linux" = lib.fakeHash;
36+
"x86_64-linux" = lib.fakeHash;
3737
}.${
3838
stdenv.hostPlatform.system
3939
};
@@ -105,6 +105,13 @@
105105
106106
if [ -d "$HOME/.m2/repository" ]; then
107107
cp -r $HOME/.m2/repository $out/m2
108+
109+
# Delete ephemeral Maven files with timestamps (makes hash deterministic)
110+
find $out/m2 -type f \( \
111+
-name \*.lastUpdated \
112+
-o -name resolver-status.properties \
113+
-o -name _remote.repositories \) \
114+
-delete
108115
fi
109116
110117
if [ -d "$HOME/.gitlibs" ]; then

0 commit comments

Comments
 (0)