This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-14
Channels
- # admin-announcements (17)
- # announcements (4)
- # beginners (47)
- # boot (347)
- # braid-chat (55)
- # bristol-clojurians (5)
- # cider (5)
- # cljs-dev (1)
- # clojure (111)
- # clojure-chicago (1)
- # clojure-russia (73)
- # clojure-ukraine (2)
- # clojurescript (162)
- # code-reviews (1)
- # community-development (199)
- # core-matrix (2)
- # cursive (29)
- # datomic (40)
- # devcards (13)
- # dirac (37)
- # docs (12)
- # editors-rus (2)
- # emacs (11)
- # events (26)
- # hoplon (2)
- # jobs (8)
- # ldnclj (31)
- # lein-figwheel (2)
- # off-topic (7)
- # om (59)
- # other-lisps (1)
- # portland-or (1)
- # proton (50)
- # re-frame (5)
- # reagent (13)
- # ring-swagger (5)
- # spacemacs (3)
- # yada (3)
I get a weird error whenever I call something inside a pod:
java.util.concurrent.ExecutionException: java.lang.RuntimeException: No reader function for tag object
java.lang.RuntimeException: No reader function for tag object
...
clojure.core/read-string core.clj: 3497
boot.pod/call-in* pod.clj: 313
what can be?
that's because either the expression you're passing to the pod, or the value returned by the pod, is not printable by clojure's pr-str
(pod/with-call-in @pod
(clj-jgit.porcelain/git-clone-full uri tmp remote branch))
...
Maybe the params?
(println
(pod/with-call-in @pod
(pr-str (clj-jgit.porcelain/git-clone-full ~uri ~tmp ~remote ~branch))))
will do, thanks @micha
yes they are, I am printing all of them
actually the return of (core/tmp-dir!)
might be not
found the problem 😄
mutable is always a problem 😄
but the pod
idea is very cool, and indeed boot is faster on this machine then lein
while working on Counterclockwise I wished I had this kind of isolation
no, but contributed big chunks
Laurent Petit is the current maintainer, unfortunately things got a bit slow there, but it was my first clojure project
to learn learn learn 😄
it used to be a real mission just to get a clojure environment going where you could start learning
yes true that, and I remember Laurent had troubles setting the classpath when building, it kind of added part of the lein api in order to do that if I am not wrong
with boot, it would be a breeze, create a pod and you are done 😄
So add-source
can just add dirs right? what about adding individual java.io.File?
oh I can use cp
maybe
@asolovyov: hi! good to see you again!
but now this doesn't help, when I add clojurescript, riemann/send-event dies with
Class com.google.protobuf.UnmodifiableLazyStringList does not implement the requested interface com.google.protobuf.ProtocolStringList
even in case of dependencies like this:
[[riemann-clojure-client "0.4.1"]
[org.clojure/clojurescript "1.7.228"
:exclusions [com.google.protobuf/protobuf-java]]
[com.google.protobuf/protobuf-java "2.6.1"]]
> boot show -p
[!] org.clojure/clojure
:heavy_check_mark: 1.7.0
org.clojure/clojurescript
✘ 1.3.0-beta1
riemann-clojure-client
@asolovyov: you should see protobuf there
#!/usr/bin/env boot
(set-env! :dependencies '[[riemann-clojure-client "0.4.1"]
[org.clojure/clojurescript "1.7.228"]])
if you don't see protobuf in the show -p
output then that must mean that there is no conflict
> boot show -d
[org.clojure/clojurescript "1.7.228"]
├── [com.google.javascript/closure-compiler "v20151216"]
├── [org.clojure/clojure "1.7.0"]
├── [org.clojure/data.json "0.2.6"]
├── [org.clojure/google-closure-library "0.0-20151016-61277aea"]
│ └── [org.clojure/google-closure-library-third-party "0.0-20151016-61277aea"]
├── [org.clojure/tools.reader "1.0.0-alpha1"]
└── [org.mozilla/rhino "1.7R5"]
[riemann-clojure-client "0.4.1"]
├── [com.aphyr/riemann-java-client "0.4.0"]
│ ├── [com.google.protobuf/protobuf-java "2.6.1"]
│ ├── [io.netty/netty "3.6.1.Final"]
│ └── [org.slf4j/slf4j-api "1.6.4"]
├── [less-awful-ssl "1.0.0"]
└── [org.clojure/tools.logging "0.2.3"]
^^^Hello folks. I'm running my make-war
task it does all the steps, and then stops to Writing project.war...
The file is not created. Here is the task ^^^
Do you guys have an idea what to do?
@asolovyov: ok how about this, just for kicks
and look for suspicious protobuf classes that were accidentally packaged in the cljs jar
@leontalbot: do you have BOOT_EMIT_TARGET
set to no
? if so you might need the target
task at the end of your pipeline
ETA-INF
└── maven
├── args4j
│ └── args4j
│ ├── pom.properties
│ └── pom.xml
├── com.google.guava
│ └── guava
│ ├── pom.properties
│ └── pom.xml
├── com.google.javascript
│ ├── closure-compiler
│ │ ├── pom.properties
│ │ └── pom.xml
│ └── closure-compiler-externs
│ ├── pom.properties
│ └── pom.xml
├── com.google.protobuf
│ └── protobuf-java
│ ├── pom.properties
│ └── pom.xml
└── org.clojure
├── clojure
│ ├── pom.properties
│ └── pom.xml
├── clojurescript
│ ├── pom.properties
│ └── pom.xml
├── data.json
│ ├── pom.properties
│ └── pom.xml
├── google-closure-library
│ ├── pom.properties
│ └── pom.xml
├── google-closure-library-third-party
│ ├── pom.properties
│ └── pom.xml
└── tools.reader
├── pom.properties
└── pom.xml
although it's possible that the protobuf library looks on the classpath for its own pom
@alandipert right! Thanks! Would you mind pointing out a target task example? (what to add to the pipeline?)
@asolovyov: i suppose it could be in google closure too
so you can work around it @asolovyov
(deftask make-war
"Build a war for deployment"
[]
(comp (hoplon)
(cljs :optimizations :advanced)
(uber :as-jars true)
(web :serve 'vpc-hoplon.handler/app)
(war)
(target :dirs #{"target"})))
but I wonder if I need to report this to closure-compiler team or maybe to @dnolen so that it's fixed...
@alandipert: Thanks! I get a warning when launching the task target: unknown option(s): :dirs
normal?
@asolovyov: actually wait!
oh wait, I actually build a bit of stuff by hand in my sources and require clojurescript, because I really wanted figwheel 😄
what I did is downgraded cljs, and then tomorrow I'll try to restructure stuff nicely
@leontalbot: oops that should be :dir
Thanks!
Other question, I've retarted my terminal then hit boot dev
again and then get
{HTTP/1.1}{0.0.0.0:5000}
clojure.lang.ExceptionInfo: java.net.BindException: Address already in use, compiling:(NO_SOURCE_FILE:0:0)
data: {:file
"/var/folders/gg/531kld4x2hq3lf_zl94gqfch0000gn/T/boot.user1954107233247231132.clj",
:line 17}
Any ideas?
@leontalbot: you may have another instance of boot already running
no terminal relaunched
leontalbot 4065 172,4 1,9 4865880 159196 ?? R Lun02 1643:32.27 /usr/bin/java -Dboot.app.path=/usr/local/bin/boot -jar /usr/local/bin/boot dev
leontalbot 17036 0,0 5,9 4873896 492420 ?? S 10:05 2:06.92 /usr/bin/java -Dboot.app.path=/usr/local/bin/boot -jar /usr/local/bin/boot dev
leontalbot 17197 0,0 0,0 2432784 596 s000 S+ 10:21 0:00.00 grep java
how so?
how I do it?
Great! Thanks!! Anything I could add to build.boot to prevent this?
ah ok...
Thank you!!
CLTR-C
Should boot.core/reset-fileset
strip metadata? It does in 2.5.5 but not in 2.4.2 - the change seems to be at the 2.4.2 -> 2.5.0 transition.
Checked by changing BOOT_VERSION with a task along the lines of:
(defn x
[]
(fn [nt]
(fn [fs]
(prn :x (meta fs))
(prn :y (meta (boot.core/reset-fileset fs)))
(nt fs))))
(alter-var-root #'boot.core/reset-fileset
(fn [orig]
(fn [fs]
(with-meta (orig fs) (meta fs)))))
@cursork: if you don't want to have that in the build.boot you can put it in a profile.boot file in the project dir
Thanks. I think we’ll be OK in the build.boot. It’s got a nice explaining comment next to it, so we’ll be fine.
N.B. reset-fileset actually has an args definition of [& [fs]] - I had to tweak the above alter-var-root slightly to accommodate (for anyone else who might stumble on the above)
I don’t know when they’ll re-gen http://clojure.org from the repo, but Boot will be on the Getting Started page when they do!
Guys what sound format do speak
accept?
@richiardiandrea: It's using Javazoom JLayer which seems to support just MP3
Is your test
task in build.boot
or in some namespace? If it's in namespace, you can define (:refer-clojure :exclude [test])
in ns form
in build.boot
, nothing important, just wanted to understand if you can in some way :refer-clojure
in there
Hmm, I don't think so
I think the usual workaround is to name test task something different, I've been using run-tests
yes in my own ns it would have been easier
Though even if it is in it's own ns, you get warning when you refer it in build.boot
yes np will change the name because it clashed with the help when you call -h
a way would be to suppress this warnings from the compiler options, I do it in replumb
but I guess it is not worth it, let's keep it in mind if somebody else really cannot stand it
even in its own ns btw it would clash with boot-test
(if you have gloabl require), I do this at the moment tho:
(deftask auto-test
"Start auto testing mode (dev profile)"
[]
(set-dev!)
(require 'adzerk.boot-test)
(comp (watch)
(speak)
((eval 'adzerk.boot-test/test))))
@richiardiandrea: You could probably use (ns-unmap 'boot.user test)
to remove clojure.core/test: https://github.com/boot-clj/boot/issues/307
right!
lemme try 😄
so (ns-unmap 'boot.user 'test)
works whereas (ns-unmap 'clojure.core 'test)
does not, why?
I am removing the test
symbol and ok, but I expected quite the other way around 😄
(I am pretty unskilled on ns-unmap
and I should probably look into it)
hmm, not sure about this but: in this case the boot.user
ns already exist and the referred vars already exist in it, so removing the var from clojure.core will leave the var in boot.user ns
oh my, I don't want a snippet!
@micha: Boot is listed here http://clojure.org/guides/getting_started now!
when I require in build.boot
I am requiring in boot.user
Great - thanks @seancorfield
Let’s say I want to use the value of a var in my dependencies. I can’t do (set-env! :dependencies ‘[[foo “1.2.3”] [bar bar-ver]])
obviously, but I also can’t do
(set-env! :dependencies `[[foo “1.2.3”] [bar ~bar-ver]])
because Clojure helpfully translates all the bare symbols to their namespaced versions 😞…any thoughts on a better way? Using (vec ‘[foo “1.2.3”] [‘bar bar-ver])
could work, but is annoying to have to quote each item independently.
with syntax quote you can create bare symbols with ~'foo ~'bar
yes but then you might as well just not quote at all and do ['foo "2.3.4"] [bar "4.5.6']
backtick
is exactly for this use case I think
you can use this: (not part of public api, but also probably not going anywhere anytime soon)
(require '[boot.from.backtick :refer [template]])
...
(set-env! :dependencies (template [[foo "1.2.3"] [bar ~bar-version]]))
another newbie question, I am trying to use boot.core/tmp-dir!
in clojure tests but it fails with:
java.lang.IllegalArgumentException: No implementation of method: :-mk! of protocol: #'boot.tmpregistry/ITmpRegistry found for class: nil
it is wrapped in a fixture and the next in the stack trace is:
boot.tmpregistry/mkdir! tmpregistry.clj: 61
...
boot.core/tmp-dir* core.clj: 77
boot.core/tmp-dir** core.clj: 90
...
boot.core/tmp-dir! core.clj: 285
replumb.boot-cljs-src-test/clone-repo boot_cljs_src_test.clj: 12 <- my fixture
so basically I have to include the boot.core
dep in my pod
ok, I basically have to manage that part myself, yes
no problem, it is just to create a tempory dir and emptying it in the tests
thanks for the ready-to-paste line 😄
ok kind of clear 😄
I will just use nio
and the (core/empty-dir! tmp)
that's all I need
thanks for your help as usual 😄
bleah, Java is so ugly:
(defn tmp-dir!
"Create a temp folder and returns its java.nio.file.Path."
[]
(doto
(.toFile (java.nio.file.Files/createTempDirectory nil
(make-array java.nio.file.attribute.FileAttribute 0)))
(.deleteOnExit)))
@richiardiandrea: does .deleteOnExit work for directories?
let me check first
yep it does not remove it
http://stackoverflow.com/questions/24001535/file-deleteonexit-for-non-empty-folders
uglier and uglier
I will delete it in the fixture, no time for hooks and peter pans
tnx for the pointer
seems like putting the temp dir in the env might actually be a good solution when all's said and done
so any dir in set-env!
is cleaned and deleted?
and when?
because at the moment I have control in my fixture :once
(defn clone-repo [f]
(let [tmp (tmp-dir!)
pod (pod-future (boot/get-env) pod-new-env)]
(println "Cloning the repo in" tmp)
(git-clone-in-pod @pod uri (.getAbsolutePath tmp) remote branch)
(f)
(purge-dir! tmp)))
understand, loud and clear 😄
no, it is a fixture (use-fixtures :once clone-repo)
only git-clone-in-pod
runs stuff in a pod
because is the function under test
I pushed here if you are curious: https://github.com/ScalaConsultants/boot-cljs-src
it works smoothly right now but as usual any feedback/improvement is welcome
still WIP 😄
@richiardiandrea: link 404s for me
oh wait a sec 😄
by the way -> the following assert fails (core/get-env)
is nil
-> https://github.com/ScalaConsultants/boot-cljs-src/blob/master/test/replumb/boot_cljs_src_test.clj#L12
so that means that inside boot-test
I don't actually have an env
unless I create my pod
ok it makes sense
great right
can I dump pod deps/classpath?