This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-03
Channels
- # announcements (15)
- # babashka (143)
- # babashka-sci-dev (2)
- # beginners (35)
- # biff (11)
- # calva (5)
- # cider (8)
- # clerk (4)
- # clj-kondo (58)
- # cljdoc (6)
- # clojure (88)
- # clojure-denmark (1)
- # clojure-europe (77)
- # clojure-nl (1)
- # clojure-norway (16)
- # clojure-uk (1)
- # clojurescript (19)
- # clr (32)
- # code-reviews (158)
- # datahike (5)
- # datomic (10)
- # deps-new (3)
- # fulcro (12)
- # graalvm (20)
- # honeysql (23)
- # hyperfiddle (32)
- # kaocha (17)
- # membrane (6)
- # observability (1)
- # other-languages (2)
- # pathom (5)
- # practicalli (12)
- # reagent (4)
- # reitit (7)
- # releases (1)
- # sci (25)
- # shadow-cljs (52)
i'm working on a project I want to compile to an uberjar, so I have (:gen-class)
in the main namespace. If I don't pre-compile this (using tools.build for example) Kaocha can't run
$ clojure -M:test
Randomized with --seed 232372349
ERROR in all (noahtheduke/splint.clj:5)
Failed loading tests:
Exception: clojure.lang.Compiler$CompilerException: Syntax error compiling at (noahtheduke/splint.clj:5:1).
#:clojure.error{:phase :compile-syntax-check, :line 5, :column 1, :source "noahtheduke/splint.clj"}
at clojure.lang.Compiler.analyze (Compiler.java:6825)
if I use the gen-class-hook
as described https://github.com/plexus/gen-class-hook, then I get a different error related to the function compile
being unable to find the relevant class:
$ clojure -M:test
Syntax error (ClassNotFoundException) compiling at (noahtheduke/splint.clj:5:1).
noahtheduke.splint
Full report at:
/var/folders/5w/z50rbwg546x94k8p8jzqfbl00000gn/T/clojure-1175603925556261433.edn
noah@Noahs-MacBook-Pro ~/personal/splint [main ≡ +1 ~89 -1 | +1 ~4 -0 !]
$ cat /var/folders/5w/z50rbwg546x94k8p8jzqfbl00000gn/T/clojure-1175603925556261433.edn
{:clojure.main/message
"Syntax error (ClassNotFoundException) compiling at (noahtheduke/splint.clj:5:1).\nnoahtheduke.splint\n",
:clojure.main/triage
{:clojure.error/phase :compile-syntax-check,
:clojure.error/line 5,
:clojure.error/column 1,
:clojure.error/source "splint.clj",
:clojure.error/path "noahtheduke/splint.clj",
:clojure.error/class java.lang.ClassNotFoundException,
:clojure.error/cause "noahtheduke.splint"},
...
compiling from the repl works too:
$ clj
Clojure 1.11.1
user=> (compile 'noahtheduke.splint)
noahtheduke.splint
so I'm unsure what kaocha is doing that causes this to happen, but it's cumbersome that I have to pre-compile before I can run kaocha directly
any thoughts or ideas?
here's my repo: https://github.com/NoahTheDuke/splint
Strange, I am able to clone the repo and run tests with clojure -A:test:kaocha
without manually running (compile ,,,)
If you're still encountering the issue, can you provide the full stacktrace file?
ah crap, i'm sorry I missed that you responded
i don't know what changed but you're correct that it's working now
thanks for trying it out
You're welcome!
okay, here we go. i wrote rm -rf classes/ ; mkdir classes
and then ran clojure -M:dev:test :kaocha
and it crashed
okay, so i just tried this again and it only crashes on osx lol
idk about windows, but on my ubuntu computer, it works just fine