This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-21
Channels
- # aleph (5)
- # aws (3)
- # bangalore-clj (1)
- # beginners (8)
- # boot (198)
- # cider (4)
- # cljsjs (5)
- # cljsrn (2)
- # clojure (14)
- # clojure-argentina (1)
- # clojure-dusseldorf (8)
- # clojure-greece (29)
- # clojure-italy (10)
- # clojure-japan (1)
- # clojure-poland (4)
- # clojure-russia (8)
- # clojure-spec (51)
- # clojure-uk (8)
- # clojurescript (97)
- # cursive (4)
- # datomic (6)
- # emacs (2)
- # events (2)
- # figwheel (3)
- # hoplon (32)
- # lein-figwheel (5)
- # leiningen (1)
- # luminus (2)
- # off-topic (29)
- # om (109)
- # other-languages (38)
- # proton (3)
- # re-frame (3)
- # ring (1)
- # slack-help (10)
- # testing (1)
- # uncomplicate (1)
- # untangled (21)
- # vim (10)
- # yada (11)
Right, I confused things. I wanted to find artifacts of ClojureScript compilation, so had to resort to by-re
@anmonteiro I think in theory cljs compilation artifacts should be available on the classpath as well https://github.com/adzerk-oss/boot-cljs/blob/master/src/adzerk/boot_cljs.clj#L238
hrm weird, didn’t work for me but could probably be unrelated
I’ve got it working now anyway, that’s what matters 🙂
can anyone help me with a Windows issue?
trying to run a command via boot.util/dosh
but it doesn’t work
clojure.lang.ExceptionInfo: Cannot run program "yarn": CreateProcess error=2, The system cannot find the file specified
data: {:file
"C:\\Users\\IEUser\\AppData\\Local\\Temp\\boot.user4802722906876953601.clj",
:line 43}
java.io.IOException: Cannot run program "yarn": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
...
boot.from.me.raynes.conch/proc conch.clj: 40
...
clojure.core/apply/invokeStatic core.clj: 657
clojure.core/apply core.clj: 652
boot.util/sh util.clj: 389
...
clojure.core/apply/invokeStatic core.clj: 657
clojure.core/apply core.clj: 652
boot.util/dosh util.clj: 400
...
boot.user/eval845/fn/fn/fn boot.user4802722906876953601.clj: 19
boot.core/run-tasks core.clj: 938
boot.core/boot/fn core.clj: 948
clojure.core/binding-conveyor-fn/fn core.clj: 2020
...
yarn
is definitely there, also error with cp
for example
what does the call to dosh look like?
@alandipert (dosh "yarn" "install")
works on linux & mac
maybe try fully-qualifying the path to yarn?
@alandipert no dice
this also fails:
boot.user=> (require ’[clojure.java.shell :as sh])
nil
boot.user=> (sh/sh "cp" "build.boot" "x.boot")
IOException CreateProcess error=2, The system cannot find the file specified java.lang.ProcessImpl.create (ProcessImp
java:-2)
OK progress:
(u/sh "cmd" "/c" "copy" "build.boot" "x.boot")
Just out of curiosity how do people here use boot-cljs, boot-reload and boot-cljs-repl with multiple cljs builds?
It seems I need to restart boot to switch to a certain build and then the repl. I see a lot of tickets in boot reload with would-be-fixed-with-figwheel-client
and I checked out boot-figwheel
but that seems to just write to a target folder which seems like a big hack
Oh I see @richiardiandrea is doing some very good work on this part
@mitchelkuijpers I think you're supposed to create a .cljs.edn
per build?
@dominicm Yeah I know how boot-cljs works we have 3 builds, but the problem is in dev recompiling only one cljs file and switching the cljs-repl
Which figwheel solves very elegantly
And reload always recompiles all 3 builds
@mitchelkuijpers how does it solve it, out of interest?
in the figwheel cljs-repl
you can do (switch-to-build :main)
these docs seems wrong: https://www.dropbox.com/s/pq7v9hrxgo7yrbj/Screenshot%202016-10-21%2018.13.13.png?dl=0
@mitchelkuijpers I’m actually just finding out how to use devcards next to a ‘normal’ cljs build
If you need help let me know @borkdude
well, the road I’m going down now is to make a separate build for devcards, because I’m not sure how to merge it within the normal build
is there a shorter way to write this:
(fn [next-task]
(fn [fileset]
(set-env!
:source-paths #(conj % "src-cljs-devcards"))
(next-task fileset)))
@mitchelkuijpers I am trying yes, I'll keep the chan posted ;)
@borkdude there is with-pass-thru
(with-pass-thru _
(set-env! ...))
@anmonteiro I thought I read about that one, but where is that documented? Couldn’t find it
I don’t know 🙂
just laying down what I’ve been absorbing over time
FWIW, this normally works when setting env for me:
(deftask foo []
(set-env! …)
identity)
though now that I think about it it’s probably evaluated when composing tasks and not when executing them
but for my purposes it has been working OK
@anmonteiro that shouldn't work, because tasks need to return middleware
@micha oh right I forgot I return identity
from the task 🙂
fixing the snippet
I eventually just made a defn that return the piece of code I wrote above and use that as a task.. but I reverted back to one build anyway
@micha thanks. I googled for 'clojure boot with pass through’ (I heard about it) and read this entire page, but couldn’t find it there: https://github.com/boot-clj/boot/wiki/Tasks
@borkdude https://github.com/boot-clj/boot/blob/master/doc/boot.core.md#define-tasks
there you go!
I still think these docs are incorrect though: https://github.com/boot-clj/boot/wiki/Tasks#the-null-task
looks OK to me
yeah, both return a function that returns its argument
so identity
@borkdude would it help if written like this?
(fn [next-task]
#(next-task %))
I’m starting to look at this. My particular application is going to be mostly about building Docker images, so I need to merge together some files from the file system and maybe some artifacts from Maven.
I understand the middleware concept, but I’m having trouble getting started with the whole filesystem thing.
Like, I guess I should a new tmpdir and copy files into it, commit!, then run Docker in a subshell.
Ok, what would this look like. Combine a folder that contains Dockerfile and a couple of other files. Add in a Maven artifact w/ transitive dependencies. Shell out to Docker to run a docker command on that directory.
Later complications: may treat many of the input files as template, want to edit them while copying them into final position.
where there is mutation going on in a place that is hidden from the rest of the program
it can populate the temp dirs from tthe fileset value it receives from the task that called it
so suppose you have some process that expects files in the filesystem in certain places
this can easily cause issues if you have many of these kinds of processes that all want to own the same filesystem
(deftask foo []
(let [tmp (tmp-dir!)]
(with-pre-wrap [fileset]
(doit :output-dir (.getPath tmp))
(-> fileset (add-resource tmp) commit!))))
So maybe I want to build a pipeline where I do a couple of steps: move the simple files to the output dir, move the editted files to the output dir, move the Maven artifacts to the output dir, then run Docker on that output dir … what does that look like?
So our primary build will install them locally or to a remote repo, and now building the tooling that grabs them and builds the image around them.
I’ve had this situation where it was desirable to have the dependencies in the image, because on the cloud CI it would take very long to download them every time
I’d like to avoid that option and do the build first. We tend to keep versions stable and note our Git tag or hash, want reproducable builds.
Yes, when did this kind of thing on AWS it was better to build it into the Docker image as much as possible; though less urgent when we were running a private Docker hub inside AWS as well.
Even if it isn’t Maven artifacts, we are putting together files from a few different places and passing them though a bit of editting in flight.
I kind of imagine (deftask create-query-service-image [] (comp (docker-template :dir “query-service”) (with-artifacts :artifacts [[io.aviso/rook “0.2.1”]]) (build-docker-image “com.walmartlabs/query-service:1.4.7”)))
Is this a meta-data kind of thing? Feels like docker-template
would create a temp directory and some of the other tasks would need to know what it is to move additional files there, before build-docker-image does its magic.
think I’m getting there conceptually, I just don’t get what starts inside the fileset exactly
so my query-service folder would not be part of the fileset until docker-template
executed, and it would add it to the fileset.
it's an immutable value that represents the state of the filesystem at an instant in time
you can make the actual filesystem state correspond to a fileset value by doing (commit! fileset)
in git the actual information is stored in an immutable, content-addressed blob storage area
and the working set of files is constructed from the information in the tree and the blobs
So I could start by loading the contents of the query-service directory into the fileset
after commit! I can get a reference to a file system directory which will have the files (as hard links) but I can run docker there.
In this case, docker will just be reading those files and not updating the file system
In a worst case, I can run docker and pass it a tar stream of the content to create as an image