This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-26
Channels
- # announcements (19)
- # babashka (27)
- # beginners (24)
- # calva (14)
- # clerk (5)
- # clj-commons (21)
- # clojure (51)
- # clojure-europe (14)
- # clojure-madison (1)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-uk (4)
- # clojuredesign-podcast (32)
- # core-async (14)
- # datomic (7)
- # events (1)
- # honeysql (3)
- # hyperfiddle (14)
- # introduce-yourself (2)
- # kaocha (7)
- # malli (21)
- # off-topic (50)
- # portal (2)
- # reagent (41)
- # reitit (41)
- # releases (1)
- # scittle (6)
- # shadow-cljs (90)
- # tools-deps (10)
- # xtdb (1)
- # yamlscript (1)
I created a ~/.clojure/deps.edn
file and ran a clj
command that relies on that file. Did not work. Next, I ran the same clj
command, and I gave it the contents of the deps.edn
file on the command line. That worked. What is going on?
the details:
$ clj -version
Clojure CLI version 1.11.1.1435
$ cat ~/.clojure/deps.edn
{:aliases
{:new {:extra-deps {seancorfield/clj-new
{:mvn/version "1.1.243"}}
:exec-fn clj-new/create
:exec-args {}}}}
$ clj -X:new :template figwheel-main :name learn-cljs/weather :args '["+deps" "--reagent"]'
No function found on command line or in :exec-fn
;; second try
$ clj -Sdeps '{:aliases
{:new {:extra-deps {seancorfield/clj-new
{:mvn/version "1.1.243"}}
:exec-fn clj-new/create
:exec-args {}}}}' -X:new :template figwheel-main :name learn-cljs/weather :args '["+deps" "--reagent"]'
;; => works :) but leaves me puzzledtry clj -Sverbose
❯ clj -Sverbose
version = 1.11.1.1413
install_dir = /opt/homebrew/Cellar/clojure/1.11.1.1413
config_dir = /Users/dan/.clojure
config_paths = /opt/homebrew/Cellar/clojure/1.11.1.1413/deps.edn /Users/dan/.clojure/deps.edn deps.edn
cache_dir = .cpcache
cp_file = .cpcache/2964136728.cp
Clojure 1.11.1
user=>
prints out some useful stuff about where it is looking for its config. Yours might be different?or -Sdescribe
might be more useful
❯ clj -Sdescribe
{:version "1.11.1.1413"
:config-files ["/opt/homebrew/Cellar/clojure/1.11.1.1413/deps.edn" "/Users/dan/.clojure/deps.edn" "deps.edn" ]
:config-user "/Users/dan/.clojure/deps.edn"
:config-project "deps.edn"
:install-dir "/opt/homebrew/Cellar/clojure/1.11.1.1413"
:config-dir "/Users/dan/.clojure"
:cache-dir ".cpcache"
:force false
:repro false
:main-aliases ""
:repl-aliases ""}
Also, that's an old version of clj-new
using the old group ID. See https://github.com/seancorfield/clj-new?tab=readme-ov-file#installation-via-depsedn for updated alias usage.
(and you could simply install clj-new
as a "tool" so you wouldn't need it in your user deps.edn
-- see https://github.com/seancorfield/clj-new?tab=readme-ov-file#installation-as-a-tool )
I have some external jars (locally installed with mvn, e.g. at /Users/m/.m2/repository/org/graalvm/python/python-language/23.1.0/python-language-23.1.0.jar
) because these are <type>pom</type>
mvn deps. When I run clojure locally, these are found on the classpath (corresponding deps.edn entry org.graalvm.polyglot/python {:local/root "/Users/m/.m2/repository/org/graalvm/python/python-language/23.1.0/python-language-23.1.0.jar"})
, but when I build an uberjar with tools.build, these don't get included in the final jar even if their contents is in the class-dir.
What's the way to get these local jar deps included in the uberjar? Sorry if it's been answered before. If it's not supported, should I put these on the classpath when starting the uberjar, as a workaround?
If they are on the classpath of the basis you use to build the uber jar, I think they should get added. Perhaps you can share more details of how you are building your JAR and what your deps.edn
file contains?
(although having :local/root
pointing into your Maven repo cache is... strange...)
It seems like you could specify org.graalvm.python/python-language {:mvn/version "23.1.0"}
and that would work?
Thanks.. I think i thought i needed a local mvn cache because <type>pom</type> are not supported, but i already copied the other deps of org.graalvm.python/python-language to deps.edn, so this should work. Having the following deps seems to put things in the uberjar:
org.graalvm.truffle/truffle-api {:mvn/version "23.1.0"}
; python
org.graalvm.python/python-language {:mvn/version "23.1.0"}
org.graalvm.tools/profiler-tool {:mvn/version "23.1.0"}
org.graalvm.regex/regex {:mvn/version "23.1.0"}
org.graalvm.polyglot/polyglot {:mvn/version "23.1.0"}
org.graalvm.truffle/truffle-nfi {:mvn/version "23.1.0"}
org.graalvm.truffle/truffle-nfi-libffi {:mvn/version "23.1.0"}
org.graalvm.llvm/llvm-api {:mvn/version "23.1.0"}
org.graalvm.shadowed/icu4j {:mvn/version "23.1.0"}
org.bouncycastle/bcprov-jdk18on {:mvn/version "1.76"}
org.bouncycastle/bcpkix-jdk18on {:mvn/version "1.76"}
org.bouncycastle/bcutil-jdk18on {:mvn/version "1.76"}
org.tukaani/xz {:mvn/version "1.9"}
; js
org.graalvm.js/js-language {:mvn/version "23.1.0"}
But it's still giving me
Exception in thread "main" java.lang.IllegalStateException: No language and polyglot implementation was found on the class-path. Make sure at last one language is added on the class-path. If you put a language on the class-path and you encounter this error then there could be a problem with isolated class loading. Use -Dpolyglotimpl.TraceClassPathIsolation=true to debug class loader islation problems. For best performance it is recommended to use polyglot from the module-path instead of the class-path.
at org.graalvm.polyglot.Engine$PolyglotInvalid.noPolyglotImplementationFound(Engine.java:2071)
So the issue is probably somewhere else. Perhaps sth about a https://github.com/oracle/graaljs/issues/182? Which is beyond me atm.
Thanks Sean, sorry for the silly question 🙂Since you're now at a Graal issue, maybe ask in #CAJN79WNT and see if anyone recognizes this problem?