This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-05
Channels
- # aleph (190)
- # bangalore-clj (4)
- # beginners (31)
- # boot (127)
- # braid-chat (2)
- # cider (2)
- # cljs-dev (79)
- # cljsrn (7)
- # clojure (81)
- # clojure-dev (1)
- # clojure-greece (40)
- # clojure-italy (3)
- # clojure-korea (8)
- # clojure-new-zealand (5)
- # clojure-russia (5)
- # clojure-spec (87)
- # clojure-uk (13)
- # clojurescript (50)
- # cloverage (10)
- # component (4)
- # core-async (37)
- # cursive (26)
- # datascript (20)
- # datomic (29)
- # editors (2)
- # emacs (12)
- # hoplon (63)
- # jobs (2)
- # lein-figwheel (1)
- # leiningen (17)
- # liberator (2)
- # off-topic (19)
- # om (31)
- # onyx (9)
- # pedestal (4)
- # proton (1)
- # re-frame (22)
- # reagent (13)
- # ring (1)
- # ring-swagger (9)
- # spacemacs (5)
- # specter (4)
- # untangled (24)
- # vim (29)
@anmonteiro I know that conch
accepts an :env
key but let me check what dosh
does
you can try if it works
I see the args are passed as is
@richiardiandrea interesting, I didn’t know about conch
I solved it another way but I think it wouldn’t work anyways
yeah that's awesome, boot
includes it
because of (assert (every? string? args))
yes env vars should be strings
yeah, but :env
wouldn’t 😄
ah it's on args
so you should definitely check conch 😉
is there a way to hook into bootcljs's warn so I can put failed clojure.specs there?
@naomarik Yes. Check the code path I showed you yesterday. It's not officially supported, but I think there's potential there to extend what boot-reload can do.
hey guys anyone upgrade to latest os x (sierra)? Break anything?
*has anyone upgraded to latest os x?
cool — sorry I realize I should’ve asked this on #off-topic
@mikebelanger it's on topic here if it breaks boot 🙂
does anyone know of an existing boot task for creating a node CLJS repl instead of a browser CLJS repl?
@micha true! Hopefully it hasn’t done that touches wood
Can someone help me with extracting a particular file from a JAR? I’m looking at the :add-jar
option in sift
, and its asking for a the project symbol to plug into a map with a corresponding regex.
...Do I get this project symbol by requiring it in? I’ve tried this, but it can’t find it. Or what’s the basic process to get a JAR’s symbol name?
@mikebelanger is the JAR from a maven dependency?
so for example, suppose you want to add the clojure jar to your fileset. you'd do that with :add-jar {'org.clojure/clojure #".*"}
the key in the map is the maven group-id and artifact-id, where group-id is the symbol's namespace and artifact-id is the symbol name
@micha yeah, well its in my local maven repo, it’s not on the server-based one, if that makes a difference.
@micha So basically I can grab any jar by plugging the name with the above symbol notation?
@mikebelanger yep, although it may not actually fetch the jar from maven if it's not already in the cache
@micha by cache, do you mean a local machine’s ~/.m2 directory?
@mikebelanger exactly
@micha I’d be willing to open an issue, sure. But I want to make sure I understand, first. I’m developing some externs with cljsjs, and those externs are already in a jar in my cache, in the cljsjs (group-id?). These externs aren’t on clojars, or cljsjs yet, because I’m still working on them.
@micha Are you saying boot may not :add-jar something that’s not already in the cache, but on somewhere like cljsjs/clojars?
@mikebelanger no, the opposite: :add-jar
expects the JAR to be in the local .m2 cache. If it's not :add-jar
may not fetch it from clojars
@micha sorry I threw a lot of negatives in my last sentence, its all good
@micha thanks - I appreciate the heads up on this (potential) limitation. For what I’m doing now, it shouldn’t be an issue — everything is on the local m2 cache. But this is good to keep in mind for future projects. I plan to use boot quite a bit 🙂
@mikebelanger i just tested it, with :add-jar
for a jar not in ~/.m2 cache, and it throws an exception 🙂 so this is a thing that will go on the list of things to do
What's the current blessed way of using npm with boot?
@micha cool thanks for testing 🙂
@micha I guess for now, a workaround would be moving that jar into ~/.m2? That’s how I’ve been asking people to play with my project 😛
@mikebelanger yes you can do a local install: boot install -f foo-1.2.3.jar -p pom.xml
that will install the jar foo-1.2.3.jar
into your local ~/.m2, with the coordinates defined in pom.xml
@micha oh cool, I had no idea boot could do that!
@micha to be honest, I’m having much more basic problems with boot. If I’m not mistaken, the :to-resource
command is meant to move a file from the Fileset into the designated resource directory. The same directory that you assign in the (set-env! :resource-paths)
?
@mikebelanger It's supposed to make it look like it came from there, I think
Your inputs get split, and then tasks read the relevant parts. Sometimes you need to shift them around, pretend something existed before it did, etc. This is my understanding at least.
You should never output to resources. Unless you're doing code generation as a one-off I guess.
@dominicm woa, ok I had a completely different understanding of what resources meant in that context.
@dominicm I have these two files that are considered resources. They’re asm-compiled js files, and they have to be in the final target directory.
@dominicm I never need to recompile the files, or really modify them. I just have to ensure the boot package downloads the correct version, and md5 it for consistency.
@dominicm how would you recommend I ensure that I move two files over from the project in the maven repo into the target directory? Preferably automatically.
@mikebelanger the :to-resource is just changing the "roles" of the files
the actual filesystem directories in which the files are stored is an implementation detail that doesn't really matter for your purposes
because a file created by a task can be the input to another task, and also files creaetd by tasks are likely to be artifacts you want to include in packaging
@micha oh, see I thought resource files were anything that didn’t need compilation, and could be used for input/and or output. I assumed the Fileset is meant for encapsulating any file, whether another task created it or not.
@micha what would be the recommended way of ensuring some files are always in the output directory? Just a project template?
@mikebelanger you're correct about the fileset, it's for encapsulating any file, as you say
@mikebelanger this wiki page may be useful: https://github.com/boot-clj/boot/wiki/Filesets#types-of-tasks
@micha Yeah I’ve been reading that. Hmm I guess I’ll have to read more. Thanks to you both for your time and help!
@mikebelanger the target
task is what writes files to the target dir
Has anyone tried using the built-in Socket REPL with a Boot process?
I’ve been playing around with it this morning and realized that if you run anything in a pod, it’ll fail — the main Clojure runtime that starts to run Boot will start the Socket REPL and then the instance inside the pod will also see the -Dclojure.server.*
property and try to start a Socket REPL… which blows up with Address already in use.
Trying to figure out a good workaround for it.
(deftask target
[d dir PATH str "The target directory"]
(with-pass-thru fs
(let [in-files (->> fileset (output-files))]
(doseq [tmp in-files]
(let [infile (tmp-file tmp)
path (tmp-path tmp)
outfile (io/file dir path)]
(io/make-parents outfile)
(io/copy infile outfile))))))
@seancorfield sure, you just don't want to start it via system properties
But then it’s not automatically handled by the Clojure runtime...
Ah, so it’s a known issue. That’s good, at least. Will read the recommendation...
@mikebelanger the code i pasted above is a simpler target task
so to finally answer your question: the way to ensure that things get into the target dir is to make sure they are "output" files
The problem with that workaround is you actually have to program something into every application you write. The whole point of the Socket REPL is to be able to start a REPL under control of the environment, for any Clojure process.
Yeah, which basically completely rules out using Boot to drive processes in any production environment where you want that external control. Unless you specifically add logic to every process to work off some other non-standard control… That’s a shame...
you could select which pod to launch repl in, or launch a repl in each pod on different ports
Hmm, interesting… so it would still be external to the actual code but would still need to be programmed into the build file… I’ll have to give that some thought. We are moving to an uberjar-based workflow but we have a lot of Boot-powered stuff right now...
We’re currently re-evaluating our use of REPLs across multiple tiers. Today our code explicitly starts (and stops) a REPL in each app where we thought we’d want one — and we actually use a full CIDER-enabled nREPL server — but we want to get away from that, based on measuring how we actually use those REPLs. We like having a rich REPL in DEV (of course) but we don’t want to run those elsewhere and, in general, we don’t want to run a REPL at all by default.
We like the option to be able to do live debugging from time to time (and very occasionally live patching on a few processes).
i'm attracted to the idea of running a repl for collecting metrics
like in theory it's a way to get metrics out of apps that we didn't anticipate the need to log or datadog
But based on our actual historical usage of the REPLs we have been running, we can probably step down to using a bare bones REPL for some of them, and just stop doing it altogether for others.
@micha so the asset/resource files are added to output-files
list whenever the (sift :to-resource...
is used, I see.
@micha thanks for the code-walkthrough, and yeah I’ve been going by this part https://github.com/boot-clj/boot/wiki/Filesets#fileset-components