Fork me on GitHub
#boot
<
2017-07-19
>
ag00:07:14

is it fine to have multiple :init-fns in edn file? Having multiple requires seem to work (it has to be vector of vectors), but not sure the format of :init-fns

richiardiandrea08:07:01

@ag not sure init-fns works that way, maybe you need the preloads compile option

martinklepsch08:07:48

@ag multiple init-fns is fine I think

manenko09:07:28

Is it possible to keep a file between builds? I want to download a tool during the build (if it wasn't downloaded before) so that I can use it later.

manenko09:07:51

Ok. there are a few add-cached- functions available. I'll take a look

manenko09:07:01

Maybe this is what I need.

martinklepsch10:07:24

@manenko yes, that’s the right direction I believe 🙂

alandipert14:07:53

please try out 2.7.2-SNAPSHOT if you haven’t. has good stuff in it, most of what will probably be in 2.7.2 which is coming Real Soon ™

dave15:07:05

looks like this release is chock full of goodies. i can't wait!

ska15:07:55

Hi. When a self-written task throws an exception, how do you debug this? I do get a stacktrace, but it contains mostly boot.core and clojure.core fns. Ultimately, it comes from boot.from.clojure.tools.cli/tokenize-args.

alandipert15:07:34

@ska looks like the task was called with malformed argument syntax. that’s the task argument parser failing

ska15:07:46

@alandipert I eventually figured that particular one out (I was passing options to the built-in push task as a map instead of key value pairs), but I am bumping into the next exception and that's why my question is really about: how do you debug such situations?

alandipert15:07:14

by situation, you mean when a function you didn’t write throws an exception?

ska15:07:08

While I am developing a task, I get a stack trace. From wherever. One idea that comes to mind is, if I could read the temporary build file that boot seems to create and which is referenced in the stack trace. I could probably look into that one. But it is deleted when boot finishes. Can I keep it? Or are there other means?

alandipert15:07:43

ah, yes. the -b option of boot is helpful. it prints your build.boot file as boot sees it

alandipert15:07:03

so to find the line number that corresponds to a stack trace you can do boot -b | cat -n

alandipert15:07:11

once your boot file gets too big to easily debug this way, it’s a good idea to move your tasks into namespaces/files

alandipert15:07:21

and then just require them from build.boot instead of defining them there

ska16:07:30

OK, -b helps a little bit. The final report always seems to be the last line, but the stack trace references a few others. Would not have helped in the original case, but good to know. Thanks.

ska16:07:56

No I get a java.lang.Exception: Multiple jar entries match: .*/pom.xml

alandipert16:07:35

that one means there are more than one pom.xml in the fileset. some might have been brought in by dependencies, sometimes people package them

alandipert16:07:57

that can happen after using uber especially

alandipert16:07:28

you can use show -f in your pipeline and grep for pom.xml to confirm

ska16:07:24

Yeah, I just created an uberjar which I want to push to a local Artifactory. I seem to have to compose my uberjar task onto my publish task because otherwise boot can not find the JAR file. Side note: the :file argument for the jar task and the push task seem to have slightly different semantics: The latter needs a "target" added in front of it. Funny enough, although I have a pom task too, my own pom.xml does not end up my uberjar. Oh, there is just too much going on at the same time.

alandipert16:07:27

one thing you could try is the --exclude option to uber

alandipert16:07:34

you can add pom.xml to the regex

alandipert16:07:47

or rather, to the set of regexes to exclude

ska16:07:22

I guess I am getting to the end of today's time slot for this. Will you be at euroclojure tomorrow? Maybe we could meet and I show you what I've got.

alandipert16:07:18

i wont, sorry

ska16:07:05

Too bad. No need to be sorry, your help is highly appreciated. If I manage to get this done, I'll add to Boot docs or snippets.

alandipert16:07:22

that would be great. i think your usecase (deploying uberjars to artifactory) is a common one

richiardiandrea16:07:14

@ska I was able to publish to Maven with a couple of PRs that should be in the latest SNAPSHOT

richiardiandrea16:07:14

I can provide guidance as soon as I land at EuroClojure, you can have a look at this working project: https://github.com/elasticpath/rest-resource-viz/blob/master/build.boot#L50

richiardiandrea16:07:00

The build.boot differs a bit from the standard ones (but I maintain it is more readable). In any case let me know if you need help

andrewboltachev19:07:04

Hello! Is it possible to do colored pretty print in boot (as it's done for Leiningen here: https://github.com/venantius/ultra )?

kurt-o-sys20:07:51

Cross posted from #spacemacs. I think it's boot related (I suppose it concerns caching of files in .boot/cache). I'm using spacemacs, clojure layer and I'm trying to refactor (rename a symbol)

kurt-o-sys20:07:50

or: do I need to commit the files? How to do this?