This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-24
Channels
- # admin-announcements (1)
- # aleph (3)
- # announcements (4)
- # beginners (30)
- # boot (296)
- # cider (21)
- # cljsjs (2)
- # cljsrn (18)
- # clojure (124)
- # clojure-poland (23)
- # clojure-russia (4)
- # clojurescript (73)
- # core-async (58)
- # css (3)
- # datomic (31)
- # editors (4)
- # emacs (35)
- # euroclojure (3)
- # hoplon (104)
- # immutant (8)
- # jobs (3)
- # jobs-discuss (1)
- # keechma (1)
- # ldnclj (33)
- # leiningen (5)
- # liberator (1)
- # mount (20)
- # off-topic (2)
- # om (104)
- # onyx (54)
- # parinfer (80)
- # proton (1)
- # re-frame (59)
- # remote-jobs (1)
- # ring-swagger (9)
- # slack-help (15)
- # spacemacs (7)
- # yada (12)
@mobileink: i'm not aware of anything similar but i'd be curious to know
did a superficial websearch. impression: classpaths isolation remains an issues for gradle. don't get me wrong, I'm not anti-gradle, just interested in dispassionate comparison.
what really surprises me about VMs and platforms after the boot experiience is that most things don't even have a classpath really
which to me now is inconceivable
then i periodically read about upgrading rails apps and am able to concieve of the idea vicariously
maybe gradle can learn from boot, just as boot can learn from gradle, e.g. flavors.
i've never used them but when i looked at them i had a sense that flavors could be a library/task
kind of like the way people implement "profiles" in boot
so the classpath is key for doing things in the JVM, the best we can do is provide some good tools to help understand and manage it
@micha yes. but in my experience we cam do much better at explaining the mysteries to noobs. classpaths, classloaders, still pretty arcane even to me.
hello everyone! I'm presenting on boot at a local clojure meetup, and would love to gather feedback on my slides. Let me know if there's anything I should add/remove! Thanks! http://blog.jethrokuan.com/talks/boot/
@jethroksy: I would explain Lein problems more thoroughly than just the config file
- No pods -> Plugins fork additional JVMs - Declarative configuration -> Plugins don't compose - No filesets -> User needs to manage temp directories themselve (http://www.slideshare.net/juhoteperi/clojutre-build-tooling-with-boot-42005279)
What I mean is, (as I see it) each of Boot design choices is targeted to fix something, so that might be useful to explain when introducing pods and fileset etc.
Not many Lein users probably know either how Lein works internally
That is, when Lein plugin has some dependencies it forks another JVM and loads separate Clojure env with those dependencies
Yeah, they are mostly implementation detail and mostly interesting to task developers
I have directory/files outside of the classpath (CSSes in a npm module), want to copy some into the fileset, what's the best way to do it? Shelling out to mv
sounds like a hack.
But they also lower Boots memory consumption when compared to Lein because Boot doesn't need multiple JVM processes, so that could be something users are interested in
But maybe people aren't running that many Lein plugins parallel today compared to 1.5 years ago, as Cljx is no longer needed
I think dependency hell is a real problem in Lein, and pods is just way too elegant a solution to not show
thanks for all the feedback @juhoteperi
@jethroksy: I don't think it will help me? I have a directory I serve assets from and it's different from where I have to get those files.
But shelling out to do that feels… off. This seems like something that would be a common task so I thought there's maybe a helper function I'm missing.
assuming you wouldn't want to do http://docs.oracle.com/javase/tutorial/essential/io/examples/Copy.java
@dm3: hah that looks fairly involved, that's why I figured maybe someone had already created some helper for that; I'll stick with shelling out for now, but look through sources for alternative later then.
(defn copyrec [src-dir dest-dir]
(doseq [f (->> src-dir io/file file-seq (filter #(.isFile %)))]
(io/copy f (io/file dest-dir (relative-to src-dir f)))))
Would be good, but it says it deletes missing files, I want to keep what was already there though.
And if I need to filter, I've got your snippet (though it would make sense to probably include something like that in the core).
also :mergers
option if you want to merge files from your tmpdir with files of the same path that are already in the fileset, instead of clobbering them
The html doc doesn't say what the :include
option expects; is that a set of paths, set of files, predicate to filter things that gets path, that gets File
object?
@richiardiandrea fixed the documentation black hole there, hope to merge things this week
Yep, I've just run boot uber -h
locally; it seems it expects a set of regexes that match file paths.
this: boot sift -m "(.*clj$):WEB-INF/classes/\$1"
does what I want; it moves .clj files from src
to WEB-INF/classes
, according to show -f
. But this: boot sift -m "(.*clj$):WEB-INF/classes/\$1" target
discards the WEB-INF stuff. I guess the result of sift
is not getting committed. Is there a way to do this on the command line?
@mobileink: are the .clj files in :source-paths or :resource-paths?
I have :source-paths #{"src"} :resource-paths #{"resources/public"}
. E.g. src/hello/echo.clj
gets moved to WEB-INF/classes/hello/echo.clj
.
personally i think the whole roles thing is maybe overcomplicating things, but people tell me they like it
@jethroksy: good luck on your presentation, I like your slides
in any case, is it correct that each item in the fileset is marked with its roles? stuff in :resource-paths
is marked [io], stuff in :source-paths
is marked [i ]?
ok, so the rule seems to be that fileset items carry their roles with them as they move thru the pipeline. target
will write anything marked [o]. correct? so if echo.clj
is in :resource-paths
, it gets marked [io] in the initial fileset; if it gets moved around, it will still be [io] when it gets to target, so it gets written.
pretty cool. but personally i think the idea of items carrying their roles around is much easier to understand, since i don't think of stuff output to the target dir as involving packaging until I'm ready to package and deploy.
rather than concepts that are specific to building java libraries and concepts that are specific to building clojurescript apps and ...
right, that's why i like the concept of attaching roles to items persistently. i found the build/packaging distinction a little puzzling, since i don't normally think like that, it's all just build and run for me most of the time
well, "development" to me means the whole process of building, running, testing, etc. i guess by "during development" you mean "while boot is running"?
@alandipert: thanks! I'm using some of your libs for my demos
i think you're right though, in hindsight maybe it owuld have been better to use sift explicitly to select only output files etc in the pipeline before the packaging tasks
ok, right, i guess i think of boot tasks like serve
or run
as different beasts than build tasks that produce target output. in any case, now i think i finally understand what :resource-paths
does and how roles function in the build process. very cool.
as time goes on it seems like any build-related concepts in boot have been kind of a mistake and are better left to the user explicitly
what counts as a packaging task, for you? i would call jar
and war
packaging tasks, for example.
while you're building the jar and stuff you have a merging of the classpath that will be part of thejar and the classpath your build program needs to run
build pgms as classpath transformers, interesting, never thought of it like that before
it's interesting because you might think, why do you need to have a separate environment as the destination for the classpath you build?
this actually solves the questions i was asking when i first joined this channel - i couldn't for the life of me see how to move stuff from src
to WEB-INF/classes
. now it's easy peasy
really, it has completely changed the way i think about the practical side of software construction.
i find myself thinking about build/config stuff in terms of functionals (tasks) in the same way i think about structuring my programs in terms of functions. makes for a much more integrated view of the whole process than you have with "classic" build tools, where you have to think of configuring foreign stuff.
@micha - could you please point me to where the with-env
is implemented. Was looking in repo but couldn't find
and i think the juxt/edge project is where @dominicm was developing this stuff, so it's there too https://github.com/juxt/edge
@dm3: jackpot: https://github.com/SevereOverfl0w/boot-snippets/blob/master/src/io/dominic/boot_snippets.clj
i've been heads-down with work stuff lately, but hopefully all the awesome new stuff will be integrated into the 2.6.0-SNAPSHOT branch soon
@micha reading on the yesterday's conversation between you and :richardiandrea regarding the propagation of :source-paths
changes to new pods. It seems from the user-facing API it would be nice to propagate all parts of the environment, not only the :directories
. E.g. with-env
would only work for :dependencies
and :directories
, not :source-paths
which is very confusing. Am I missing something?
does the fact that I want to change :source-paths
dynamically indicate that I need to run a new boot core?
i tried many things before taking the nuclear option of writing a java application as the entrypoint 😄
how is it that once you are inside a pod clojure being on classpath is not a problem for spawning further pods?
@micha a proposal to make the env for pods less confusing would be to remove the unused keys, I found a bit weird that get-env in the pod was returning source-paths if it is actually just using directories. Given that pod are low level (and they should stay like that) it makes sense to me to restrict their env map. This will also help with discovery at the repl, dunno whether this is possible, just an idea ;)
in my case I'm trying to use with-env
and add a source path which is otherwise not present. Task which is modified by with-env
creates a pod when instantiated, so the pod captures the proper :source-paths
which at that time contain the correct files (boot auto synchronizes the sources when set-env!
is called). However, once the with-env
has ended boot resynchronizes the :directories
with the old :source-paths
and the files are gone.
Yes yesterday I was doing the same but creating the pod manually and using add-classpath
for example your build.boot program runs in clojure in a pod that is automatically created by boot
you can call boot.pod/make-pod from that pod, which calls a static method of the boot.App class which is on the classpath of every pod
that static method creates a new pod via the same mechanism that created the main pod, and returns a reference to it
with that reference in hand you can call methods on the pod instance to evaluate clojure forms in the pod or call functions etc
@richiardiandrea: i think you may be right about removing extra keys
@juhoteperi: is there anything holding back a 0.4.6 release for boot-reload?
@micha np I have just thrown it there ;)
@pandeiro I don't think ao. I'll check when I get home.
@micha - that's the expected behaviour, yes. But the problem is it's not very useful. Are there more scenarios that could make use of with-env
? Currently I can only see that if you have a task that creates the pod in the constructor and if you limit your with-env
call to :directories
and :dependencies
then you can influence the task.
and it seems worthwhile to differentiate between the Core env and Pod env as @richiardiandrea suggested
for the new file-roles
branch of boot-fails
i have a question about roles. it's easy do demonstrate at the command line that a .clj file in :asset-path
can be moved but will not be compiled by a subsequent aot -a
task. from that I infer that the aot
task inspects the fileset and selects only files marked +input. and you can transform roles as well, e.g. boot show -f sift -S assets aot -a target
will add +input to the assets and so aot compile them. so i infer that we can treat "role" as a kind of metadata attribute, rather than a rule that boot enforces. question: can i violate this discipline? can i write my own task in order to transform a [+output, -input] file? of course conceptually any such task could be viewed as one that first adds +input, but i'm wondering if there is anything in boot that would prevent me from reading an asset, transforming it and writing the result.
@mobileink: nope, nothing
ok, good, so boot provides the mechanisms you need but does not play sheriff - other than keeping filesets immutable. just like clojure, in a word.
have you considered that we can think of boot as a kind of os filesystem-based implementation of Clojure's map api? it doesn't look like the map api, but the concepts are all there. just think of files as key-val pairs, where key is name and val is content. seems to me that the fileset implements this even if it does not directly present a key/value interface.
that makes it easy to explain the fileset pipeline - its a transform pipeline, exactly the same as you would have with ordinary maps
sure but that's an implementation detail, imo - you could use a database instead of the os filesystem, for example. main thing is immutability layer over mutable stuff
where's the incompatibilty? clojure's implementations are also built on mutable host stuff, no?
well for example, if you serialize the fileset you don't have enough information to deserialize it
i ask because i'm working on a blog post explaining filesets using standard {:foo "bytestream here..."} notation
ah, but what does serialize the fileset mean? to me, you could serialize a fileset to e.g. a database, and you could in principle deserialize it
ok, what i need to add to make the comparison work is the observation that the host java constructs behind IPersistentMap etc. are effectively immutable because no other process can touch them and clojure is designed not to change them - but as host objects they could be mutated. where the host env is the os filesystem, of course you have the possibility of mutation. but boot arranges to hide that at least for the duration of the boot run, using the mechanism of hidden temp files to ensure "boot-time" immutability. any other mechanism that ensures boot-time immutability could work as well. so to the user, the file system rooted at the project root is just as immutable as any clojure map, for the duration of the build process. does that sound correct? i hope so, it's very cool
if so, i think what you really have here extends well past build/config tasks. i imagine it could form the basis of a lib that would make immutable fs operations easily available to any clojure pgm. this is related to the idea i mooted the other day about supporting a standard map api for boot.
also lifting it out into a library would mean maintaining it in two places, because boot can't have dependencies
i've got some backing at work for introducing clojure, and i expect some resistance from both pgmers and mgrs - i think boot will be a huge argument in favor of clojure. i don't know of any other system that does this sort of stuff at all
i'll give up make (and emacs) when they pry my cold dead fingers off it (to paraphrase charlton heston) 😉
hey all. i'm getting an error using advanced compilation with externs in deps.cljs
ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input
ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /Users/pleasetrythisathome/.boot/cache/tmp/Users/pleasetrythisathome/Code/work/populace/populace/1r0q/fwjp2k/js/booking/booking.ext.js at (unknown source) line (unknown line) : (unknown column) ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /Users/pleasetrythisathome/.boot/cache/tmp/Users/pleasetrythisathome/Code/work/populace/populace/1r0q/fwjp2k/js/timekit/timekit.ext.js at (unknown source) line (unknown line) : (unknown column) ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /Users/pleasetrythisathome/.boot/cache/tmp/Users/pleasetrythisathome/Code/work/populace/populace/1r0q/ywpinm/js/booking/booking.ext.js at (unknown source) line (unknown line) : (unknown column) ERROR: JSC_DUPLICATE_EXTERN_INPUT. Duplicate extern input: /Users/pleasetrythisathome/.boot/cache/tmp/Users/pleasetrythisathome/Code/work/populace/populace/1r0q/ywpinm/js/timekit/timekit.ext.js at (unknown source) line (unknown line) : (unknown column)
looks like the files are in the classpath twice perhaps? any idea why that'd happen?
only see them once
not in jars currently...i was just including them in src/
i have a ticket to put them into cljsjs packages...
i suppose that might solve my problem as well
yea i see that