This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-11
Channels
- # asami (19)
- # babashka (41)
- # beginners (115)
- # biff (7)
- # calva (78)
- # clj-kondo (29)
- # cljs-dev (9)
- # clojure (39)
- # clojure-europe (17)
- # clojure-gamedev (29)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (2)
- # clojure-uk (3)
- # clojurescript (7)
- # core-async (26)
- # cursive (16)
- # datomic (13)
- # emacs (1)
- # events (5)
- # fulcro (2)
- # funcool (4)
- # gratitude (1)
- # helix (1)
- # holy-lambda (1)
- # humbleui (1)
- # introduce-yourself (4)
- # java (1)
- # jobs (2)
- # jobs-discuss (9)
- # lsp (28)
- # matcher-combinators (2)
- # mathematics (1)
- # membrane (1)
- # nbb (12)
- # off-topic (10)
- # pathom (52)
- # polylith (38)
- # portal (32)
- # re-frame (4)
- # reagent (16)
- # reitit (2)
- # remote-jobs (1)
- # reveal (1)
- # rewrite-clj (10)
- # sci (67)
- # shadow-cljs (45)
- # squint (1)
- # tools-build (13)
- # tools-deps (16)
I have a question. Why compile
fails when the copy
part is skipped?
(b/copy-dir {:src-dirs ["src/clj" "src/cljc" "env/prod/clj"]
:target-dir class-dir})
(b/compile-clj {:basis basis
:src-dirs ["src/clj" "src/cljc" "env/prod/clj"]
:class-dir class-dir})
is there kit/net/env.clj in the class-dir ?
I guess that shouldn't matter given the :src-dirs in compile-clj
re "Clojure compilation failed, working dir preserved: /tmp/compile-clj2911297849938394779" - that directory is a temp dir that contains the results of the failed compile
you can inspect the compile.args and compile.clj files in that directory
it's basically running (in that directory) java
with the args in compile.args, which should execute the compile.clj file (which shows what's being compiled)
compile.args reveals the problem:
"env/prod/clj" has to go into deps.edn
top level :paths not the build alias level :paths
Great. This is it. Tyvm! deps.edn
:aliases {:prod {:extra-paths ["env/prod/clj"]}}
build.clj
(def basis (b/create-basis {:project "deps.edn", :aliases [:prod]}))
{:clojure.main/message
"Execution error (ExceptionInfo) at clojure.tools.build.tasks.compile-clj/compile-clj (compile_clj.clj:112).\nClojure compilation failed, working dir preserved: /tmp/compile-clj2911297849938394779\n",
:clojure.main/triage
{:clojure.error/class clojure.lang.ExceptionInfo,
:clojure.error/line 112,
:clojure.error/cause
"Clojure compilation failed, working dir preserved: /tmp/compile-clj2911297849938394779",
:clojure.error/symbol
clojure.tools.build.tasks.compile-clj/compile-clj,
:clojure.error/source "compile_clj.clj",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type clojure.lang.ExceptionInfo,
:message
"Clojure compilation failed, working dir preserved: /tmp/compile-clj2911297849938394779",
:data {},
:at
[clojure.tools.build.tasks.compile_clj$compile_clj
invokeStatic
"compile_clj.clj"
112]}],
:trace
[[clojure.tools.build.tasks.compile_clj$compile_clj
invokeStatic
"compile_clj.clj"
112]
[clojure.tools.build.tasks.compile_clj$compile_clj
invoke
"compile_clj.clj"
80]
[clojure.lang.Var invoke "Var.java" 384]
[clojure.tools.build.api$compile_clj invokeStatic "api.clj" 312]
[clojure.tools.build.api$compile_clj invoke "api.clj" 272]
[build$main invokeStatic "build.clj" 73]
[build$main invoke "build.clj" 68]
[clojure.lang.AFn applyToHelper "AFn.java" 154]
[clojure.lang.AFn applyTo "AFn.java" 144]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.core$apply invoke "core.clj" 662]
[clojure.run.exec$exec invokeStatic "exec.clj" 48]
[clojure.run.exec$exec doInvoke "exec.clj" 39]
[clojure.lang.RestFn invoke "RestFn.java" 423]
[clojure.run.exec$_main$fn__205 invoke "exec.clj" 180]
[clojure.run.exec$_main invokeStatic "exec.clj" 176]
[clojure.run.exec$_main doInvoke "exec.clj" 139]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[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
"Clojure compilation failed, working dir preserved: /tmp/compile-clj2911297849938394779",
:data {}}}
Cleaning target
Preparing main jar...
Execution error (FileNotFoundException) at kit.net.web.middleware.core/loading (core.clj:1).
Could not locate kit/net/env__init.class, kit/net/env.clj or kit/net/env.cljc on classpath.