Fork me on GitHub
#tools-build
<
2023-01-18
>
Jakub Holý (HolyJak)21:01:44

Hello! I am struggling getting my app build and would appreciate some advice 🙏 First I just try to compile manually and run into a weird not found err:

user=> (require 'myapp.components.server)
2023-01-18T21:16:53.128Z DEBUG [com.fulcrologic.rad.blob:197] - Wrapping persist-images with image keys #{}
nil
user=> (compile 'myapp.components.server)
Unexpected error (IOException) macroexpanding clojure.core/gen-class at (myapp/components/server.clj:1:1).
No such file or directory
What is it it cannot find? Why? I have just (ns myapp.components.server (:require ...) (:gen-class)) <some code>

2
hiredman21:01:06

compile implicit loads what is compiled, so I would start by not calling require first

Jakub Holý (HolyJak)21:01:39

Thanks! It gives the same error w/o that. I did require to demonstrate that the ns is accessible

hiredman21:01:58

the error is likely because you don't have the output directory for the compiled classfiles to go to set

facepalm 2
🙏 2
seancorfield21:01:25

Are you trying this manually because compile-clj is throwing an exception when you try to use tools.build? (trying to figure out how this relates to tools.build)

Jakub Holý (HolyJak)21:01:29

I am trying manually b/c my build call seems to get stuck and I want to find out if something weird happens when it is compiling

seancorfield21:01:23

Probably some top-level def form that is trying to do something?

hiredman21:01:27

I mean, when you require the the namespace, why is it logging stuff?

Jakub Holý (HolyJak)21:01:25

Yes, that put me off to but it is fine, obviously some def-time setup. it works now - I guess I was just too impatient and the process took too long 😅 (by it I mean the T:build invocation)

hiredman21:01:00

user=> (doc *compile-path*)
-------------------------
clojure.core/*compile-path*
  Specifies the directory where 'compile' will write out .class
  files. This directory must be in the classpath for 'compile' to
  work.

  Defaults to "classes"
nil
user=>

🙏 2
seancorfield21:01:25

AOT can be slow -- and copying all those files into target and then copying them all again into the JAR takes time 🙂

2
Jakub Holý (HolyJak)21:01:20

Thank you both very much!