Fork me on GitHub
#boot
<
2016-05-07
>
myguidingstar13:05:09

@alandipert: thanks for your answer to my second question. I should have made my first one clearer: Let's say I have a Boot pipeline of three tasks: A, B, C. Most of the time all of them work, but at one point of development B throws an exception. Will C still get called?

myguidingstar13:05:56

then if the REPL task is after another that throws exception, then will (load-file ...) work?

myguidingstar13:05:57

hmm, maybe I mess things up, REPL should starts it server instance instead of being inside a pipeline life cycle

alandipert13:05:59

oh, usually what i do is boot repl, then at the repl to run the build i do (boot (A) (B) (C))

alandipert13:05:31

since the repl isn't really part of my build, it's just a way for me to direct the build

myguidingstar13:05:43

so things like boot dev is not recommended? simple_smile

alandipert13:05:25

i think in most cases it's fine

alandipert13:05:43

anyway it's good to develop different workflows, i definitely use boot differently depending on the kind of application

myguidingstar13:05:15

hmm, if a task before boot-cljs-repl throws exception, then boot-cljs-repl should hang, no?

alandipert13:05:31

i'm not sure exactly how cljs repl works, but the builtin repl starts up when the task is constructed, and is a no-op when the fileset gets passed

alandipert13:05:45

the repl has always been a weird thing to think about in a pipeline, it doesn't really fit the idea

alandipert13:05:01

since its purpose is to facilitate interaction NOT via the fileset

alandipert13:05:32

so it's not clear to me how the repl should behave in that circumstance

myguidingstar13:05:24

yeah, it's the repl in pipeline context that confused me, not Boot pipeline itself

myguidingstar13:05:45

so build.boot with REPL tasks should be like this:

myguidingstar13:05:06

(start-repl-server) (start-cljs-repl-server) (boot (notify-repl-server) (notify-cljs-repl-server) ...)

alandipert13:05:08

hm, i just had a thought

alandipert13:05:24

kind of inspired by the way you have symmetric tasks

alandipert13:05:02

so the REPL isn't a good fit for boot builds because it's a separate pipeline

alandipert13:05:16

but what if we decomposed the REPL pipeline into parts and made each a boot task

alandipert13:05:40

so instead of an nrepl client, we have a task that listens for expressions and runs the build pipeline with that form added to the fileset

alandipert13:05:54

and then later in the pipeline, a separate task that evaluates it in the right context

alandipert13:05:36

i guess really the "repl" could be a program that writes code to your source dirs

alandipert13:05:44

and then all the normal boot/watch stuff is responsible for eval

myguidingstar13:05:29

that's what I feel missing

myguidingstar13:05:42

eval in the pipeline context!

alandipert13:05:43

i have to go but if you have any other thoughts on this i'm very interested to hear them

alandipert13:05:52

this is how i do cljs personally, i haven't used a cljs repl since 2012

alandipert13:05:57

live reload ftw

alandipert13:05:08

this would line up repl experiments with the actual app environment also, no context switch

alandipert13:05:16

source of many problems and misunderstandings

myguidingstar13:05:47

it's like Lisp & Boot have it all but we mess 'em up simple_smile

alandipert13:05:50

well i'll see you later, thanks for stimulating discussion

kenbier23:05:40

I am rewriting a lein project in boot, and I am having some trouble moving over some code that ran my datomic migrations. Before, I simply passed a sorted list of each migration filename to the conformity read-resource to get back the tx data, that was then passed along to ensure-conforms which transaced the data. Each migration is in resources/migrations directory. It seems that ( file-name) is returning nil despite the file being valid and in the resource dir.

kenbier23:05:24

Here are my src and resource paths:

kenbier23:05:24

:source-paths #{"src"} :resource-paths #{"resources"}

richiardiandrea23:05:34

@kenbier: if I remember correctly io/resource is used for fetching within jars, what I usually do for targeting both repl and jar is:

(or (io/resource "version.properties")
                   (io/file "version.properties"))

richiardiandrea23:05:23

then slurp or io/reader

kenbier23:05:36

hmm, let me try that

kenbier23:05:47

well that does seem to get me a step futher simple_smile

kenbier23:05:27

passing in just the filename in the lein repl worked but in boot it doesn’t. so im going to try passing in the path relative to resources/ and see if that makes a difference

kenbier23:05:08

now io/reader is complaining the file cannot be found

richiardiandrea23:05:33

if you have it in the resources you should see it on the classpath under /

richiardiandrea23:05:23

if you do boot show -f you can also see your fileset

richiardiandrea23:05:36

and see where it is/will be placed in the uberjar

richiardiandrea23:05:59

(it can be big to display though, so a grep is good there)

kenbier23:05:24

migrations ├── 1453359339862_navi-app-schema.edn └── 1453359390119_navi-app-data0.edn

kenbier23:05:35

looks like its under /migrations ?

kenbier23:05:09

so in lein my resource path looked like this: :resource-paths ["resources" "resources/migrations"]

richiardiandrea23:05:24

yes that should be the same as in boot

richiardiandrea23:05:39

that concept actually comes from maven

kenbier23:05:57

well it complained about the files overlapping, so my resource-path is just [“resources”]

kenbier23:05:27

perhaps lein was putting the files on / and not /migrations?

richiardiandrea23:05:27

if you put stuff in resource-paths in both boot and lein

richiardiandrea23:05:32

you will see them in /

richiardiandrea23:05:01

so now in boot you have only resources, therefore the content is mapped to /

richiardiandrea23:05:15

this is why you see them under migrations

kenbier23:05:25

that makes sense, thanks

richiardiandrea23:05:14

btw if you are using ragtime I suggest you to have a look at boot-ragtime simple_smile

kenbier23:05:48

i considered it but am not. have you used it with datomic before?

richiardiandrea23:05:37

ah not with datomic, only postgres

kenbier23:05:14

yeah if i were using postgres i think id surely be using it simple_smile