This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-26
Channels
- # admin-announcements (1)
- # alda (44)
- # aws-lambda (6)
- # beginners (8)
- # boot (187)
- # capetown (5)
- # cider (25)
- # cljs-dev (24)
- # cljsrn (93)
- # clojure (45)
- # clojure-austin (9)
- # clojure-canada (2)
- # clojure-greece (1)
- # clojure-mexico (3)
- # clojure-poland (3)
- # clojure-russia (1)
- # clojure-spec (12)
- # clojure-uk (13)
- # clojurescript (86)
- # cursive (9)
- # datascript (3)
- # datomic (32)
- # defnpodcast (4)
- # devcards (23)
- # editors (3)
- # emacs (5)
- # hoplon (27)
- # immutant (3)
- # lein-figwheel (9)
- # leiningen (4)
- # luminus (10)
- # om (32)
- # onyx (2)
- # other-languages (1)
- # perun (1)
- # protorepl (8)
- # re-frame (13)
- # reagent (2)
- # remote-jobs (2)
- # ring (3)
- # spacemacs (4)
- # spirituality-ethics (3)
- # test-check (16)
- # untangled (65)
- # yada (50)
Is there something special you need to do in order to get boot cljs to work with the latest cljs? I am trying to mess around with spec in cljs, however, it seems like boot thinks I am using an old version of cljs or something as I get this error:
ERROR: Wrong number of args (1) passed to: spec/coll-of
Calling spec like this:
(ns myns.core
(:require [cljs.spec :as s]))
(s/def ::test (s/coll-of int?))
Correct me if I am wrong but I believe the Clojurescript port of spec is up to date with Clojure so this call to spec should work (and it does in Clojure).Just wanted to shout out a huge thank you, boot for not having any stale files. Prevented be from accidentally copying an old version to a test server twice in the past few days. Otherwise, would have made me hunt for errors and kick myself very hard on finding it. π
@kenny: What version of CLJS? 93 is definitely not up to date with Clojure
so, having recently switched to Boot, I have the strong feeling that boot is a bit slower than lein, is that correct ?
@lmergen: what use-case? Have you made sure all other parameters like JVM options are configured the same?
@lmergen: generally performance is comparable. Boot's filesets are an abstraction Lein doesn't have so there might be a minimal overhead there (although there have been some optimizations by now)
can anyone point me to some project that properly generates an uberjar ready for deployment ?
however, all the example projects i can find are either a library or a clojurescript project which uses boot serve
right, so apparently there was a compilation error in my main
function, and since it wasn't AOT'ed.... there was an exception as soon as i loaded the JAR, which causes the jvm to report an 'incompatible signature'
right, apparently there are many examples from danielsz, who uses system-boot https://github.com/danielsz/system-advanced-example
@lmergen: what are you stuck with right now?
okay, so, what i have discovered so far is that:
- boot-ubermain doesn't really work
- bootlaces' jar doesn't work
- in the end, defining a (comp (aot :all true) (uber :as-jars true) (jar) (target))
generates a jar that seems to, well, give me errors as well
Ok so let's get it to work without any extra stuff like bootlaces/ubermain
1. Don't use :as-jars
β it's only meant for when you have special classloaders like servlet containers. From boot uber --help
:
The --as-jars option pulls in dependency jars without exploding them such
that the jarfiles themselves are copied into the fileset. When using the
--as-jars option you need a special classloader like a servlet container
(e.g. Tomcat, Jetty) that will add the jars to the application classloader.
2. Consider not aot
'ing all namespaces, usually AOTing the namespace that has -main
is enough.
(This makes startup slower of course but you can get back to more AOT once you got the basics working π )
You can test without the second step first and see if that works β certainly possible
Well AOT is required. Just not of all namespaces.
btw, you can assume that my code is basically this: https://github.com/juxt/edge
so, to make sure i'm following your suggestions, right now i just cloned that repo, and am executing:
boot aot uber jar target
@lmergen: ok, and how's that working out? π
which is where my question came from, what's the recommended approach to deploy yada apps
I think yada probably doesn't have an opinion about this
ok, so, this is the error i get:
$ java -jar target/project.jar
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
@lmergen: ah, you'll need to supply a main-ns to jar
(jar :main 'ns.that.has.main)
hello all. i canβt quite figure out how to do the equivalent of lein install
for a clojurescript library. so far iβve tried boot pom jar install
but that installs an empty jar. how do i include my sources?
@sekao: use :resource-paths
instead of :source-paths
(short answer)
@sekao: long answer is that files in source-paths don't have the "output" role (but files in resource-paths have)
@lmergen: does that ns form have (:gen-class)
?
@martinklepsch: thanks π that worked
yep, it looks like this:
(ns com.autheos.api.main
(:gen-class)
(:require
[com.stuartsierra.component :as component]
[com.autheos.api.system :refer [new-system]]))
(defn -main [& args]
(println "victory!"))
@lmergen: any chance your code is public?
what i think is really inetersting, though, is that i see this in the target/META-INF/MANIFEST.MF
:
Manifest-Version: 1.0
Built-By: ptaoussanis
Created-By: Leiningen 2.5.3
Build-Jdk: 1.8.0_60
Main-Class: clojure.main
@lmergen: can you please once again paste the command line invocation you're running + error?
build task:
(deftask build
[]
(comp
(aot)
(uber)
(jar :main 'com.autheos.api.main)
(target)))
error:
$ java -jar target/project.jar
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
@lmergen: my theory is that MANIFEST.MF file is coming from one of your dependencies, maybe sift
it out before jar
?
(sift :include #"META-INF/.*" :invert true)
would be the ticket
what i think is weird, is this: https://github.com/boot-clj/boot/blob/master/doc/boot.task.built-in.md#uber > The --exclude option default is: > > #{ #"(?i)^META-INF/INDEX.LIST$" > #"(?i)^META-INF/[^/]*\.(MF|SF|RSA|DSA)$" }
could it be that the pattern match for META-INF/...
doesn't work, and should rather be META-INF\\...
?
are you on win10? i think it doesn't matter
btw which com.taoensso dep do you have?
(uber :exclude #{#"(?i)^META-INF\\INDEX.LIST$"
#"(?i)^META-INF\\[^/]*\.(MF|SF|RSA|DSA)$"})
versions? i can try and reproduce with them
thanks
@lmergen: can you try with a jar task like (jar :file "project.jar" :main 'com.autheos.api.main)
?
btw if you didn't know, a quick way to dev things like thsi is to boot repl
and then (load-file "build.boot")
every time you make a change
then you can do e.g. (boot (build))
at the repl
same issue, this was the task pipeline:
(comp
(aot)
(uber)
(jar :file "project.jar"
:main 'com.autheos.api.main)
(target)))
@lmergen: do you have your src
dir in :resource-paths
?
maybe doesn't matter since you aot
and the resulting .class
files should be output role?
i was testing with this and the result worked:
(set-env!
:resource-paths #{"src"}
:dependencies
'[[org.clojure/clojure "1.7.0"]
[com.taoensso/timbre "4.7.0"]
[com.taoensso/tufte "1.0.0-RC2"]]
)
(deftask build
[]
(comp (aot :namespace '#{main})
(uber)
(jar :file "project.jar" :main 'main)
(target)
))
where src/main.clj
is hello world
if you can reduce this to a project that yuo can share and make ticket, that would be ideal
in your aot
maybe try (aot :all true)
?
i don't think in your code it's aot-ing anything
and since your .clj
is not on resource-paths, the clj files won't make it to the jar
yeah maybe aot should print a warning if it doesn't do antyhing
excellent, thanks!
would want to verify that there's a target/com/autheos/api/main.class
file also
and it has a -main function
another test you can do is cd target/ && java -cp . com.autheos.api.main
hm, that's an inner class - you should see a main.class
Would it help if I pasted my working uberjar snippet from by build.boot or are you already way beyond that?
@lmergen: do you have (:gen-class)
in your ns decl for main? you need it
@lmergen: yes to @alandipert s question or mine?
it is Timbre's http://manifest.fm
it could be, but we rarely hear about problems on win10 these days
is the problem still the java.lang.SecurityException
?
yes, which is because the manifest doesn't match the .jar (which makes sense, the .jar is my own project, but its manifest is Timbre's)
i see, yes i buy the theory
oh did changing to windows style path fix it?
@alandipert: i'm working on getting the include path right
@alandipert: thanks a lot for your time
no prob! πΎ
this would be a good thing to add to https://github.com/boot-clj/boot/wiki/Running-on-Windows if yuo have a moment
Is this something that could be fixed by using [\/|\\]
or something in these regexes?
iirc the regexes were extracted originally from lein code, maybe they were "cleaned up" a little too much
lmergen: what about using the bash subsystem? is that possible in practice yet?
@alandipert: well, i think i will only be creating more problems rather than less
i figured as much but i didn't want to damper your excitement if you had any π
people seem super excited about it
and it seems weird enough to maybe be good, i dunno
> All other characters match themselves in an implementation dependent manner. This includes characters representing any name-separators.
A question, thinking about that cider
patch that needs some code to be executed at boot init time...what is the best place to evaluate? it should be inside the core pod if i remember correctly right after the main is launched right?
The code will be just a require
and swap!
of middlewares: https://github.com/clojure-emacs/cider-nrepl/pull/358/files
Is there a way to ask boot
not to touch target files it knows are unchanged? I see that it touches files (as in this comment https://github.com/mjmeintjes/boot-react-native/issues/57#issuecomment-235339018), which makes a tool that consumes those files (react-native packager) reload them, rather than using the cached versions.
i think this is the second time i unknowingly forked boot on github. i wonder how that keeps happening...
i think it's cool when you do
@pesterhazy: are you sure the mtime of the files is not changed?