Just fyi, I think moving to shell git instead of jsch will probably alleviate this issue as well: https://github.com/oracle/graal/issues/3251
Unless the maven stuff also depends on jsch. If not, then an all native dependency resolution/download might be near.
If you are curious about this, I talk about tools-deps-native here: https://youtu.be/P09GZVqiDdM?t=2240 (start from m37s20)
maven does not depend on jsch
moving to git shell will actually drop about 1/4 of the transitive lib weight for clj
fyi, updated to git shell branch of gitlibs project: https://github.com/borkdude/tools-deps-native-experiment/tree/shell#shell-branch
anybody figured out workarounds for git deps and Apple M1?
What's the problem on m1?
Maybe the git shell branch is a workaround :) But maybe running under Rosetta is also one?
Upgrading from 1.10.2.774
to 1.10.2.790
broke this for us:
GRAALVM_HOME=/path/graalvm-ce-19.2.0.1/Contents/Home clojure -A:native-image
our deps.edn
:aliases {:native-image
{:main-opts ["-m clj.native-image monorepo.core"
"--initialize-at-build-time"
"--no-fallback"
"--report-unsupported-elements-at-runtime"
"-H:+PrintClassInitialization"]
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]
:extra-deps
{clj.native-image/clj.native-image
{:git/url "<https://github.com/taylorwood/clj.native-image.git>"
:sha "f3e40672d5c543b80a2019c1f07b2d3fe785962c"
:exclusions [org.slf4j/slf4j-nop]}}}}
error:
{:clojure.main/message
"Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).\n-m clj.native-image monorepo.core (No such file or directory)\n",
:clojure.main/triage
{:clojure.error/class java.io.FileNotFoundException,
:clojure.error/line -2,
:clojure.error/cause
"-m clj.native-image monorepo.core (No such file or directory)",
:clojure.error/symbol java.io.FileInputStream/open0,
:clojure.error/source "FileInputStream.java",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.io.FileNotFoundException,
:message
"-m clj.native-image monorepo.core (No such file or directory)",
:at [java.io.FileInputStream open0 "FileInputStream.java" -2]}],
:trace
[[java.io.FileInputStream open0 "FileInputStream.java" -2]
[java.io.FileInputStream open "FileInputStream.java" 219]
[java.io.FileInputStream <init> "FileInputStream.java" 157]
[java.io.FileInputStream <init> "FileInputStream.java" 112]
[clojure.lang.Compiler loadFile "Compiler.java" 7571]
[clojure.main$load_script invokeStatic "main.clj" 475]
[clojure.main$script_opt invokeStatic "main.clj" 535]
[clojure.main$script_opt invoke "main.clj" 530]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause
"-m clj.native-image monorepo.core (No such file or directory)"}}
@splayemu "-m clj.native-image monorepo.core"
should be three separate strings: "-m" "clj.native-image" "monorepo.core"
I'm a bit surprised it used to work in earlier versions, to be honest.
Wow thanks! I swear I had tried that but it appears to be working.
I'm not surprised :)
I had never tried :main-opts
strings with multiple command-line arguments in because it just never occurred to me that it would work -- all the examples show a separate string for each argument, I believe -- but I'm not surprised it no longer works 🙂
I made a parser for command line strings, in case anyone needs it ;) https://github.com/babashka/pod-babashka-aws/blob/e119d08f738ed4fc6bb533a99288ccbd7794c18f/src/pod/babashka/aws/impl/aws/credentials.clj#L70
e.g. it splits echo 'foo bar'
in "echo"
and "foobar"
I have done a prerelease of the Clojure CLI (1.10.2.801) that switches git/ssh to shell out rather than using jgit/jsch. this potentially fixes many existing git/ssh issues in that it is just shelling out to git, so if it works there, it should work through clj. I would love to see any and all tire-kicking on this:
• public https repos
• https repos with user/pw auth (not previously supported, subject to whatever credentials you have set up through git)
• private ssh git repos
• newer key exchange methods like ecdsa-sha2-nistp256
• .ssh/config options that didn't work before
• ed25519 identity keys
• concurrency issues in parallel downloads (I think this is improved but I never had a working repro for it)
• doesn't work on M1 macs
• Windows
• CI systems like Travis/Circle/etc
when you're testing, don't forget that a) git dirs and working trees are cached in ~/.gitlibs - consider selectively clearing/moving that while testing), and b) classpaths are cached in .cpcache dirs - use clj -Sforce
to force that to override
there are still a couple more things I need to do here. currently, tools.gitlibs defaults to non-interactive behavior so it will not prompt you if, for example, http://github.com hosts are not in known_hosts, it will just fail. there is a flag in the API to support that, but I have not pulled that through the whole stack yet - it can be selectively interactive (and should be if you're just sitting at the terminal I think)
Exciting! Bumped at https://github.com/borkdude/tools-deps-native-experiment. Native compilation only takes 1m40s on CI which is really good: an indication that this project is now much more light weight.
yeah, the brew tarball went from like 19M to 15M