Fork me on GitHub
#boot
<
2015-06-18
>
podviaznikov00:06:05

@danielsz @juhoteperi would know better. I’m not sure myself. I assumed that is how you call function inside the pod

micha00:06:01

(let [metadata {:foo 100 :bar 200}]
  (boot.pod/with-call-in p
    (io.perun.ttr/calculate-ttr ~metadata)))

micha00:06:11

@danielsz: that calls the io.perun.ttr/calculate-ttr function in the pod p context, with the value of metadata from the current context

micha00:06:36

it's building an expression to evaluate in the pod

micha00:06:56

(the second argument to the with-call-in macro)

micha00:06:00

so for with-call-in and with-eval-in you provide a template

micha00:06:40

the ~ is how you parameterize the template, basically

micha00:06:40

it's similar to how syntax-quote works, but it doesn't resolve names

micha00:06:05

check out brandon bloom's "backtick" library, it's what we're using there

danielsz03:06:12

micha: Awesome. I had no idea. Does this need to be documented in the Wiki?

micha03:06:46

it's in the api docs, but it could definitely be explained better

micha03:06:39

danielsz: ^^

martinklepsch07:06:46

Is there any significant difference from creating tmp-dir outside of with-pre-wrap vs inside it?

juhoteperi10:06:12

martinklepsch: Outside of with-pre-wrap it is created once (when the boot starts), inside it is run each time e.g. watch triggers build (though it is probably no-op if the dir exists already)

martinklepsch10:06:08

@juhoteperi: I don’t think it’s a no op given that tmp-dir should always give you a new dir no?

danielsz10:06:05

martinklepsch: yup, that’s the one

danielsz10:06:22

micha: You made boot’s pod api (`with-call-in` and with-eval-in )rely on a templating library while it is possible to achieve the same in pure Clojure, isn’t it? Not criticizing, just asking myself if it wouldn’t be better.

danielsz10:06:36

the downside of course is that it causes surprise for those not familiar with the backtick library

danielsz10:06:10

Instead of a template, I would have passed a fn var and regular arguments separately. Like in apply or something like that.

danielsz10:06:09

Unless I’m missing subtle resolution issues related to pods, that would work too.

danielsz12:06:38

A fully qualified fn var and expanded arguments (values).

danielsz12:06:10

Very interesting stuff...

danielsz12:06:48

But as far as I can see, you don’t use a custom resolver for pod functionality.

micha12:06:40

danielsz: backtick is advantageous in the following situation:

danielsz12:06:40

Oh hey good morning micha ! simple_smile

danielsz12:06:53

Listening...

micha12:06:17

(let [x 100]
  (pod/with-eval-in p
    (require '[foo.bar.baz :as baz]
             '[omg.hihi    :as hihi])
    (defn somefn [z]
      (let [y (hihi/doit 100)]
        (baz/print (+ ~x y z))))))

micha12:06:39

backtick lets us do that in a straightforward way

micha12:06:38

you don't need to do like (defn ~'somefn [z#] (let [y# ....

alandipert12:06:06

you can also generate clojure code by some other means and run it in the pod with boot.pod/eval-in* eg (boot.pod/eval-in* p (cons '+ (list 1 2)))

micha12:06:10

try to do (require '[omg.hihi :as hihi]) via syntax quote

micha12:06:51

`(require '[~'omg.hihi :as ~'hihi])

micha12:06:07

that's sort of astonishing, no?

micha12:06:49

alandipert: yeah i think the macro was unnecessary

alandipert12:06:02

i think he may have meant that you need to use source at all vs. suppling a function value to run in the pod

micha12:06:20

oh, i see

micha12:06:30

you can't pass function values between pods

micha12:06:35

unfortunately

micha12:06:53

you can only pass things like strings

alandipert12:06:59

because functions can close over environments, and the pod is a deliberately alien environment

micha12:06:02

primitive java types

micha12:06:21

right but just because of the classloader mechanics

danielsz12:06:07

ah, OK, you can’t pass fn vars, that’s what I was missing

danielsz12:06:29

micha: alandipert thanks

danielsz12:06:49

alandipert: boot.pod/eval-in* is the non-backtick reliant equivalent of with-eval-in

danielsz12:06:32

alandipert: cool.

micha12:06:28

the boot.pod namespace is loaded into every pod

micha12:06:37

including newly created ones

danielsz12:06:59

alandipert: micha you wizards!

micha12:06:46

you call the eval-in* function in the current pod with 2 args, the remote pod and the expression

micha12:06:20

eval-in* prints the expression as a string and calls the 1 arg arity of eval-in* in the remote pod

micha12:06:41

that's the "receiving end"

micha12:06:21

the (.invoke pod "boot.pod/eval-in*" ...) business is the primitive pod interface

micha12:06:44

eval-in* is an abstraction over that

danielsz12:06:09

Very cool. Definitely needs more documenting. I’ll try to come up with something.

danielsz12:06:27

The wiki explains well pods as an isolation mechanism

danielsz12:06:32

and the api is there too

danielsz12:06:48

but I was missing the deeper insights (and probably still am)

micha12:06:09

classloaders are a whole thing

micha12:06:31

i spent months researching and experimenting

danielsz12:06:16

I guess it was worth it, judging by how pods solve fundamentals

micha12:06:31

yeah boot wouldn't work without them

micha12:06:50

boot1 was fine for small projects

micha12:06:03

but in the real world you end up with lots of dependencies pretty quickly

micha12:06:18

like imagine 3 or 4 people working fulltime on an application

micha12:06:28

you accumulate dependencies

micha12:06:47

and at some point :exclusions don't help

micha12:06:58

this is the kind of thing bruce is going to run into later

micha12:06:44

alandipert: does packagecloud host a ppa for you for ubuntu?

micha12:06:10

like if i do the fpm thing and set it up on packagecloud, people can add it to their apt.sources or whatever right?

micha12:06:25

even though fpm doesn't produce debian-approved packages

thickey13:06:10

Is there a way to exclude resources from being included in output? I am trying to get my output to only have the new files I create as part of my build.

martinklepsch13:06:10

boot sift —help

martinklepsch13:06:37

There’s an :exclude option that should help with that kind of stuff @thickey

martinklepsch13:06:13

@thickey: let me know if it didn’t help simple_smile

alandipert13:06:00

@micha: i don't know the difference between ppa and apt repo

alandipert13:06:23

@micha: but i haven't seen the word ppa in their docs so i would assume not, i'm sure we can just ask julio tho

alandipert13:06:50

@thickey: btw welcome to the party man!

thickey13:06:15

@alandipert: thanks, I’m having a blast!

micha16:06:07

hi jthomson!

jthomson16:06:22

i ❤️ boot

micha16:06:35

great! how are you using it?

jthomson16:06:36

@martinklepsch made me get a t-shirt with that on it

martinklepsch16:06:57

haha, that’s not true is it?

jthomson16:06:05

i'm wearing it right now

martinklepsch16:06:13

picture or it didn’t happen 😄

jthomson16:06:27

as our main build tool for clj, cljs and cordova

jthomson16:06:15

nothing too fancy yet but has made for a nice stress-free dev and deployment experience

micha16:06:55

wow, great!

micha16:06:28

jthomson: documentation worked well for you then, since i haven't seen you in here before simple_smile

jthomson16:06:46

yes I got through it and know what a pod is! I think I got stuck on executing user code from a boot task, and did have a little help from martin.

jthomson16:06:16

we were having a few issues with CI but they turned out to be due to dependency conflicts and nothing really boot related

martinklepsch16:06:46

@jthomson: you know boot show -p ?

jthomson16:06:19

yep that's a goodie

martinklepsch16:06:23

@alandipert: I remember you were looking for testimonials once — @jthomson is your guy 😄

alandipert17:06:00

hehe yes - awesome!

danielsz17:06:26

Gonna throw a band together called Boot and the coconuts.

martinklepsch17:06:19

Is there a vector version of the boot logo somewhere?

raywillig18:06:59

@alandipert: I desperately need a new supply of boot stickers. My old laptop died and my new one seems so naked

alandipert18:06:18

@raywillig: oh damn i forgot to resupply you

cpmcdaniel18:06:53

those of you using boot2 with Java 7, how high are you finding you have to bump up PermGen to not blow it on a regular basis?

alandipert18:06:32

@cpmcdaniel: 128m was working OK for me regularly

cpmcdaniel18:06:47

does it consume quite a bit more when using using watch to fire off tests on each save?

cpmcdaniel18:06:13

or maybe, using the reloaded workflow

cpmcdaniel18:06:30

somehow I managed to blow it up often

podviaznikov18:06:02

@martinklepsch nice! is it still wip? can’t find build.boot file

martinklepsch18:06:42

@podviaznikov: still very much WIP though

podviaznikov18:06:44

nice, I like that it almost didn’t require original blog files. It was easy migration for my blog too

martinklepsch18:06:37

@podviaznikov: would you consider giving me push access to the repo? there are a few small things I stumble upon that are not really worth creating branches and PRs (for anything significant I’d still create PRs)

podviaznikov18:06:53

sure, I was actually thinking of asking you if you want it

podviaznikov18:06:38

send invitation

micha18:06:20

cpmcdaniel: if you're creating pods in a watcher it's a million times better experience all around if you can use java 8

micha18:06:53

no tuning required for java 8

podviaznikov18:06:49

nice, that is a lot for 1 moth old project:)

juhoteperi19:06:47

Github is quite bad at notifying about invites 😄

podviaznikov19:06:07

yes, I do. I was thinking about creating simple site with perun and put it on http://perun.io

micha19:06:14

martinklepsch: wow clickbait city

micha19:06:13

does anyone here use dunaj?

martinklepsch19:06:27

not using it but some people at our latest meetup said there are some nice ideas

micha19:06:53

some great ideas there!

martinklepsch19:06:14

Is there some “this are the great ideas” doc?

micha19:06:43

i don't see myself using some of those features much at all, but i think they're all good ideas for when you do need them

micha19:06:56

even the optional types stuff

micha19:06:59

the only thing i'm unsure of is how dunaj -> clojure interop works

micha19:06:12

but i have a feeling that pods could really be a thing there

micha19:06:30

use boot pods for interop with clojure libraries from dunaj

martinklepsch19:06:50

It’s so cool not needing to care about deps for build steps. Shovel it in a pod. Done.

danielsz20:06:28

martinklepsch: I hope you have enough popcorn.

martinklepsch20:06:32

More people will come to a conclusion faster. That’s how it works right? ¯\(ツ)

danielsz20:06:40

Complaint rings true to me. Feels like there is an aristocracy in Durham. Not necessarily a bad thing, though.

danielsz20:06:21

I am too far removed from the center to know anything of value about that.

danielsz20:06:27

Watching from the sides. Politics. Love it.

danielsz20:06:09

You can’t do this in IRC.

martinklepsch20:06:35

There should be some :politics: emoji

danielsz20:06:35

(no emoji) 🏩

martinklepsch20:06:51

oh wait I found it :poop:

podviaznikov20:06:03

yep, I’m online

martinklepsch20:06:38

I just ran full speed in the wrong direction I think hahaa

martinklepsch20:06:47

I was looking at all that permalink stuff and just sort of going at it, ended up writing a slug task that generates slugs from keys in the metadata but know that I think about it it’s probably wise to keep links match files as titles might get edited etc.

martinklepsch20:06:58

It was fun though 😄

podviaznikov20:06:34

actually, if you have slug task we can include id as separate plugin. Some people might need it. It sounds similar to https://github.com/nsonnad/metalsmith-slug

podviaznikov20:06:27

maybe to avoid title rename problem we can append some generated hash to the end of the slug (that would never change)

podviaznikov20:06:41

reddit has that

podviaznikov20:06:34

Like http://www.reddit.com/r/sports/comments/35lmh6/derek_roses_son_is_an_0g/. You can change any letter in the last part of url. But 35lmh6 is fixed

martinklepsch20:06:46

yeah, I just stuffed it into io.perun.experimental for now.

martinklepsch20:06:57

The thing with reddit is that titles don’t change though

martinklepsch20:06:12

when I edit my post and change the title my post will end up at a different location

martinklepsch20:06:40

In some scenarios that might be ok or data won’t change but in a permalink context it’s rubbish

podviaznikov20:06:32

I personally like generating links from filename, but I also think for some people slug can be useful

micha20:06:12

danielsz: with boot-shim.clj you can patch anything in clojure that you don't like!

micha20:06:20

so no need for drama

danielsz20:06:59

micha: haha. But the masses want drama. lol

danielsz20:06:57

boot-shim.clj is cool. I’ll give you that. 😃

danielsz21:06:57

I would love to get your opinion on something. I need to write a script that will be a part of Unix pipeline. A simple script, reads from STDIN, writes to STDOUT, but it needs to do some cipher work, so it will rely on the standard library of the language in which the script will be implemented. Clojure seems like overkill, right? What language would you use?

danielsz21:06:50

A Lispy language would be nice.

danielsz21:06:09

Racket, scsh maybe

martinklepsch21:06:21

@podviaznikov: I found a use for the slug stuff: slug task adds :slug key to metadata which is derived from filename (dates and extensions can be stripped this way; function customizable). permalink task has a permalink generation function which can be passed as option which just gets the files metadata and builds a permalink from it.

juhoteperi21:06:53

I usually use Bash, C or Python for small scripts, as they are easily available. Bash probably wouldn't work in this case unless there is a already app which does the cipher.

danielsz21:06:15

deraen: Cool.

danielsz21:06:03

deraen: What draws the line for you between C and python?

juhoteperi21:06:11

Depends on the cipher also. C stdlib doesn't probably have that kind of stuff but there are loads of libraries which do that and many are probably available in most of Linuxes.

juhoteperi21:06:08

If I can implement the thing without additional python libraries it usually works fine, but it's pain to use external python libraries especially if they are not available in package manager.

danielsz21:06:31

cipher is AES.

juhoteperi21:06:09

I think openssl binary can do that

danielsz21:06:39

deraen: oh, yeah, that would completely remove the necessity of a script. Very good idea.

juhoteperi21:06:25

cat build.boot | openssl enc -aes-192-cbc -pass pass:foo

juhoteperi22:06:39

martinklepsch: I think tuples are used usually with (into {} (for [[k v] m] [k (f v)])) instead of maps

martinklepsch22:06:12

@juhoteperi: thanks for reviewing. I’ve always been using maps 😄 but tuples make kinda sense, you’re right simple_smile

juhoteperi22:06:17

I was just going to comment about experimental ns :d

martinklepsch22:06:01

I put it into experimental after I thought that whole slug thing was mislead, but then it all made sense 😛

juhoteperi22:06:45

I wonder what would be the best way to pass in the functions to tasks

juhoteperi22:06:18

code instead of sym in option type should work, I think?

martinklepsch22:06:47

yeah, just pushed that

martinklepsch22:06:34

code also seems to be able to just resolve a sym if it’s given one

danielsz22:06:49

Awesome what you can do on the Unix command line

danielsz22:06:21

In the end I used some awk incantations to read fields of interest in a file and piped it to openssl

danielsz22:06:07

deraen: Look at my boot-system, it uses code

martinklepsch22:06:44

I’m wondering if the use of metadata on the fileset object is an intended design decision or more of a nice coincidence? Anyone knows?

martinklepsch23:06:02

@jeluard: right, I remember reading that.

danielsz23:06:46

martinklepsch: Yes, a pattern. I did a writeup the other day in the wiki about just that. https://github.com/boot-clj/boot/wiki/Task-Writer%27s-Guide#patterns

martinklepsch23:06:05

Is that code from perun? looks as if it is? 😄

martinklepsch23:06:19

that :metadata key is arbitrary right?

danielsz23:06:53

you can name it anything you want.

danielsz23:06:22

I so wish I could use this: http://scsh.net/

danielsz23:06:01

I should have said, I so wish this would come alive

martinklepsch23:06:07

nice work on the wiki page @danielsz

danielsz23:06:18

martinklepsch: thanks!

martinklepsch23:06:55

Alright, time to sleep. Later everyone!

danielsz23:06:16

Sweet dreams, Martin

alandipert23:06:03

@danielsz: you're crushing it on the wiki man, thanks 👏

danielsz23:06:57

welcome rickmoynihan

danielsz23:06:14

off-topic: mbsync is so much better than offlineimap

alandipert23:06:43

@micha: i think i'm gonna go the path of a boot.App -> servlet shim, if only to level up on boot.App

rickmoynihan23:06:05

So I've got about 20 private clojure projects on our jenkins ci server -- and I have a problem ensuring repeatable builds when building SNAPSHOT jars from branches... Obviously this can be solved by not using snapshots -- but then the CI server isn't really automatically integrating the latest work for you... Would switching the projects over to boot help? And if so how?

alandipert23:06:24

@rickmoynihan: are these libraries or applications?

rickmoynihan23:06:00

libraries and applications -- obviously we don't install applications or deploy them to clojars

rickmoynihan23:06:21

basically I'd like to setup jenkins to only install the jar after all its dependencies have passed their builds... but currently it needs to lein install before hand so they can pick up their dependencies

rickmoynihan23:06:48

and then you contaminate the global state

rickmoynihan23:06:57

with a potentially broken lib

alandipert23:06:00

i see what you mean, because /home/jenkins/.m2 is project-global you mean?

alandipert23:06:07

i suppose you can't lein deps && lein test && lein install for some reason?

alandipert23:06:19

not that i'm advocating lein simple_smile just trying to understand the problem

rickmoynihan23:06:57

lol - well the situation is that the lib tests pass -- but it can cause downstream test failures - in which case you want to rollback the install

rickmoynihan23:06:37

or only install after all downstream have passed

alandipert23:06:11

and downstream projects pick up passing upstream libs because of your use of SNAPSHOT?

alandipert23:06:01

hm, so i'm not sure boot would particularly buy you anything

rickmoynihan23:06:13

yeah I didn't think so either

alandipert23:06:14

as the mechanism under boot for dependency resolution is maven via aether, same as lein

rickmoynihan23:06:51

but was wondering whether builds are pure functions would help in this regard

alandipert23:06:16

one thing you can do with boot that you can't easily do with lein

alandipert23:06:24

is produce multiple artifacts from one 'build'

alandipert23:06:38

i don't currently where i work now, but at a previous place we had a lot of private libraries

alandipert23:06:01

if boot existed at the time i would have folded them into a single git repo and build, that produced multiple jars all with the same version

alandipert23:06:10

then uploaded them transactionally to artifactory

alandipert23:06:26

avoiding dependency problems up front

rickmoynihan23:06:20

I'd rather not do that -- because there are several different apps with different release cycles... and some of libraries are opensource and others are private

alandipert23:06:36

ah, yeah some portion being open source is the kicker