Fork me on GitHub
#tools-deps
<
2021-03-03
>
borkdude13:03:32

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

borkdude13:03:58

Unless the maven stuff also depends on jsch. If not, then an all native dependency resolution/download might be near.

borkdude13:03:35

If you are curious about this, I talk about tools-deps-native here: https://youtu.be/P09GZVqiDdM?t=2240 (start from m37s20)

alexmiller14:03:34

maven does not depend on jsch

alexmiller14:03:00

moving to git shell will actually drop about 1/4 of the transitive lib weight for clj

🙌 12
dnolen17:03:40

anybody figured out workarounds for git deps and Apple M1?

borkdude17:03:31

What's the problem on m1?

borkdude17:03:21

Maybe the git shell branch is a workaround :) But maybe running under Rosetta is also one?

Spencer Apple17:03:26

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    ""
              :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)"}}

seancorfield17:03:45

@splayemu "-m clj.native-image monorepo.core" should be three separate strings: "-m" "clj.native-image" "monorepo.core"

seancorfield17:03:12

I'm a bit surprised it used to work in earlier versions, to be honest.

Spencer Apple18:03:29

Wow thanks! I swear I had tried that but it appears to be working.

alexmiller18:03:39

I'm not surprised :)

😄 3
seancorfield18:03:31

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 🙂

borkdude18:03:40

e.g. it splits echo 'foo bar' in "echo" and "foobar"

alexmiller22:03:07

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

🎉 36
alexmiller22:03:55

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)

borkdude22:03:33

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.

alexmiller23:03:09

yeah, the brew tarball went from like 19M to 15M

👍 3