This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-21
Channels
- # announcements (3)
- # architecture (5)
- # babashka (19)
- # beginners (145)
- # calva (1)
- # chlorine-clover (18)
- # cider (10)
- # clj-kondo (5)
- # cljsrn (3)
- # clojure (56)
- # clojure-berlin (19)
- # clojure-czech (2)
- # clojure-europe (32)
- # clojure-finland (2)
- # clojure-nl (3)
- # clojure-portugal (2)
- # clojure-spec (8)
- # clojure-uk (48)
- # clojurescript (48)
- # conjure (50)
- # cryogen (1)
- # cursive (28)
- # datomic (54)
- # depstar (12)
- # emacs (1)
- # events (8)
- # figwheel-main (6)
- # fulcro (4)
- # helix (4)
- # java (2)
- # jobs (2)
- # leiningen (1)
- # off-topic (29)
- # parinfer (4)
- # pathom (6)
- # portkey (3)
- # reagent (1)
- # remote-jobs (3)
- # reveal (16)
- # shadow-cljs (42)
- # sql (20)
- # tools-deps (11)
- # vim (4)
- # vrac (2)
I'm trying to compile an uberjar for deployment as a Google could function. Can I AOT using depstar without specifying a Main-Class? The cloud function framework just wants to reflect on the jar and find a particular class implementation. I tried with "-m", but it complains that it can't find clojure core__init.class.
@dave.dixon The -m
option specifies the namespace that compile
is run against so, no, you can't use -C
without -m
.
And -m
also determines the Main-Class:
in the generated MANIFEST.
Maybe I need to add something to the class constructor to load clojure? Feels like I've had this issue before.
If you don't want to specify a Main-Class:
, you can still create an uberjar with AOT'd code but you have to do it more manually...
1. create classes
folder
2. manually compile
the namespace(s) you need for actual classes
3. build an uberjar (without -C
and without -m
) via an alias that adds :extra-paths ["classes"]
so the compiled code is on the classpath and therefore will get added to the JAR
Step 2 can be just clojure -e '(compile 'your.entry.ns)'
if that's where your :gen-class
is
As for initialization of Clojure for Google Cloud, no idea about that. Never tried to use any Google services.
There's a #google-cloud channel that can probably answer that.
Feel free to @ me into that channel if you get advice that doesn't easily translate to depstar
and I'll try to help out...
Thanks, I got it to build via this route, though it still has to issue not finding core__init.class. I have a recollection that when compiling a library of classes to be reflected, there's something you need to do to get clojure initialized, stuff that otherwise would happen through clojure.main
.
I think it was something like this: https://groups.google.com/g/clojure/c/Aa04E9aJRog