Fork me on GitHub
#boot
<
2016-06-11
>
richiardiandrea03:06:41

No it looks like I have to dig more 😉

micha21:06:58

exclusions and the filtering of nontransitive deps

richiardiandrea21:06:21

awesome! should I rebase my PR as well?

micha21:06:34

i didn't see the PR there

richiardiandrea21:06:42

ah ah no problem 🙂

richiardiandrea21:06:06

the important is that the feature is there 😉

richiardiandrea21:06:44

I mean my PR filters direct deps from the conflicts

micha21:06:08

looks like we ended up with the same thing 🙂

richiardiandrea21:06:36

yeah, I will try yours ok? just to see if I get the same result on a project of mine

richiardiandrea21:06:51

is it on clojars already ?

micha21:06:51

excellent

micha21:06:03

i could add some test cases

richiardiandrea21:06:26

perfect way to try boot.test ! 😄

micha21:06:13

also boot-alt-test

richiardiandrea22:06:43

@micha I have some weird behavior...with my patch it was the same

richiardiandrea22:06:12

so basically no conflicts, and I specified [clojure 1.8.0]

richiardiandrea22:06:47

but when I do drip -cp cp clojure.main I get a 1.7.0 repl and the classpath file contains 1.7.0

micha22:06:08

what about when you do java -cp?

micha22:06:19

i think drip might be using a stale cpasspath

richiardiandrea22:06:26

it is in the file

micha22:06:27

1.7.0 is in the file?

micha22:06:46

can you paste your dependencies pls?

micha22:06:55

i'll see if i can reproduce

richiardiandrea22:06:11

kk I am investigating as well

richiardiandrea22:06:34

my configuration:

{:file "cp"
  :scopes #{"compile" "runtime" "test"}
  :dependencies ...a lot of deps...
  :exclusions '#{org.clojure/clojure org.clojure/clojurescript com.google.guava/guava}}

richiardiandrea22:06:17

@micha I found out, I had [org.clojure/clojure "1.8.0" :scope "provided"]

richiardiandrea22:06:30

sorry about that

richiardiandrea22:06:38

that's exactly what you were talking about yesterday lloll

micha22:06:46

still strange though, because you had org.clojure/clojure in the :exclusions, so I would expect that the file simply wouldn't have any clojure jar at all

richiardiandrea22:06:28

removing "provided" solves

micha22:06:01

if you remove the clojure depdnency from your :dependencies you should not see a clojure jar in the file, is that the case?

richiardiandrea22:06:42

no, for some reason I see 1.7.0

micha22:06:08

are you using a build.boot file?

richiardiandrea22:06:45

but BOOT_CLOJURE_VERSION=1.8.0

richiardiandrea22:06:10

ok, in this project I also import ['boot/core 2.6.0 :scope "test"]

richiardiandrea22:06:44

because I am using it when I develop (no prod stuff) but still all the transitive deps should be trimmed out..

richiardiandrea22:06:45

so the situation is the following: no explicit clojure, when I add [com.apa512/rethinkdb "0.15.23"], it takes clojure 1.7.0

richiardiandrea22:06:34

without both it defaults to 1.8.0

richiardiandrea22:06:12

commenting out all the ring libraries and rethinkdb defaults to 1.5.1 I am seeing weird things here lol

micha22:06:31

it's not doing the exclusions for some reason

micha22:06:40

show -d will show where it's coming

micha22:06:44

i see the problem

richiardiandrea22:06:31

what happened? I really don't see anything wrong in show -d

richiardiandrea22:06:05

ah ah, with [faker "0.2.2" :scope "test" :scope "test"] I default to clojure 1.2.0 😄

micha22:06:36

ok i got it now

micha22:06:53

ok updated

richiardiandrea22:06:41

trying, one thing, of course I am not sure of how it works, but maybe you can add a safety net (partial pod/apply-global-exclusions (or exclusions #{}) ?

micha22:06:57

it should work with nil there

micha22:06:08

does it not?

richiardiandrea22:06:41

no wait, haven't tried and you know the code better then me lol

richiardiandrea22:06:16

ok so it looks like it is doing the right thing

richiardiandrea22:06:36

no clojure if I remove the explicit dep and I keep :exclusions

richiardiandrea22:06:51

default to the first clojure found if I remove the :exclusions

micha22:06:16

and if you add a direct clojure dependency it wil use that

richiardiandrea22:06:44

double checking with a couple of versions now

richiardiandrea22:06:00

yes @micha everything looks good

richiardiandrea22:06:08

time boot with-cp -w; drip -cp src/backend:env/dev/src:src/common:env/dev/resources:$(cat cp) clojure.main
real	0m3.786s
user	0m0.061s
sys	0m0.033s
Clojure 1.8.0
user=>

richiardiandrea23:06:10

drip lanuches instantaneusly

richiardiandrea23:06:24

the time spent is basically classpath math 😄

micha23:06:49

did you compare to a boot task that just launches clojure.main?

micha23:06:00

nrepl takes like 4 seconds to compile itself

micha23:06:04

and get ready

richiardiandrea23:06:22

not comparable for sure, that's why I guess Rich is using this way 😉

micha23:06:00

how much faster is the clojure.main repl with drip than with java?

richiardiandrea23:06:45

difficult to say because repl is blocking, how can I measure? maybe I can C-c very quickly 😄

micha23:06:29

you could do echo '(System/exit 0)' |java -cp ... clojure.main

richiardiandrea23:06:46

oh let me try that

micha23:06:48

and the same for drip

micha23:06:42

echo '(System/exit 0)' |time java -cp ... clojure.main

richiardiandrea23:06:26

uhm the pipe does not seem to work with drip

richiardiandrea23:06:34

it does with java

micha23:06:22

what time did you get?

richiardiandrea23:06:30

the output is weird let me check again

richiardiandrea23:06:22

2.59user 0.10system 0:01.19elapsed 226%CPU (0avgtext+0avgdata 137368maxresident)k
0inputs+0outputs (0major+13227minor)pagefaults 0swaps

micha23:06:05

looks to be faster than drip, actually?

richiardiandrea23:06:28

no but this does not include with-cp

richiardiandrea23:06:59

i'll make a simple script

micha23:06:01

you should be able to do like

micha23:06:28

echo '(System/exit 0)' |time java -cp $(cat cp) clojure.main

micha23:06:36

actually i will try here

micha23:06:47

i actually have my own computer, too

richiardiandrea23:06:50

Clojure 1.8.0
user=> 
real	0m4.909s
user	0m8.643s
sys	0m0.356s

richiardiandrea23:06:02

#!/bin/bash
boot with-cp -w; echo '(System/exit 0)' | java -cp src/backend:env/dev/src:src/common:env/dev/resources:$(cat cp) clojure.main

micha23:06:56

i get pretty fast times here:

micha23:06:59

barp $ time (echo '(System/exit 0)' |java -cp $(cat foop) clojure.main)
Clojure 1.8.0
user=> 
real    0m1.188s
user    0m2.164s
sys     0m0.084s

richiardiandrea23:06:13

yeah man, my machine is old 😄

richiardiandrea23:06:32

funny that drip locks

richiardiandrea23:06:41

but it feels faster

micha23:06:10

using -cp instead of resolving dependencies dynamically via aether is definitely faster

micha23:06:19

in either case

richiardiandrea23:06:16

but you need then to use socket repl

richiardiandrea23:06:41

and no editor supports it at the moment

richiardiandrea23:06:38

I am trying exactly that

richiardiandrea23:06:55

if you open a buffer with a shell with a repl

richiardiandrea23:06:11

change the name of the inf-clojure-buffer

richiardiandrea23:06:18

then you can eval in there