reifyhealth / lein-git-down

A Leiningen plugin for resolving dependencies from Git
MIT License
82 stars 5 forks source link

Difference between windows vs macos + linux #52

Closed Folcon closed 2 years ago

Folcon commented 2 years ago

I'm not sure why, but I'm getting a difference is deps resolution between mac / linux vs windows:

I've been using github actions and debugging this, so I've got a current build log which I'll pull in the relevant segments.

linux:

Retrieving humbleui/humbleui/fc60fd319ba905dada9a6917a1a1632413c132d5/humbleui-fc60fd319ba905dada9a6917a1a1632413c132d5.jar from public-github
Created /home/runner/.gitlibs/libs/humbleui/humbleui/fc60fd319ba905dada9a6917a1a1632413c132d5/target/humbleui-0.1.0.jar
Compiling 2 source files to /home/runner/work/fruit-economy/fruit-economy/target/classes
Compiling fruit-economy.core

macos:

Retrieving humbleui/humbleui/fc60fd319ba905dada9a6917a1a1632413c132d5/humbleui-fc60fd319ba905dada9a6917a1a1632413c132d5.jar from public-github
Created /Users/runner/.gitlibs/libs/humbleui/humbleui/fc60fd319ba905dada9a6917a1a1632413c132d5/target/humbleui-0.1.0.jar
Compiling 2 source files to /Users/runner/work/fruit-economy/fruit-economy/target/classes
Compiling fruit-economy.core

windows:

Retrieving humbleui/humbleui/fc60fd319ba905dada9a6917a1a1632413c132d5/humbleui-fc60fd319ba905dada9a6917a1a1632413c132d5.jar from public-github
Created C:\Users\runneradmin\.gitlibs\libs\humbleui\humbleui\fc60fd319ba905dada9a6917a1a1632413c132d5\target\humbleui-0.1.0.jar
Could not find artifact humbleui:humbleui:jar:fc60fd319ba905dada9a6917a1a1632413c132d5 in central (https://repo1.maven.org/maven2/)
Could not find artifact humbleui:humbleui:jar:fc60fd319ba905dada9a6917a1a1632413c132d5 in clojars (https://repo.clojars.org/)
Could not transfer artifact humbleui:humbleui:jar:fc60fd319ba905dada9a6917a1a1632413c132d5 from/to public-github (git://github.com): Checksum validation failed, no checksums available
Failed to read artifact descriptor for humbleui:humbleui:jar:fc60fd319ba905dada9a6917a1a1632413c132d5
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Uberjar aborting because jar failed: Could not resolve dependencies

No idea why this is happening, hopefully there's an obvious step I've been missing?

I'm assuming the problem is at this level and not leiningen?

Some additional context, the project.clj is here.

manderson202 commented 2 years ago

Thanks for the detailed report! It looks like something with the checksum step in the plugin is behaving differently on Windows. I'll leave this open until it can be more properly investigated.

Folcon commented 2 years ago

Do you need me to do anything? I have ready access to a windows machine =)...

manderson202 commented 2 years ago

Thanks for the offer! PR's are welcome, so if you have the time/inclination, feel free to dive in 😄

Otherwise, I may reach out for validation when there is time to circle back on this, but unfortunately time has been in short supply lately so I can't guarantee when this will get some attention.

It it is indeed an issue with the checksum, this is the code that handles it.

Folcon commented 2 years ago

It turns out to be a file separator problem...

On Mac:

(str/split "~/.m2/repository/humbleui/humbleui/fc60fd319ba905dada9a6917a1a1632413c132d5/humbleui-fc60fd319ba905dada9a6917a1a1632413c132d5.jar" (re-pattern (str "\\" File/separatorChar)))
#_#_=> ["~" ".m2" "repository" "humbleui" "humbleui" "fc60fd319ba905dada9a6917a1a1632413c132d5" "humbleui-fc60fd319ba905dada9a6917a1a1632413c132d5.jar"]

On Win:

(str/split "C:\\Users\\Folcon\\.m2\\repository\\humbleui\\humbleui\\fc60fd319ba905dada9a6917a1a1632413c132d5\\humbleui-fc60fd319ba905dada9a6917a1a1632413c132d
5.jar" (re-pattern (str "\\"  File/separatorChar)))
["C:" "Users" "Folcon" ".m2" "repository" "humbleui" "humbleui" "fc60fd319ba905dada9a6917a1a1632413c132d5" "humbleui-fc60fd319ba905dada9a6917a1a1632413c132d5.jar"]

Fixed here in PR #53.

The story isn't quite over, I'm now getting:

Retrieving io/github/humbleui/jwm/b3fecb126a/jwm-b3fecb126a.pom from public-github
Retrieving io/github/humbleui/jwm/b3fecb126a/jwm-b3fecb126a.jar from public-github
Could not find artifact io.github.humbleui:jwm:jar:b3fecb126a in central (https://repo1.maven.org/maven2/)
Could not find artifact io.github.humbleui:jwm:jar:b3fecb126a in clojars (https://repo.clojars.org/)
Could not transfer artifact io.github.humbleui:jwm:jar:b3fecb126a from/to public-github (git://github.com): https://github.com/io.github.humbleui/jwm: Authentication
 is required but no CredentialsProvider has been registered
Could not transfer artifact io.github.humbleui:jwm:pom:b3fecb126a from/to public-github (git://github.com): https://github.com/io.github.humbleui/jwm: Authentication
 is required but no CredentialsProvider has been registered

Once again not something I see at all on macos + linux.

Where's this code? I can take a quick look...

Folcon commented 2 years ago

Thanks @manderson202, for merging that issue, I'm still uncertain about this bit?

The story isn't quite over, I'm now getting:

Retrieving io/github/humbleui/jwm/b3fecb126a/jwm-b3fecb126a.pom from public-github
Retrieving io/github/humbleui/jwm/b3fecb126a/jwm-b3fecb126a.jar from public-github
Could not find artifact io.github.humbleui:jwm:jar:b3fecb126a in central (https://repo1.maven.org/maven2/)
Could not find artifact io.github.humbleui:jwm:jar:b3fecb126a in clojars (https://repo.clojars.org/)
Could not transfer artifact io.github.humbleui:jwm:jar:b3fecb126a from/to public-github (git://github.com): https://github.com/io.github.humbleui/jwm: Authentication
 is required but no CredentialsProvider has been registered
Could not transfer artifact io.github.humbleui:jwm:pom:b3fecb126a from/to public-github (git://github.com): https://github.com/io.github.humbleui/jwm: Authentication
 is required but no CredentialsProvider has been registered

Once again not something I see at all on macos + linux.

Where's this code? I can take a quick look...

manderson202 commented 2 years ago

Thanks for the PR! As for the above... Looks like the project it's trying to pull down, HumbleUI/JWM, doesn't have a recognized build file (eg: pom.xml, project.clj, or deps.edn), so it's probably falling into the default jar resolve multimethod impl. I'm not sure why you're not getting errors on that one on other OS's, but not sure lein-git-down can build this library.

Folcon commented 2 years ago

@manderson202, you're right. For some reason the powershell version of maven can't seem to build it and so I had to resort to wsl, however I forgot that wsl has it's own .m2 repository which it stores in ~/.m2/repository/ and not window's one at /mnt/c/Users/<Username>/.m2/repository/.

So I had to install it to that local repo: <maven unzip location>/bin/mvn install:install-file -Dfile=jwm-b3fecb126a.jar -DpomFile=maven/META-INF/maven/io.github.humbleui/jwm/pom.xml -DlocalRepositoryPath=/mnt/c/Users/<Username>/.m2/repository/.

Sigh...

Anyway, could you please cut a release on clojars or somewhere so I can use the latest version in my github actions?

manderson202 commented 2 years ago

Just pushed the release. Thanks again for the detailed issue report and the fix!

Folcon commented 2 years ago

Just an quick update @manderson202 to say thank you =)...

Managed to get this working thanks to your help!