Fork me on GitHub
#boot
<
2017-09-13
>
donyorm12:09:57

So what's the story on boot new being included into boot main? Having the extra -d argument makes it seem much less slick.

alandipert14:09:35

donyorm to provide defaults i usually rebind the task options in a let inside deftask, like (let [opt (or opt "some-default")] ... )

hswick15:09:45

Would boot pods be a good way to isolate different clojure versions? I have a library that uses core.async so any project using my lib needs to use clojure 1.8.0, however I wish users could use any version. Here is a link to my repo for clarity https://github.com/hswick/jutsu

juhoteperi15:09:51

@hswick Clojure dep is a special case which can't be replaced with podś

juhoteperi15:09:12

This is because Boot itself is built on Clojure so it needs Clojure available on root classloader

juhoteperi15:09:43

Pods inherit from root classloader and can't replace classes which are already available there

juhoteperi15:09:15

(or maybe that would be possible not sure)

juhoteperi15:09:36

Another reason is that the Clojure data structure classes need to be shared between all the pods, so that pods can communicate using Clojure data

juhoteperi15:09:52

If you had different Clojure version, you couldn't pass e.g. Clojure vectors or maps between pods

hswick15:09:14

@juhoteperi thanks for the reply. That is unfortunate, but you have saved me much time trying to figure that out myself!

juhoteperi15:09:36

Anyway, I think it is completely reasonable to require Clojure 1.8, it was released 1.5y+ ago and there isn't much reason to not update to it

Alex Miller (Clojure team)16:09:20

@hswick btw core.async does not require Clojure 1.8 (but will definitely work better with 1.7 to give access to transducers)

Alex Miller (Clojure team)16:09:41

<5% of Clojure users are on a Clojure version older than 1.7

Alex Miller (Clojure team)16:09:59

based on a survey from last December

nha16:09:23

Although people not upgrading their deps are likely not taking the survey 😆 (I took it and probably said I upgrade it, but I know that we have some projects using 1.6 at work and I doubt the maintainers/ex-maintainers took the survey) Otherwise, yes I don’t recall much trouble when upgrading to stable Clojure versions.

dave17:09:51

i was about to say, clojure has been really good about making it easy to upgrade to newer versions of clojure

dave17:09:12

so you practically have no excuse not to upgrade 🙂

hswick17:09:02

@alexmiller the problem is actually when users want to use clojure 1.9.0 for themselves which results in spec errors coming from core.async

seancorfield17:09:12

@juhoteperi Are you sure pods don't let you use different versions of Clojure? I've seen Boot tasks that indicate they specifically allow you to specify the version of Clojure used (isolated in a pod, away from Clojure itself).

juhoteperi17:09:11

I could be wrong on the reasons, but the Clojure version Boot uses is defined on a env var, and Boot ignores the version from dependencies. I think it works the same with pods.

Alex Miller (Clojure team)17:09:31

@hswick those spec errors were fixed in core.async and released over a year ago

hswick17:09:06

@alexmiller looks like I’m using a very old version of core.async then, will update and try again

seancorfield18:09:28

@juhoteperi Both boot-test and boot-expectations rely on being able to create a pod containing a different version of Clojure and I just verified that it works as expected: you can load Clojure 1.8.0 in a pod, even when Boot is using 1.9.0-alpha20 (for example).

seancorfield18:09:21

(! 577)-> BOOT_CLOJURE_VERSION=1.8.0 boot call -pf clojure-version test -c 1.7.0 
Classpath conflict: org.clojure/clojure version 1.8.0 already loaded, NOT loading version 1.9.0-alpha20
1.8.0

Testing versions.core-test
1.7.0
my boot.properties file specifies 1.9.0-alpha20, this shows BOOT_CLOJURE_VERSION overrides that (as expected) and the tests run with Clojure 1.7.0 (the test prints the result of (clojure-version))

seancorfield18:09:59

(interestingly, if you have a specific version in boot.properties, that is what is used for boot-test, even if you override the version that Boot itself uses)

seancorfield19:09:26

See

(! 578)-> BOOT_CLOJURE_VERSION=1.8.0 boot call -pf clojure-version test
Classpath conflict: org.clojure/clojure version 1.8.0 already loaded, NOT loading version 1.9.0-alpha20
1.8.0

Testing versions.core

Testing versions.core-test
1.9.0-alpha20

ag22:09:04

how do I log (verbose) into file, why boot -vv some-task target > mylog.log works for only partially ?

hmaurer22:09:16

@ag what do you mean by only partially? what output is missing?

ag22:09:13

@hmaurer everything that's usually highlighted differently in the console (verbose part of the log)

hmaurer22:09:19

Maybe boot is printing some stuff to stderr

hmaurer22:09:26

And that isn’t getting piped to your file?

hmaurer22:09:56

@ag can you try boot -vv some-task target > mylog.log 2>&1 ?

ag22:09:12

how do I do it with tee so it's shows up on the screen as well?

hmaurer22:09:04

@ag is everything getting logged to the file properly with this?

ag22:09:21

seems it does

ag22:09:30

how can I use it with tee?

hmaurer22:09:49

mmh, I don’t use tee but can you try boot -vv some-task target > mylog.log 2>&1 | tee -a log ?

hmaurer22:09:39

if that doesn’t work then I don’t know, sorry 😕 I usually tail -f whatever file I am piping a log to

ag22:09:28

@hmaurer I got what I wanted, I will try that too. Thanks!

ag23:09:01

the last thing with tee didn't work, it's okay... I'll find a workaround. or just tail to the logfile