Fork me on GitHub

Is it me or does boot-test not pick up on test-ns-hook?


hi all, i'm trying to run my boot project which requires the sparkling library by gorillalabs. my boot run task: (deftask run "Run the service in an embedded Jetty server." [] (set-env! :resource-paths #(conj % "env/dev/resources")) (set-env! :source-paths #(conj % "env/dev/clj")) (comp (filter-resources) (with-pass-thru _ (require 'classification-server.core :reload-all) ((resolve 'classification-server.core/-main))) (wait))) and i get java.lang.ClassNotFoundException: sparkling.serialization.Registrator org.apache.spark.SparkException: Failed to register classes with Kryo the documentation suggests adding :aot [#".*" sparkling.serialization sparkling.destructuring] but when i add (task-options! aot {:namespace #{'classification-server.core 'sparkling.serialization 'sparkling.destructuring}} ... i get no further


i have tried including the (aot) task in my run task to no avail


ben.mumford the problem might be related to the fact that classes generated during AOT are not added to the classpath that the kryo stuff runs in


so, question 2. how do i do that?


i think it depends on how much you want to learn about boot and classpaths today :-)


the basic idea is, set up the classpath of a pod and then run your code inside the pod instead of at "the top level"

alandipert15:10:13 is an example of a similar thing. that run task is for when i have javac in my pipeline, and i want to continuously run the main method of some compiled class


an advantage of the pod way is that you're kind of running your code "containerized" in these pods, and you can add/remove/change code and not need to restart boot


the disadvantage is you need to switch to an "application oriented" style where you move away from a REPL and toward an entrypoint function that you run


personally though, if it were me, i would punt on boot and use whatever the gorillalabs people recommend


lein i suppose? kryo and its clj wrappers do some wild stuff that has challenged my understanding of java in the past


full disclosure, the last time i did spark stuff, i gave up on clj entirely and regressed to intellij/scala


(and it worked out pretty well)


yeah i'd like to stick to boot if possible, all our other applications use boot and i can run the uberjar once built but just not my little boot run command


seems silly to have lein for one project and boot for everything else


i thought that originally too, but spark changed my outlook


one way you could simplify your job if you want to stick with boot is just focus on getting the uberjar working, not worry about the run task


then you could e.g. boot watch build in one terminal and run the uberjar continuously in another, like with the entr command + java


the major simplification there is the reasoning about pods and classpaths... to just worry about what's in the jar


yeah the jar works fine. i might experiment with the watch thing


is there a way to get boot, under cljs :optimizaions :all, to, instead of writing to main.js, write to main_timestamp.js ? I am running into cloudfront + aws caching issues; and if I got my js files named main_timestamp.js, things would work better


this line here currently writes the output out to main.js:

(cljs :ids #{"main"}
         :optimizations :advanced
         :compiler-options {:source-map-timestamp true})
question: is there a way to configure this to write it out to (format "main_%d.js" (timestamp)) ? due to caching / work flow reasons, I want each main_.js to have a different timestamp


I've got the timestamp part setup;I now need to do a "move main.js main_timestamp.js" -- how do I execute this as a boot task ?


We just call to copy files around in our Boot tasks.


(and there's to clean up after)


(deftask rename-mainjs []
  (boot.core/with-pre-wrap fileset
    (io/copy (io/file "main.js") (il/file "foo.js"))))

(comp ...
(cljs :ids #{"main"}
         :optimizations :advanced
         :compiler-options {:source-map-timestamp true})
this doesn't seem to work since the cljs-task writes stuff ot fileset right ?


Maybe boot.core/mv or use a sift w/ :move?


I ended up using

(sift :move {#"main.js" fname})


How do I use boot’s ‘OPTS’ in the repl? something like: (boot "--version")


Hi folks, how do I exit-error a script cleanly, without printing the stacktrace? The only thing I can find is which kinda says the issue is solved but I don't understand how.


@alexyakushev I don't believe you can. That's just part of Boot's "charm"... 🙂


That's quite charming 😄


It is possible 🙂


(throw (ex-info "..." {:boot.util/omit-stracktrace? true})


@juhoteperi Thanks, but it still prints the stacktrace for me:(

Boot.main                 258
                                              boot.App.main                  491
                                           boot.App.runBoot                  399
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  150
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  159
                                            boot.main/-main                          main.clj:  206
                                         boot.main/-main/fn                          main.clj:  206
                                         boot.user/eval1138  boot.user7227065426553824320.clj:   35
                                      boot.user/eval1116/fn  boot.user7227065426553824320.clj:   31
                                         clojure.core/apply                          core.clj:  646
                                      boot.user/eval1094/fn  boot.user7227065426553824320.clj:   27
                                      boot.user/eval1033/fn  boot.user7227065426553824320.clj:   23
                                 boot.user/exit-error-clean  boot.user7227065426553824320.clj:   19
                                       clojure.core/ex-info                          core.clj: 4617
clojure.lang.ExceptionInfo: Some tests have failed.
    boot.util/omit-stracktrace?: true
clojure.lang.ExceptionInfo: Some tests have failed.
    file: "/tmp/boot.user7227065426553824320.clj"
    line: 35


@alexyakushev I've never been able to get that to work either /cc @juhoteperi