depstar

Discussion around https://github.com/seancorfield/depstar
adamtait 2021-06-10T22:48:23.013Z

Hi friends! I’m new to depstar and having a bit of trouble building a library jar file. I get a FileNotFoundException and neither the message or trace are helping to narrow down the possibilities. Repo: https://github.com/6pages/datomic-utils

> clojure -X:jar :jar MyLib.jar
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-X:jar (No such file or directory)
Full exception:
{:clojure.main/message
 "Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).\n-X:jar (No such file or directory)\n",
 :clojure.main/triage
 {:clojure.error/class java.io.FileNotFoundException,
  :clojure.error/line -2,
  :clojure.error/cause "-X:jar (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 "-X:jar (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" 213]
   [java.io.FileInputStream <init> "FileInputStream.java" 155]
   [java.io.FileInputStream <init> "FileInputStream.java" 110]
   [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 "-X:jar (No such file or directory)"}}
Any ideas or pointers would be much appreciated :)

seancorfield 2021-06-10T23:04:14.013700Z

@adamtait Your clojure CLI is too old. Run clojure -Sdescribe to see what version you have installed.

seancorfield 2021-06-10T23:05:07.014300Z

Per the depstar README: > Note: these instructions assume you have at least version 1.10.1.727 of the Clojure CLI installed. See Clojure Tools Releases for details about the functionality in recent CLI releases. https://clojure.org/releases/tools is the link for Clojure Tools Releases

seancorfield 2021-06-10T23:05:55.015Z

The current stable version is 1.10.3.855. Support for -X was added back in October last year.

seancorfield 2021-06-10T23:07:43.016200Z

The symptom is -X:jar (No such file or directory) — which says the clojure script tried to run the first argument (as a Clojure script) because it didn’t recognize it as an option. The stacktrace shows this error is not coming from depstar.

adamtait 2021-06-10T23:09:14.017100Z

Thanks much! Upgrading clojure CLI did the trick. Somehow I read that but didn’t think I might have an old version.

seancorfield 2021-06-10T23:10:22.017900Z

(I’m currently testing 1.10.3.875 which is a prerelease with the new multi-exec function support that Alex talked about at clojureD last week 🙂 )

👍 1
1