Clojurians
#boot
<
2016-03-19
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

domkm00:03:40

Is there a recommended REPL-driven workflow to use when creating a task?

domkm00:03:58

I'd like to be able to trigger a task and inspect the output. Perhaps I'm overthinking this...

alandipert01:03:32

@domkm: I usually do load-file on build.boot but with core/pod etc referred explicitly. Then I move it to a different file

alandipert01:03:12

I bet we could have a slicker workflow with some more thought tho

domkm01:03:30

@alandipert: I don't think I quite follow. I'd like to be able to def a task, then invoke it with a fresh fileset from the project (IDK how to create this), and then inspect the output of the task (a modified fileset, I presume).

domkm01:03:55

With that said, I got this task to work so I don't need the above workflow right now, but I'd certainly like to have it figured out for future reference. :simple_smile:

alandipert03:03:28

@domkm: what i meant was i'll open a boot repl and after i modify my build.boot i (load-file "build.boot") in the repl. then at the repl i invoke (boot (my-task)) to see what it does

alandipert03:03:25

maybe what would be cool is an emacs minor mode that does (load-file "build.boot") as an after-save action on build.boot files, if there's an active cider connection to the same project

smw03:03:45

or a boot task that watches build.boot and reloads it?

domkm03:03:34

Ah, I see. Thanks @alandipert

alandipert03:03:42

@smw: that would be cool too. we need metaboot :simple_smile:

alandipert03:03:32

@cfleming: i emitted some possibly weird and incoherent thoughts on the reddit thread about boot/cursive integration, very interested to hear what you think

cfleming03:03:02

@alandipert: Thanks, will take a look

smw03:03:44

Seems like a pretty good idea, make it the build tool’s responsibility to inform cursive/other editors.

cfleming03:03:14

Some responses back on reddit

cfleming03:03:15

I have a pretty good idea about how boot works, but I haven’t spent enough time seeing how most people actually use it in practice. I’ll need to actually spend some time doing that to get an idea of the best approach.

alandipert03:03:32

one in-practice example i deal with daily is the case of the uberwar

alandipert03:03:45

in a servlet container boot isn't the entrypoint, so there aren't pods at servlet time

alandipert03:03:59

(i want to change this in the future but that's where it stands now)

cfleming03:03:07

I know seancorfield mentioned at some point that they have all their dependencies externalised into an EDN file - realistically I’ll never be able to support that.

alandipert03:03:34

so, like anyone preparing an uberwar, i need to deal with conflicts etc in the packaged jars, mergers, etc

cfleming03:03:01

Ok, so a lot of the dependency management is done by hand?

alandipert03:03:13

not a lot, just the usual

alandipert03:03:17

same as one would do in maven or gradle

alandipert03:03:24

vs. what i can do at build time, where i have pods

cfleming03:03:38

Do you have a public example of a task doing this that I can look at?

alandipert03:03:55

hm, let me liberate some IP

alandipert03:03:43

that's maybe the trickiest dependency thing i've ever done in an actual work app

alandipert03:03:06

the ~boot-version business

alandipert03:03:21

this app is an executable uberjar

alandipert03:03:39

so all the deps except expectations makes it into the jar, because it's :scope "test"

cfleming03:03:45

So I can probably handle all that except the boot/pod dep

cfleming03:03:07

Sorry, I’m trying to get a release out the door, I’ll have to pick this up later

cfleming03:03:48

But I’m interested in examples of funkiness, although in my experience the best way to get those examples is to release something which doesn’t support them :simple_smile:

alandipert03:03:51

no prob. i updated the build.boot with kinda what i was imaginating

cfleming03:03:57

Yeah, I see. I still have the problem that that will only support boot projects specifically designed to be used with Cursive

alandipert03:03:58

not necessarily, for instance users could instrument set-env! in ther profile.boot, which is code that runs before build.boot

alandipert03:03:35

but yeah the static analysis maybe gets you as far as you need to go with your users, i don't know

alandipert03:03:19

anyway thanks for checking it out, gonna head out myself! good luck on release

seancorfield04:03:47

We actually have some dependency versions in a properties file and we use that to post-process the EDN and then we sometimes we pour additional deps into that. So our dependencies are completely dynamic.

seancorfield04:03:40

We also have a few places where use "RELEASE" instead of a specific version.

seancorfield04:03:16

(For tooling, not for our actual programs, and that's mostly tooling we control).

seancorfield04:03:26

So, no chance that any IDE could figure out this, short of running boot show -c ... which, funnily enough, is exactly how we bootstrap our hybrid web application.

alandipert04:03:53

@seancorfield: curious, why RELEASE and not a version?

alandipert04:03:20

oh nvm read next msg - i can see how it makes sense if you own the artifact

seancorfield04:03:13

Because then we don't have to update certain dependencies in our tool chain: we can just publish a new version of a tool and everything picks it up on the next restart.

seancorfield04:03:25

It's also great while we're prototyping and developing new pieces (so lazy). But since we can then peg versions in a properties file later, we can override RELEASE.

seancorfield04:03:49

Boot has allowed us so much control over stuff that was painful with Leiningen.

alandipert04:03:52

yeah i live in a boot bubble

alandipert04:03:09

but i have a sense that boot's merits make the most sense to people when it's used on a team, to define an organization's workflow

alandipert04:03:43

maybe it's that tools don't matter if you use them alone, or something

onetom04:03:02

@cfleming: we keep maintaining a project.clj and a build.boot in tandem, just so cursive can consistently format our code :confused: i keep symlinking our build.boot under src and adding a (require '[boot.core :refer :all]) at the very top, so deftask, set-env! and task-options! are resolvable. but it's still not enough, because boot.core is an implicit dependency for build.boot, so i have to add [boot/core "2.5.5"] to the project.clj i generated with lein-generate (from https://github.com/boot-clj/boot/wiki/For-Cursive-Users)

onetom04:03:27

but then i have the boot version specified in 2 unconnected places: boot.properties and project.clj, so they can diverge :disappointed:

cfleming06:03:30

@onetom: Yeah, I know this is painful. I’m definitely planning to do what I can.

onetom13:03:37

@cfleming: we do love Cursive otherwise! we - from Exicon - bought a few licenses in 2 rounds, so all of our pairing workstations are equipped with Cursive now. thanks a lot for the great software. we learnt so much about clojure and clojure libs thanks to Cmd-Y and F1 :simple_smile:

onetom13:03:07

so it still worth all that extra hassle

kingoftheknoll14:03:15

been playing around with Boot and I like it a lot so I’m going to be using it for my next project! But one thing seems vague to me. I’m building an ring API server and most things I’ve seen with boot like pandeiro/boot-http are meant for frontend dev just to serve static contents. Is there a lein-ring style task out there or would you create your own deftask to call my own -main or handler function?

martinklepsch14:03:47

@kingoftheknoll: the server task does have a handler option where you can pass a custom handler :simple_smile:

martinklepsch14:03:11

in general boot task-name --help is often a good place look for this kind of stuff :simple_smile:

kingoftheknoll14:03:00

you’ll have to forgive me I don’t see a built

kingoftheknoll14:03:33

or any other than pandeiro/boot-http in the third party tasks listed.

kingoftheknoll14:03:00

Sorry I see that pandeiro/boot-http has a handler option

martinklepsch14:03:44

ah, I meant serve task of course :simple_smile:

martinklepsch14:03:58

and yes, the one in pandeiro/boot-http :simple_smile: @kingoftheknoll

kingoftheknoll14:03:22

thanks, I’ll give that a try :smiley:

inhortte15:03:39

I'm writing a shebang boot script and am getting errors. The problem is that boot reports something like the following: clojure.lang.ExceptionInfo: Unable to resolve symbol: o in this context data: {:file "/tmp/boot.user5782324653526199192.clj", :line 17} java.lang.RuntimeException: Unable to resolve symbol: o in this context It's obviously a syntax error, but the larger problem is my inability to access /tmp/boot.user5782324653526199192.clj after execution ends and the reported line number in my source file contains no errors. Is there any way to remedy this? Thanks...

martinklepsch15:03:07

@inhortte: you can try using boot -b which will print the generated boot script

inhortte15:03:20

@martinklepsch: How do I place options to boot in the shebang? #!/usr/bin/env boot -b does not work.... (and I see there are pages and pages of discussion on this at stackoverflow :simple_smile: ).

martinklepsch15:03:45

@inhortte: I think just running boot -b file might be equivalent?

inhortte15:03:54

regardless of any errors, the output is the following:

(ns boot.user (:use boot.core boot.util boot.task.built-in))

(clojure.core/comment "start boot script")

(clojure.core/comment "end boot script")

(clojure.core/let [boot?__1228__auto__ true] (clojure.core/if-not boot?__1228__auto__ (clojure.core/when-let [main__1229__auto__ (clojure.core/resolve (quote boot.user/-main))] (main__1229__auto__ "pdir_diff.clj")) (boot.core/boot "pdir_diff.clj")))

kingoftheknoll16:03:40

@martinklepsch: I got it working!

kingoftheknoll16:03:07

Question, once you start watching stuff you lose the repl prompt, how do you get it back?

martinklepsch16:03:10

@kingoftheknoll: I usually have a terminal boot dev with the watch running and then connect to the REPL server

dimovich16:03:16

hello everyone

dimovich16:03:30

is there some workaround for the java.nio.file.AccessDeniedException on Windows 7?

dimovich16:03:48

trying to do the modern-cljs tutorials, and don't really want to install Linux for this... :disappointed:

dominicm17:03:53

Is there any way to compose the repl client with other tasks? I'm trying to figure out magic.

dominicm17:03:15

@dimovich: You might need to try to isolate the cause

alandipert17:03:16

@dimovich: i'm not aware of anyone running without those errors on win7.... but i do see frequent reports that everything works great on win 10

micha17:03:03

@inhortte: there are limitations with the shebang method in Unix

kardan17:03:21

Anyone got an example of how to handle scss compilation? After some playing around I can compile scss from src/styles to /target/public/styles. But I’m lost in how to get the produced css into the uberjar. Not even sure if the scss files should live in a source-paths dir. Realise that I sound confused. But anypointers where I can try and read up on this stuff?

inhortte18:03:41

@micha it's possible to include one option (or argument) meaning none if i use /usr/bin/env ...

kardan18:03:06

Ok think I got the sass routine working (might just have freaked out since I had to deal with the classpath).

dominicm19:03:06

@micha: You had any more thoughts on your isolated repl middleware into pod stuff?

micha19:03:54

@dominicm: i remember spending some time trying to make it work when we first were thinking about how to make the repl task, but i didn't make much progress at all

micha19:03:15

the essential problem is that the nrepl machinery calls eval directly

micha19:03:27

so nrepl itself can't be in an isolated pod

micha19:03:00

what i wanted to do was have it instead send a message to a socket repl server instead

dominicm20:03:17

Yeah. Hmm..

dominicm20:03:28

I mean, MrAnderson works for most things anyway I guess.

meow20:03:35

Remember when we used to be normal?

micha20:03:03

ah normal