Skip to content
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

Inconsistent nar serialization of git libs between aarch64-linux and aarch64-darwin #41

Open
slimslenderslacks opened this issue Apr 26, 2023 · 6 comments

Comments

@slimslenderslacks
Copy link
Contributor

I'm not sure if this is the only place where we see this behavior but if I run the update-deps menu command on aarch64-darwin, the entry in pkgs/builder-lock.json for https://github.com/clojure/tools.build.git will be updated. If I run the same update-deps command on aarch64-linux (in a docker container), the pkgs/builder-lock.json file will not be updated.

I think this points to an issue with the cljnix.nix namespace when running in darwin.

@jlesquembre
Copy link
Owner

Thanks for reporting, I think that's related to the test errors you see on #39 . Could you post the diff and your darwin version?
I have to investigate it , but I suspect maven is picking different versions based on the system. It's a bit hard to test for me, since I don't have a mac.

@slimslenderslacks
Copy link
Contributor Author

I still haven't figured this one out. I'm actually only seeing issues for gitlibs today though. But if I run update-deps on aarch64-linux, I get the entry below which is what is currently checked in.

{
    "url": "https://github.com/clojure/tools.build.git",
    "rev": "ba1a2bf421838802e7bdefc541b41f57582e53b6",
    "paths": [
      "src/main/clojure",
      "src/main/resources"
    ],
    "hash": "sha256-p8kdg9UmpUq+JeyxL+g5R0GwdcP7cOI6wZuJnXK9Y8I="
  }

However, if I run this on aarch64-darwin, I get the following diff.

index 0ec85ec..4647601 100644
--- a/pkgs/builder-lock.json
+++ b/pkgs/builder-lock.json
@@ -1,12 +1,12 @@
 [
   {
-    "url": "https://github.com/clojure/tools.build.git",
+    "url": "https://github.com/clojure/tools.build",
     "rev": "ba1a2bf421838802e7bdefc541b41f57582e53b6",
     "paths": [
       "src/main/clojure",
       "src/main/resources"
     ],
-    "hash": "sha256-p8kdg9UmpUq+JeyxL+g5R0GwdcP7cOI6wZuJnXK9Y8I="
+    "hash": "sha256-Dif4WtK/9JDfCJq45Do0pWSBVILN5qNnNKfvFNXVgrI="
   },
   {
     "url": "https://repo.clojars.org/babashka/fs/0.1.6/fs-0.1.6.jar",

So obviously the urls are slightly different which is weird, but I wouldn't have thought that would impact the hash anyway. And it's definitely darwin only so far.

@jlesquembre
Copy link
Owner

I cannot reproduce it, maybe has something to do with the git version?
The url value should not impact the hash, but at the same time, the url value comes from running git remote get-url origin. If the value is different, maybe something else is going on and the files are not identical?

@slimslenderslacks
Copy link
Contributor Author

slimslenderslacks commented Jun 5, 2023

I just re-ran this against main today and the url is still different (no .git extension) but this time the hashes are NOT different. I can checkout a commit of clj-nix from Feb. 25th and the problem comes back (the hashes are different). Same version of git in both cases.
Maybe this was a problem with build tools?

@slimslenderslacks
Copy link
Contributor Author

The git client on macos still doesn't include a .git extension on the url, but now that the nix-hash is coming out the same on macos, I might be able to close this issue. I'll check a few more projects.

@jlesquembre
Copy link
Owner

I'll try to test it on a mac. If the only difference is the .git extension, I can add a check for it, and add the extension before we write the lock file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants