-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nix] fix add-determinsim and mill-deps building on darwin #62
Conversation
* bump add-determinism to unstable-2024-11-12 and add patches for darwin * fix mill-deps building on darwin (The caches dir on darwin is `$TMPDIR/Library/Caches/Coursier`)
5af8f86
to
8f9d047
Compare
I would suggest sending a PR to upstream for the darwin fix, instead of maintaining patch in this repository. |
Waiting for keszybz/add-determinism#48 |
Thanks for your upstream efforts. I think now we can use |
I removed patch in the new commit, but I think after nixpkgs upstream merge nixpkgs#376957, we can remove |
a240ca1
to
95c6565
Compare
Please fix the CI. |
fetchpatch from https://github.com/Emin017/add-determinism/commits/fix-darwin/ Signed-off-by: Qiming Chu <[email protected]>
95c6565
to
9fc7177
Compare
It seems that the outputHash of chisel publishMillModule obtained through the publishLocal method is different each time :( |
🫠 |
Yeah and that's why we need fix determinism. I will handle this. |
This should work. I can't commit changes directly to your fork, so try git apply the following patch. diff --git a/templates/chisel/nix/pkgs/dependencies/default.nix b/templates/chisel/nix/pkgs/dependencies/default.nix
index b8c8d38..bd9afa2 100644
--- a/templates/chisel/nix/pkgs/dependencies/default.nix
+++ b/templates/chisel/nix/pkgs/dependencies/default.nix
@@ -1,6 +1,7 @@
{ pkgs
, stdenv
, mill
+, add-determinism
, ...
}:
{ name
@@ -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
'';
} |
Thanks for you help, I realize I have very little knowledge about the use of |
Signed-off-by: Qiming Chu <[email protected]>
9fc7177
to
428636f
Compare
This hash value was able to complete the build successfully on another mac, I think we might need to differentiate the hash value for the darwin platform. I'm trying to test it on another x86 linux machine. |
The hash value I get after building on my local machine is different from the hash value I get on my European servers, do we still need to use determinism for certain jar files? |
I think mill might encode some machine specific information to the buikd output. We need to unpack the JAR archive and see what is different. |
It seems like the hash mismatch is from mill deps instead of publishMillJar |
Signed-off-by: Qiming Chu <[email protected]>
0b0cb9e
to
d2261a9
Compare
I pushed a new commit and it should work, but I think there is still a need to dig deeper into why there are different hash values on different machines? (I tested on my servers, and even two x86_64 linux machines will have a hash mismatch) I'm still not very familiar with offline dependency builds for mill, but I'm happy to help if there's anything I can do here |
You can build the two hash mismatched derivation and runs |
Thank you for your advice. I will try to find the problem. |
Chisel will generate lowercase directoreise by default now, see: chipsalliance/chisel#4505. Signed-off-by: Qiming Chu <[email protected]>
9bb6b70
to
ee822fc
Compare
Seems like that you got invalid mill deps downloaded. |
It seems there may be a network issue with the GitHub runner. I can run this Check Scala format CI tests successfully on my machine, and I can also find the corresponding download files on the Maven repositories. |
Is it ready to merge now? |
I think we can go ahead and merge this PR. I'm still comparing the differences in mill output between machines, and if I'm able to resolve the issue, I can fix it in a new PR. |
Thx for your contribution! |
$TMPDIR/Library/Caches/Coursier
)