This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-20
Channels
- # arachne (11)
- # aws (2)
- # beginners (33)
- # boot (167)
- # cider (71)
- # clara (2)
- # cljs-dev (28)
- # cljsrn (3)
- # clojars (1)
- # clojure (83)
- # clojure-austin (21)
- # clojure-dev (24)
- # clojure-russia (19)
- # clojure-spec (33)
- # clojure-uk (108)
- # clojurescript (114)
- # component (1)
- # core-async (1)
- # cursive (7)
- # datomic (13)
- # editors (1)
- # emacs (15)
- # hoplon (10)
- # lein-figwheel (4)
- # leiningen (3)
- # mount (2)
- # om (134)
- # om-next (4)
- # onyx (42)
- # pedestal (41)
- # quil (2)
- # re-frame (29)
- # reagent (4)
- # remote-jobs (6)
- # ring-swagger (5)
- # untangled (9)
I’m hitting something odd: I have the following in my project’s build.boot:
(defn b
"A convienence; accepts any number of values, converts them to strings, splits each
atring at whitespace, and passes the results to `boot`. This is usually easier and better
than making each argument an individual string."
[& args]
(apply boot (->> args
(map str)
(map str/trim)
(mapcat #(str/split % #"\s+")))))
(defmacro d
"A quick way to easily get artifact dependencies via the `deps` task."
[artifact version]
`(b "deps -d" ~(str artifact ":" version)))
But I get the following:
16:02:49 ~/workspaces/walmart/support-tools > boot repl
nREPL server started on port 53339 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from : [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
boot.user=> (d eReceipts/driver.jms.dev "1.0.0")
java.lang.RuntimeException: No such var: clojure.core/b
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: clojure.core/b, compiling:(/var/folders/9v/hmyph7551sdf6z0w59j94l640000gn/T/boot.user2293753473455555481.clj:1:1)
boot.user=>
16:05:27 ~ > cat /var/folders/9v/hmyph7551sdf6z0w59j94l640000gn/T/boot.user2293753473455555481.clj
(ns boot.user (:use boot.core boot.util boot.task.built-in))
(clojure.core/comment "start boot script")
(merge-env! :repositories [["ereceipts-releases" {:url " "}]])
(set-env! :resource-paths #{"src"} :dependencies (quote [[eReceipts/env-gen "1.6.1"] [com.walmartlabs/lang "1.6.0"] [eReceipts/api.customer "0.1.0-SNAPSHOT"] [io.aviso/pretty "0.1.33"]]))
(require (quote [support-tools.tasks :refer :all]) (quote [clojure.string :as str]) (quote [ :as io]))
(defn b "A convienence; accepts any number of values, converts them to strings, splits each\n atring at whitespace, and passes the results to `boot`. This is usually easier and better\n than making each argument an individual string." [& args] (apply boot (->> args (map str) (map str/trim) (mapcat (fn* [p1__6#] (str/split p1__6# #"\s+"))))))
(defmacro d "A quick way to easily get artifact dependencies via the `deps` task." [artifact version] (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/b)) (clojure.core/list "deps -d") (clojure.core/list (str artifact ":" version)))))
(clojure.core/comment "end boot script")
(clojure.core/let [boot?__1656__auto__ true] (clojure.core/if-not boot?__1656__auto__ (clojure.core/when-let [main__1657__auto__ (clojure.core/resolve (quote boot.user/-main))] (main__1657__auto__ "repl")) (boot.core/boot "repl")))
16:05:29 ~ >
Looks like the line (def d …
) was eval’ed in the clojure.core
NS then emitted into the temp file.
I’ll refactor this to put these into a helpers namespace, but I’d still expect this to just work.
hi, i have a namespace (my-class)with gen-class (with name MyClass) which extends a java class, i have required the namespace in another namespace (my-second) and then have imported MyClass in my-second namespace. in :aot i have [my-class] along with some other ones
when i run boot aot dev (the usual dev task compsed of watch, notify, aot, replserver, dev-system, target
is there a way to see why it is not aot compiled and why boot is not finding the class?
i commented out the import expression in the my-second namespce and i could run the app with no issue..
weird thing - i can require the (my-class) namespace and import the class (MyClass) just fine in repl
(load-file “build.boot”)
(my question would be: “why?”)
i do that frequently when i'm dev-ing a build.boot
Ah, good point!
@seancorfield since you're here, how do you feel about transitioning boot-new to be boot/new ?
the time feels nigh
ie pursuing boot -d boot/new new -t app -n foo
Yup, I’m happy for that to happen whenever the Boot team are ready.
I refactored it some time back to better fit the structure of the Boot core tasks.
What needs to happen next?
perhaps i fork to boot org, and push latest release under boot/new group/artifact?
@alandipert @seancorfield : re (load-file "buid.boot") -- alan is precisely right -- I'm switching to boot now -- and I don't want to have to restart boot every time I change a config option; I also love how simple it is to reload ... just using load-file, lol
I have to say, even boot -d boot/new new -t app -n foo
still feels redundant with two new
s side by side
Rather than fork, I’d prefer to transfer ownership into the Boot organization so my repo goes away and is redirected...
oh, that's what i meant by fork
i would create a new repo, push your latest code to it, and then do a commit to change the coordinates
That way anyone hitting references to my repo will get redirected to y’all’s...
oh, ok
that works too
It’s better for discoverability to transfer the repo directly into the Boot organization.
makes sense
i agree re: verbosity, it's still not ideal
The only problem is I would need permissions to create a repo in the Boot org in order to do this.
that can be arranged, i know people
It only needs to be temporary 🙂
sent you an invite
added you to group on clojars also so you can deploy to boot group
Thank you. It’s on its way to boot-clj right now!
Someone will need to edit all the seancorfield references to boot-clj — I guess I can do that in its new home…?
sounds good
And you want it renamed to boot/new for the artifact?
i think so? i'm open to suggestions
Sounds reasonable...
cool, let's go with it then
i'm thinking about if there are alternatives for shortening the invocation, without pulling it into boot
like if there is a flag or feature we can add to boot to make pulling deps and running their entrypoint task somehow, with max brevity
maybe like... if only one dependency is specified, and its pom contains the task to run by default, or something
boot -d boot/new -t app -n foo
(! 503)-> boot -d boot/new new -t app -n my-new-boot-app
Retrieving maven-metadata.xml from (1k)
Retrieving new-0.5.0.pom from (1k)
Retrieving new-0.5.0.jar from (45k)
Generating a project called my-new-boot-app based on the 'app' template.
I somewhat arbitrarily picked v0.5.0 since it was v0.4.7 in my repo and this “a new start” 🙂
sweet!
can confirm: works great
thanks!
i will noodle on a shorter way to call it
Gives me something to blog about (after a six month gap): http://seancorfield.github.io/blog/2017/01/19/boot-new-moved/
:thumbsup:
Boot new works really reliably in my experience, so thanks for that
fyi: blog post on boot-gae: http://blog.mobileink.com/2017/01/building-clojure-apps-on-google-app.html
(deftask run1
"Run the application for respected environment. e.g boot dev run"
[]
(comp (speak)
(watch)
(sass)
(less)
(reload)
(cljs-repl)
(cljs)
(system :sys #'dev-system :auto false :files ["handler.clj" "system.clj"])
(repl :server true)
(target)))
I'm getting this exception "You have specified manual mode, the files vector should not be present in that case."
@lxsameer the system
task’s files option is for automatically restarting the system. Your :auto false
conflicts with that
@martinklepsch the system restarts but it stil uses the old version of files, why is that?
@lxsameer is that after you fixed that exception? What are the options you know supply to the task?
How do you determine it uses an old version of the files?
> What are the options you know supply to the task?
Also try putting a println in the reloaded files to double check if they’re reloaded or not
Do you get a message that the system was restarted in your terminal?
so you call system like just (system)
?
Hello everyone. If I do this:
(boot (comp (aot) (pom)))
I get this exception.
java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.Named
When I do it on the command-line (instead of at the repl) I get the slightly more detailed
java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.Named
clojure.lang.ExceptionInfo: clojure.lang.PersistentVector cannot be cast to clojure.lang.Named
file: "/tmp/boot.user5956845501623431094.clj"
line: 27
If I could look at this line 27 I might be able to figure out what is wrong with
my build.boot, but there is no such file. How do I proceed?@mikeyr I think that tmp file is actually your build.boot
file so I'd look at or near line 27 for any usages of vectors that might be not quite right.
thanks geoffs
@mikeyr running boot -b | cat -n
will show you the file boot generated and ran based on your build.boot
alandipert: this is the most useful thing for me, why isn't that the default behaviour?
the line numbering you mean? because then the output isn't valid clojure
actually... i guess it might be lol
since the line numbers just get evaluated
actually that's not true, since the numbers would be in other forms
it would need to work something like this:
#_1 (defn foo [x]
#_2 (println
#_3 (inc x)))
I mean boot just shows messages errors that are so hard to figure that it would be nice if they at least traced it back to the original file
w/ line numbers
AWESOME! Thanks Alan
Hi, I just started, well, tried to, use Boot and fell over a NumberFormatException. Can anyone help? http://hoplon.discoursehosting.net/t/numberformatexception/1828
@fg do you have any files in the directory you’re running boot in? (`build.boot` or boot.properties
for instance)
@fg looks like you have a function deduce-version-from-git
defined in your build.boot or profile boot?
you can see the actual problem line with boot -b | cat -n
ther error is happening somewhere in the clj file generated by boot when it combines your ~/.boot/profile.boot and $PWD/build.boot
@fg my quick guess would be that the tutorial expects a git repo and you are not in one?
cool, so it must be a problem in build.boot
. my guess is that template only works if the project has a git repo
ok, the "error message" is a bit misleading, but how can I switch that off? Let's see, The project is the yada tutorial from https://github.com/juxt/edge and there is the build.boot with the deduce-version-from-git function.
you can comment out https://github.com/juxt/edge/blob/master/build.boot#L32 and hardcode a version for now
looking at deduce-version-from-git thinking maybe it's broken because there are no commits? haven't run it myself
About cljs builds, there is a big of demand now for pre-compiling the javascript dependencies, does boot-cljs
do something about it?
@richiardiandrea what js deps do you mean?
@richiardiandrea about the notify failure noise with boot-alt-test, have you tried using a different set of sounds? In the past I've had issues noticing the default failure sound, and on some systems it plays kind of choppily
I’m having real trouble pulling in the latest 1.9 clojure in my boot project. It seems no matter what I do I get:
Classpath conflict: org.clojure/clojure version 1.8.0 already loaded, NOT loading version 1.9.0-alpha14
I’ve cleaned out my profile.boot, checked all boot.properties etc. no references to 1.8 as far as I can see 😞
it means one of your dependencies is bringing in 1.9.0-alpha14
or rather, trying to
oh derp. reading backwards, sorry
I have [org.clojure/clojure “1.9.0-alpha14”]
in the project deps, perhaps I should take that out?
do you have a boot.properties
file?
that is odd
@geoffs yes I have just tried no luck
can you share your project, or a minimal version of it that shows the problem?
then i can try
sounds like you have it properly config'd
@martinklepsch I mean to precompile the meta that cljs requires for things unlikely to change during dev mode (like external libs)
If I remove clojure from the deps list I get: Classpath conflict: org.clojure/clojure version 1.8.0 already loaded, NOT loading version 1.6.0
!
It’s a beast of a project. I’ll binary chop it down to size, and if there’s still a problem I’ll share it, thanks!
boot show -p
, perhaps illuminating
the output is a list of the dependencies maven had to make a decision about, with the libraries contributing conflicting versions that needed to be chosen from
your case is odd because the "nearest" deps win, and you have the clj version you want as a direct dependency. and your boot.properties is set up
and yet, it doesn't like you
is there an org.clojure/clojure section?
are you calling set-env! multiple times in your build.boot?
So now it’s working. I set BOOT_CLOJURE_VERSION
env var to 1.9.0-alpha14, works. Then unset it, still works 😕
do you have a ~/.boot/boot.properties
@richiardiandrea very strange. I just tested with boot-alt-test 0.3.0, and I get success and failure noises with no issues. 😕
@geoffs I don't know what to say lol, I must be cursed 🙂
global .bootignore? i always need .bootignore to exclude emacs * files. it would be nice to have a global /.boot/bootignore . before i file a request, can anybody confirm there is no such global file currently?
@richiardiandrea @martinklepsch If I understood correctly, you mean like Cljs->Google Closure JS module precompilation. This is not something that will or should be solved on boot-cljs level. If it is possible to implement this correctly, it should be done on Clojurescript level.
@mobileink there is no such file, i have emacs configured to put those files elsewhere
i'm too lazy to add it to boot 😄
there has been prev discussion, a couple years ago, i think on discourse?
i seem to remember we concluded it wasn't a good idea for some reason. maybe reason no longer valid
@juhoteperi thanks for the answer, and yeah, I think you are right, I was wondering if boot
can be more efficient in that compared to lein because of cached resources...but no...of course this caching happens after the compiler creates the file...