so, my -main sets up logging (timbre) and nrepl. i'm trying to generate a native image. I get all sorts of complaints about Ipv4 being in the heap and so on. I know there are a lot of knobs, but I'm not sure what's the proper way to go about it. I've seen many guides and consulted babashka source code and all of it makes it seem to me that things should 'just work' in this case. I'm specially confused about many guides incentivizing :aot :all which doesn't seem to be the way for a complex project with java deps. any pointers are appreciated
avoid :aot :all but write :aot [your.main-namespace]
why do you need nrepl in a native image?
try with the least amount of deps first, find out what works and incrementally add stuff
> why nrepl just expected it to work, for debugging happiness same thing kinda goes with the core of my app though. for example com.slack.api being initialized and starting threads and etc. and then graalvm complains, rightly so. i feel like im missing a trick somewhere
just tried --features=clj_easy.graal_build_time.InitClojureClasses but still
nrepl needs eval , this won't work in a native image
you need to avoid top level values that start threads, you can wrap those in a delay
^ tried that, though i wrapped that in an immediate (force)
when I read about avoiding toplevel prior, I expected to have to avoid things outside defn's for example
> though i wrapped that in an immediate (force) that defeats the whole purpose of delaying
building without it now
got far then stumbled on some runtime issues but the approach in my case seems to be:
• clj easy
• only my namespace on aot
• my actual main being guarded with a property org.graalvm.nativeimage.imagecode != buildtime
• --strict-image-heap
the third point might be covered by delay but i didnt make sense of how to wait for the execution when actually running the app