This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-16
Channels
- # aleph (2)
- # beginners (68)
- # boot (25)
- # bristol-clojurians (5)
- # cider (10)
- # cljs-dev (60)
- # cljsrn (1)
- # clojure (138)
- # clojure-austin (1)
- # clojure-france (2)
- # clojure-greece (11)
- # clojure-italy (4)
- # clojure-russia (16)
- # clojure-spec (4)
- # clojure-uk (75)
- # clojurescript (26)
- # core-async (28)
- # cursive (25)
- # data-science (4)
- # datomic (16)
- # defnpodcast (2)
- # devops (2)
- # docs (10)
- # duct (11)
- # emacs (1)
- # events (1)
- # figwheel (8)
- # fulcro (61)
- # garden (2)
- # hoplon (6)
- # java (6)
- # jobs-discuss (1)
- # lein-figwheel (14)
- # leiningen (86)
- # luminus (11)
- # off-topic (8)
- # parinfer (9)
- # pedestal (2)
- # re-frame (19)
- # reagent (1)
- # ring (3)
- # ring-swagger (8)
- # shadow-cljs (278)
- # spacemacs (13)
- # sql (5)
- # testing (7)
- # unrepl (8)
- # yada (25)
I’m getting an exception while building an uberjar: https://gist.github.com/borkdude/cd8ded50d80012fe8ed6ed70b692626a java.lang.IllegalArgumentException: Prefix string too short
@borkdude Run boot
with the -b
option to see what's on that line -- looking at the exception and the code, it suggests that it's trying to create a temporary file with a prefix filename that is less than three characters... But looking at the Boot source, I can't figure out how that could happen...
thanks. I went another route meanwhile, not including this hairball of dependencies in our app
Hey fellow bootineers. I’m trying to write a task to function similar to lein run
. The docs suggest something like
(require 'my.ns)
(deftask run
"Runs a command-line action"
[]
(with-pass-thru _
(apply my.ns/-main *args*)))
Unfortunately, I can’t require my.ns
at that point because the classpath doesn’t have all of the required resources, which are conditionally and necessarily established by other tasks in the pipeline. Naively, I would expect to put the require call just before the apply call, but that gives me a ClassNotFoundException.@donaldball this is how you do it in boot tasks: https://github.com/boot-clj/boot/wiki/Run-time-requires-(within-task-definitions)
Thanks, it was exactly that simple and obvious.
My followup may not be quite as much. My main invocation takes a couple of positional params that I do not wish to convert into switched args. The boot docs suggest the command-line form boot [ run foo bar ]
will populate the *args*
var, but I get an exception:
clojure.lang.ExceptionInfo: [
data: {:file
"/var/folders/q8/q9m6fhqx7jz9r9wz72dsvsxh0000gn/T/boot.user683874268861742912.clj",
:line 35}
java.lang.ClassNotFoundException: [
...
clojure.core/ns-resolve/invokeStatic core.clj: 4336
clojure.core/ns-resolve/invokeStatic core.clj: 4325
clojure.core/resolve/invokeStatic core.clj: 4338
clojure.core/resolve core.clj: 4338
boot.core/construct-tasks core.clj: 903
run
is the name of the task; foo bar
are the positional params I’m trying to convey
I’m referring to this doc: https://github.com/boot-clj/boot/wiki/Task-Options-DSL#positional-parameters
boot [ run -- foo bar ]
is what I read that doc page to be suggesting @donaldball
Ah, that's only to pass option-like things in... my bad...
OK, now you've made me curious to test this! 🙂
OK, a simple example works as the docs say:
(deftask donald []
(prn *args*))
$ boot [ donald foo bar ]
["foo" "bar"]
$
so the ClassNotFoundException
is coming from something else in your build.boot
Heh, wow thanks for doing my legwork for me 😛
Though… that’s not the behavior I’m seeing!
(deftask stroll
[]
(prn *args*))
~/src/fme/service[add-membrane]$ boot [ stroll foo bar ]
clojure.lang.ExceptionInfo: [
data: {:file
"/var/folders/q8/q9m6fhqx7jz9r9wz72dsvsxh0000gn/T/boot.user7707068072930942461.clj",
:line 37}
java.lang.ClassNotFoundException: [
...
However, updating to 2.7.2 seems to fix it so perhaps it was simply a regression in 2.6.0. Apologies for the noise!
Maybe it wasn't supported in 2.6.0?
sorry for being late, but I think the above feature is indeed a new-ish addition
FWIW, I can repro that exception with Boot 2.6.0 🙂
Works on 2.7.0 so I'm guessing it was one of the many new features in 2.7...
Yup, listed as new-in-2.7.0 https://github.com/boot-clj/boot/blob/master/CHANGES.md#boot-cli-parsing