Fork me on GitHub
#boot
<
2016-04-06
>
malcolmsparks11:04:52

wow, .boot/cache was consuming >10Gb of my precious SSD!

malcolmsparks11:04:18

I don't think I've ever cleared it down

malcolmsparks11:04:56

Now I've deleted the cache, boot is /so/ much faster

micha12:04:30

@malcolmsparks hmm might be time to implement garbage collection in the cache

micha12:04:53

i wonder why it was slow though

micha12:04:31

it should be a key value store, so it shouldn't be scanning the entire cache ever

dominicm12:04:32

@micha: Filesystems are really strange. They do things like cache directories as you make accesses. I ran into a bug with this the other day. It's very possible that the kernel cache is trying to load a bunch of the directory into memory or something.

dominicm12:04:42

Or it might be something obvious.

tabrez13:04:07

What does this warning mean: Warning: version conflict detected: org.clojure/clojure version changes from 1.6.0 to 1.8.0

dominicm13:04:02

It means that your dependencies probably aren't quite right, as the clojure version is changing.

dominicm13:04:06

If clojure isn't first in your list of dependencies, I think you need to move it there. You also need to make sure you're including clojure as a dependency. People forget that often.

tabrez13:04:01

This is the first dependency in build.boot: [org.clojure/clojure "1.8.0" :scope "test"]

tabrez13:04:36

I'm also getting similar warnings for joda-time and clj-time, I'm not even using them anywhere.

adamfrey13:04:24

@tabrez do you have a dependency that uses clojure 1.6 in your profile.boot file? That would get added before build.boot

tabrez13:04:12

@adamfrey: I'll try to use a fresh one and see if the warning goes away.

tabrez13:04:20

@adamfrey: You were right, I have commented everything in profile.boot and all three warnings are gone. Thanks!

adamfrey13:04:55

@tabrez, also if you want to keep the stuff in your profile.boot but avoid the warning you can find which library depends on 1.6, and add [… :exclusions [org.clojure/clojure]] to the dependency vector

tabrez13:04:30

@adamfrey: I see, I'll go through every line one by one.

adamfrey13:04:10

@tabrez: also helpful is boot show -d which will give you a dependency tree

tabrez13:04:37

@adamfrey: Ah nice. It shows me that in my current project, Ring depends on joda-time and clj-time. And I thought I'm not using them. haha

tabrez13:04:23

Is this correct syntax to specify compiler options in boot? (cljs :compiler-options {:output-to "target/dev/main.js"})

tabrez13:04:46

There's no target/dev/main.js generated as a result.

tabrez13:04:10

And I'm getting this warning: WARNING: Replacing ClojureScript compiler option :output-to with automatically set value.

martinklepsch13:04:29

@tabrez: in boot-cljs you usually don't use output-to output-dir etc. Instead you specify the location where you want the compiled file to be by placing a $name.cljs.edn file in your classpath

martinklepsch13:04:51

an example could be resources/public/js/app.cljs.edn

martinklepsch13:04:36

read this for some more details on cljs.edn files:

tabrez13:04:30

@martinklepsch: Alright, will try it that way, thanks.

alandipert14:04:24

@micha: how about a boot gc task

tabrez14:04:52

I have created an EDN file here: src/cljs/out/main.cljs.edn with the following contents: { :init-fns [jslib-tests.client/init] }. Boot says it's compiling the js file but it's not on the disk: Compiling ClojureScript... • out/main.js

tabrez14:04:30

I have tried to put the same EDN file at resources/public/js also but no main.js on the disk after compilation.

martinklepsch14:04:57

@tabrez: have you modified BOOT_EMIT_TARGET?

micha14:04:09

@alandipert: yeah we will probably need that, it would be good to understand the performance issue too, to make the GC more effective

tabrez14:04:40

@martinklepsch: Yes, boot.properties has this: BOOT_EMIT_TARGET=no. And build.boot has this: (target :dir #{"target/dev"}).

martinklepsch14:04:22

@tabrez: so in target/dev there should be cljs/out/main.js

tabrez14:04:29

@martinklepsch: my entire resources path is being copied to target/dev and there's nothing else in that directory.

tabrez14:04:40

I have this in build.boot: :resource-paths #{"resources/public"}

tabrez14:04:55

tree resources/public and tree target/dev are exactly the same.

tabrez14:04:46

The application itself is running fine.

alandipert14:04:47

micha: yeah. maybe we want boot doctor --gc and just start with reclaiming disk. then later we can add cool things for getting diagnostics and fixing other things

micha14:04:05

oh that's a good idea, totally

leontalbot16:04:11

Hi folks! I'm building a cljsjs package. How to I find the checksum of a js library?

martinklepsch16:04:46

do you have shasum installed?

martinklepsch16:04:25

basically just shasum -a 256 $file (I think cljsjs checks for sha256)

leontalbot16:04:12

Something like shasum -a 256 /Users/leontalbot/Downloads/tabletop-1.4.3.zip ?

leontalbot16:04:41

that gives me a checksum longer than some other cljsjs packages I find... still ok?

leontalbot16:04:15

:checksum a84abb1ad9c31d77620efef22e10eb7d1e26f6e6685f8297798e23a74c6e4279

martinklepsch16:04:18

@leontalbot: you'll need to shasum the js file you're trying to package

leontalbot18:04:20

hello boot! I've send a pull request to cljsjs but get a mistake

leontalbot18:04:18

anyone has an idea what I should do?

adamfrey18:04:53

@martinklepsch @juhoteperi have there been any discussions about boot-reload and figwheel.client since this: https://github.com/adzerk-oss/boot-reload/issues/40 ? What is the current consensus?

martinklepsch18:04:19

@adamfrey: no real decision made. I'm not yet convinced myself

martinklepsch18:04:55

@adamfrey: if you have more thoughts probably best to add to the issue

martinklepsch18:04:01

Things get lost here :)

adamfrey18:04:34

True. I ran into the namespace reloading problem today. It makes devcards much less useful. I change the source component in one namespace, but the page doesn’t upload because the devcard is in a different dependent namespace

juhoteperi18:04:36

@adamfrey: We probably talked about it here, but probably nothing too important.

juhoteperi18:04:00

I still want to try it but I am still busy with other stuff

juhoteperi18:04:46

@richiardiandrea: Looks like you need to do somethin with the new PR as Github is confused again 😕

richiardiandrea18:04:23

@juhoteperi: yes I am going to in a few mins, this time I guess GH is right, I need to rebase on master

richiardiandrea18:04:17

now it should be ok

richiardiandrea18:04:56

Another addition, if somebody needs it, is a task that moves files with a given metadata keywork to some folder:

(core/deftask rebase
  "A task for moving fileset from one dir to another"
  [w with-meta KEY  #{kw}  "The set of metadata keys files must have for being rebased."
   p path      PATH str    "The destination path to rebase the filtered fileset into."
   v invert         bool   "Invert the sense of with-meta."]

  (core/with-pre-wrap fileset
    (let [files (filter-tmpfiles (core/ls fileset) with-meta invert)
          paths (map (juxt :path #(str (normalize-path path) (:path %))) files)]
      (core/commit! (reduce (fn [acc [from-path to-path]]
                              (merge acc (core/mv acc from-path to-path))) fileset paths)))))

richiardiandrea19:04:45

in boot is there a way to resolve transitive dependencies of a vector item in :dependencies in the env?

richiardiandrea19:04:01

Ok I found pod/resolve-dependencies

phreed19:04:25

Any ideas what the equivalent of Leiningen's :headless would be? Is it the same as 'boot --server'?

currentoor20:04:44

I tried the above but the assets are still not in public. Any suggestions?

richiardiandrea20:04:35

I use another approach, see rebase up there, and the code

currentoor20:04:32

@richiardiandrea: but I need to move it from a jar to a directory.

richiardiandrea20:04:41

yes sorry I missed one part

richiardiandrea20:04:31

(comp
     (built-in/sift :add-meta {#".*" ::initial-fileset})
     (built-in/sift :add-jar (...))
     (rebase :path dest-dir :with-meta #{::initial-fileset} :invert true)
     )

richiardiandrea20:04:55

so I add meta, then with the above rebase I move them, I can paste a gist for you with that

phreed20:04:39

@richiardiandrea: when I use 'boot repl -s' it shuts down pretty quickly.

cork21:04:18

Hey all, I am feeling a bit lost trying to deploy my first boot project to beanstalk. This is also the first time I have tried to use Docker so that may just be adding extra confusion to the process. I can find plenty of info for leiningen deployment, but need a little guidance for boot. Can someone recommend some literature for getting a simple project hosted - with or without Docker - to any web deployment service?

micha21:04:40

we use the AWS eb tool to do the deployment to beanstalk

micha21:04:08

there is a boot docker image on dockerhub, so you can use that if you like

micha21:04:24

in your Dockerfile you can set the entry point to be boot

micha21:04:44

you just need to make a Dockerrun.aws.json file

cork22:04:15

@micha Great, thanks for the info! I found a lot more info on ASW site for Dockerrun.aws.json config to get me going simple_smile

micha22:04:56

@cork awesome, check out the eb tool also, it's pretty good for deploying

cork22:04:17

Yeah that seems to make deployment easier. I just need to play with Docker more. Do I need both a Dockerfile and Dockerrun.aws.json?

phreed22:04:20

When I look at the classpath in 'lein repl' and 'boot repl' they are quite different (the lein-classpath is much larger). (use 'clojure.pprint) (-> (java.lang.ClassLoader/getSystemClassLoader) .getURLs seq pprint) Is there something I can read to understand why this is so?

micha22:04:52

@cork: usually you do, yes. you don't need the Dockerfile if the container you want to deploy is on dockerhub, but of course we need to keep that private in my shop

micha22:04:57

@phreed: what kind of things do you see in the lein one that aren't in the boot one, and vice versa?

micha22:04:14

i think leiningen puts everything on the "bootclasspath"

phreed22:04:16

For boot I only see (#object[java.net.URL 0x60def500 "file:/usr/local/bin/boot"] #object[java.net.URL 0x103414e3 "file:/home/fred/.boot/cache/bin/2.5.5/boot.jar"])

micha22:04:23

for the second JVM it starts

micha22:04:37

which would be the system classloader

micha22:04:47

you can check that by looking at the command line it uses

micha22:04:54

ps -Af |grep lein

micha22:04:03

you'll probably see a lot of stuff in there

micha22:04:21

a better test would be to look at the thread context classloader

micha22:04:40

(-> (Thread/currentThread) getContextClassloader)

micha22:04:45

and see the URLs in there

sonnyto22:04:52

I am trying to install the cljsjs packages locally using directions at https://github.com/cljsjs/packages/wiki/Creating-Packages

sonnyto22:04:00

however I'm getting these errors

sonnyto22:04:11

sto@shiva:~/workspace/tmp/packages/react$ boot package install target Downloading react-15.0.0-rc.2.js clojure.lang.ExceptionInfo: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1) data: {:file "/tmp/boot.user459489466208074370.clj", :line 37} java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1) clojure.lang.Compiler$CompilerException: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1) java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap

sonnyto22:04:18

I cannot install any of the packages

sonnyto22:04:26

same error messages

sonnyto22:04:36

anyone know why?

micha22:04:03

@sonnyto: can you do boot show -p and look at the dependency conflicts?

sonnyto22:04:26

sto@shiva:~/workspace/tmp/packages/react$ boot show -p Implicit target dir is deprecated, please use the target task instead. Set BOOT_EMIT_TARGET=no to disable implicit target dir. sto@shiva:~/workspace/tmp/packages/react$

micha22:04:26

http client errors are usually caused by dependency issues

sonnyto22:04:28

nothing useful

sonnyto22:04:39

the only dependency in that build is

micha22:04:46

no clj-http dependency?

sonnyto22:04:50

(set-env! :resource-paths #{"resources"} :dependencies '[[cljsjs/boot-cljsjs "0.5.0" :scope "test"]])

micha22:04:07

how is clj-http getting involved?

sonnyto22:04:31

maybe indirectly via [[cljsjs/boot-cljsjs "0.5.0" :scope "test"]]

sonnyto22:04:41

this is part of the cljsjs project.

micha22:04:53

ah that's possible, maybe in a pod

phreed23:04:47

@micha: To be more clear the reloader of https://github.com/clojure/tools.namespace is not working the way I expect. I belive it uses the classpath to identify the dependency DAG.

micha23:04:50

@phreed: ah there is a wiki page with a fix for that

sonnyto23:04:29

@micha: adding [clj-http "2.1.0"] to the dependency fixed it. wierd. how do people build cljsjs packages without that dependency?

micha23:04:17

@sonnyto: i think the dependency was there (in a worker pod)

sonnyto23:04:28

it got removed?

micha23:04:32

what you did there was fix it to a version that works better

micha23:04:48

no it was there, you can see that clojure was compiling clj_http.clj

micha23:04:57

so the dependency must have been there

micha23:04:09

but not in the main pod, in a pod created by one of the tasks you were using

micha23:04:27

so the show -d and show -p wouldn't show you the dependencies in the pod

micha23:04:38

(although there is a way to do that, too)

micha23:04:01

so when you added your clj-http dependency that just overrides the one in that the task was using to create the pod

sonnyto23:04:29

thanks for the explanation

micha23:04:39

because tasks that create pods usually merge in the main environment dependencies with the dependencies of the new pod when they create it

sonnyto23:04:54

so the pod maintainer has to fix this?

micha23:04:13

one of the tasks was creating the pod

micha23:04:31

pods are like separate, isoloated clojure runtimes

micha23:04:43

tasks use those to load their own dependencies

juhoteperi23:04:52

@sonnyto: Already fixed, use boot-cljsjs 0.5.1

juhoteperi23:04:30

All cljsjs packages are now updated to use new version

sonnyto23:04:46

actually its not working.... same error

sonnyto23:04:01

and it has boot-cljsjs 0.5.1

juhoteperi23:04:54

Strange, it is working fine for me.

sonnyto23:04:27

im deleting my ~/.m2 dir to see if it makes a differences

juhoteperi23:04:50

Also, check boot version

sonnyto23:04:36

sto@obi:~/workspace/tmp/packages/material$ boot --version #http://boot-clj.com #Wed Apr 06 18:19:26 COT 2016 BOOT_CLOJURE_NAME=org.clojure/clojure BOOT_CLOJURE_VERSION=1.8.0 BOOT_VERSION=2.5.5

sonnyto23:04:47

deleting ~/.m2 didnt help

juhoteperi23:04:55

Hmm check with Clojure 1.7.0

sonnyto23:04:12

ng tools.reader-0.8.10.jar from https://repo1.maven.org/maven2/ clojure.lang.ExceptionInfo: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1) data: {:file "/tmp/boot.user12626021233355995.clj", :line 33} java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1) clojure.lang.Compiler$CompilerException: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1) java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap

sonnyto23:04:19

ok let me try with clojure 1.7

sonnyto23:04:07

that was it!

sonnyto23:04:35

any idea why it wouldnt work with clojure 1.8?

sonnyto23:04:33

adding [clj-http "2.1.0"] as a dependency works with 1.8

juhoteperi23:04:34

Quite strange if it works with the came clj-http direct dep but not with one from pod

sonnyto23:04:17

ok thanks. i just need it to build.