This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-13
Channels
- # admin-announcements (1)
- # alternate-reality (2)
- # beginners (15)
- # boot (309)
- # cbus (1)
- # cider (4)
- # cljs-dev (4)
- # clojure (199)
- # clojure-madison (5)
- # clojure-russia (14)
- # clojurescript (59)
- # community-development (57)
- # core-async (5)
- # cursive (8)
- # datavis (6)
- # datomic (1)
- # dysphemism (11)
- # emacs (5)
- # euroclojure (1)
- # hoplon (3)
- # off-topic (103)
- # om (52)
- # onyx (3)
- # parinfer (1)
- # proton (15)
- # reagent (4)
Anyone know what the comprehensive list of directories are for OSX where boot caches files? I'm often having problems where boot is trying to find source files that no longer exist. This seems to have come after moving to 2.5+ (on 2.5.5)
I know it must be my machine because the CI server isn't looking for this errant classfile
OK, so that would be consistent with the CI server saying OK. Got the problem fixed. Thanks!
can boot or some custom task can bump release given +version+ in your build.boot?
hey all, is there a method of stripping out an input directory from being seen in subsequent tasks' input-dirs? I see rm, but this appears to just be for individual files.
my use case is that I have a task that transforms some source files -- the subsequent task should see the transformed files, but not the originals
rm or sift are the things you want i think
you can remove the files in one swoop w/ sift + regex
or if you need more control, do your own rm-ing
it's also worth knowing that the fileset works like git or S3
there aren't really directories, only paths to objects
(the classpath also works like this)
so, to remove a "directory" is going to be removing paths that match some pattern
ah, perhaps I'm going about my problem the wrong way then. Trying to solve the problem of using find-namespaces
from clojure.tools.namespace.find
, which expects a root directory of source files. Previously was just trying to feed it one of the temporary transactional directories that boot makes. But this might not make sense to do it this way.
i would do that by finding all the clj files in the fileset and copying them to a tmp-dir of your own making, then unleash find
on the tmp-dir
Hey all, I’m fairly new to clojure & clojurescript, even newer to boot. Coming from JavaScript, I really really like everything boot has to offer. The only thing that I think it is missing are some front end compilation tools. There are plenty of tools written in js (ie postcss) and I would love to port them over to boot, but I don’t really know the best way to start. Can you run clojurescript in a boot task? Can you run javascript libraries in clojure? Or is the best way to interface between them the clojure exec function?
@bendy: no worries that's a good question 😄 and welcome to
@alandipert: I like that idea, I'll probably go with that -- thanks for the suggestion!
@shwx84: surely, enjoy
@bendy: you can run cljs in clojure via nashorn or another JS for the JVM like Rhino
what's missing is the nodejs runtime. node adds lots of things to the JS environment that the JS-in-JVM things i'm aware of don't provide
i found a few abandoned attempts but nothing that probably runs today 😦
so yeah, i would recommend exec
or dosh
which comes with boot
(vendored from the conch library)
the recipe for a task that ran node on some files from the fileset would be to make a tmp-dir, like for @shwx84's problem
and then aim node at the tmp dir, and add whatever results you want from that tmp-dir to the fileset and then pass it on
@alandipert: awesome, thanks! That’s definitely enough to go off of for now - I’ll report back if I make any progress 😉
@bendy: cool no problem! probably the fastest way to get cookin' is by looking at 'community tasks' on the wiki and finding the one closest to what you need and hackin' it
any of them that drive non-jvm translators/compilers are probably good references
$ rm project.clj profiles.clj; git commit --all
<- satisfactory
Revisited build.boot for importing backend as well
New usage for building: boot -e flavor=fronted|backend build -t prod|dev
New usage for devving: boot -e flavor=fronted|backend dev
A little bit of fiddling with the deps (I had to start with all the deps in the classpath and then remove based on the flavor), but I love it! I will post the build.boot
soon@juhoteperi do you know of any issues running on linux with your sass task?
getting this error: java.lang.UnsupportedOperationException: Platform linux:i386 not supported
@raywillig: it only works on 64bit
If your system is 64bit could be that you have 32bit Java. If your system is still 32bit I would highly recommend upgrade.
There is a issue about this at jsass repo: https://github.com/bit3/jsass/issues/11
Question about copying dependencies. I need to copy my jar dependencies to build/WEB-INF/lib. I have a task that does this using io/copy. That doesn't seem very bootish, but I haven't been able to figure out how to do it with a fileset. If I had the jars in a fileset I think I could use the target task, which seems more idiomatic. But I don't see how to get the jars into a fileset. Any advice would be appreciated.
No. This is for google app engine; for security purpose, the dev server will only look in its own dirs, so it cannot use the jars from ~/.m2/ - they must be copied to WEB-INF/lib, without unpacking.
pod/jars-in-dep-order gives me the jars, then io/copy works, but that doesn't seem like the Boot Way.
We have a task to do almost exactly that… let me refheap it for you @mobileink
Something like this https://www.refheap.com/114762
We have multiple web apps under a common root folder ws-root
and this gets out list of (web-libs)
dependencies, and copies them to all our WEB-INF/lib
folders.
I expect that’s pretty much exactly what you came up with? https://clojurians.slack.com/archives/boot/p1455378406006079
@kul I use boot-semver and set (def +version+ (semver/get-version))
@seancorfield: Looks like the same idea. But my understanding is that in Boot we should not directly muck about in the target tree, and instead use filesets. Hmm, now that I'm staring at the code some more it occurs to me that the way to go is to io/copy stuff to a core/tmp-dir! and then add that to the fileset for later handling by the target task. I've been using a hardcoded output path, io/copying straight into the target tree.
So I gather its a bit of both. You write to the filesystem, but always relative to a tmp dir controlled by boot, so you're kinda sorta writing to an unreal FS. Does that sound more or less right?
@mobileink: also if you write to your own temp dir and then add to fileset you have excellent control over caching strategies in your task
you can use boot.core/fileset-diff
to obtain a fileset object containing only changed files
One thing to be careful of with target
is that its default mode is to erase everything in the target folder so using target
with your WEB-INF/lib
will require an option to not do that
You’ll also have to move those classpath JARs to your resource paths to get them into target.
@mobileink: re: the WEB-INF/lib dir, did you see the uber --as-jars
option, with the war
task?
I had this discussion with @micha at the time and his recommendation was to do the io/copy
pretty much as I did
those two in combination will result in a war file with all dependency jars in WEB-INF/lib
(But, yeah, if you’re prepackaging the entire app as a WAR to deploy to GAE, I’d do what @micha is suggesting here)
That wasn’t/isn’t the case for us.
@seancorfield: regarding target cleaning the target: learned that the hard way a few days ago. 😉
@danielsz:
im trying to decipher your latest advancements on boot.system
.
im a bit lost, because
1. i can't see git tags corresponding to the released versions i see on clojars
2. u have reverted to using ns-tracker
from clojure.tools.namespace
, though the docs still talks about c.t.n.repl
(https://github.com/danielsz/system/commit/98457f6f1c1af1944dd0f89b5a8c21e9ecc7a83d)
what will do the changed files detection eventually?
boot.task.built-in/watch
or c.t.n.repl
?
looks like the uber task is just the thing. regarding WARs for GAE, the dev server doesn't like warfiles - the gradle plugin my boot-gae will replace goes to the trouble of making a warfile and then exploding it. so far it looks like the warfile can be skipped. then when up upload to the prod server the google stuff just knows what to do, no need to make an uberjar
just tried boot uber --as-jars sift -i "jar$" target -d "build/WEB-INF/lib" and it worked like a charm. that is awesome. boot-gae should be ready to play with in a day or two but i can promise you right now that GAE with boot is about 10000 times easier than it is with gradle/maven. i hate to even think about how much time i spent trying to learn gradle/groovy and then the plugins - a nightmare.
i'm actually having fun figuring out how to do things with boot. fun doing config/build stuff - that's something i never ever thought i would say!
@mobileink: shall we have a Google App Engine page on the boot wiki for such recipes?
@onetom: i think that might be a good idea, we can also post a blurb about deploying with docker and such
Pretty good article on the intricacies of package managers: https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527#.i497ikadx
how do i run a repl server, tried: 'boot repl -s', but it just returns...leaving no running process.
@fenton: by default most tasks don't block the pipeline, use boot repl -s wait
to have a blocking task at the end
@martinklepsch: thanks martin i'll try that...
@flyboarder: actually if @mobileink makes a boot-gae
task, then that can have the documentation and we should just link it from https://github.com/boot-clj/boot/wiki/Community-Tasks
(i tried to create a page but then i realized im not sure what would i put into it, neither did it fit anywhere on the current TOC)
@onetom: I think the community wiki should have a deployments section somewhere tho, the community projects page is almost big enough to need categories
make that the tasks page
what would be under it? • Deployments • Google App Engine • Heroku • Tomcat? • Docker? • VPS? eg Amazon AWS / Digital Ocean / RackSpace (just to have the keywords what ppl might search for)
Yeah something like that, if there is a community project for one of them then direct link to that?
I was thinking of a heroku task myself and there is already beanstalk
it's actually more like u have certain ways to package and daemonize a clojure app in a 12factor compliant way: • Docker • WAR • Uber JAR • jsvc • Apache something something • Upstart • Systemd
FYI, boot-new
now has a first cut of generators in the 0.4.0-SNAPSHOT https://github.com/seancorfield/boot-new#boot-generators
and for the various actual PaaS and IaaS provides u can link step by step instructions and document the peculiarities of them
So we need 2 sections then, packaging and deploying
packaging having the nitty gritty details and deployment having community projects and or instructions if there isnt one
something like that, but im not very experienced in this regard yet.
we are still running boot
directly via upstart
in production on EC2 using Amazon Linux.
@onetom: i think you would benefit from the EC2 Container Service then, building the container image is very easy thanks to https://github.com/adzerk-oss/boot-clj-docker-image
how to specify multiple options on the command line: $ boot repl --server --init-ns 'test.core' --eval '(start)' -- wait seems to only run the --server part and ignore the rest?
i prefer to have the option of running the code...if it throws errors... hard to get any repl started if errors are thrown on simple file load... 😐
use case was basically to have a repl i could attach to on my production code...but code needs to auto-restart on server reboot, etc...
@flyboarder: i was dismissing docker until recently, because of the big upfront cost of getting the base images. BUT they started to transition to a 5MB Alpine Linux base, so I started to learn it finally. https://insights.ubuntu.com/2016/02/10/docker-alpine-ubuntu-and-you/ and https://www.brianchristner.io/docker-is-moving-to-alpine-linux/
but would be nice to be able to come in, in multiple ways...my custom task, a regular repl no over aggressive NS loading...
@onetom: yeah I would consider it for sure, if you have issues with the images let me know
@onetom: also interesting if you are running your own PAAS for your apps there is rancheros 20mb linux running docker on the kernel
fenton: i was battling with similar issues a few weeks ago. what makes it even more complicated is that we are also connecting to the repl from intellij we ended up having this:
(def repl-init
'(require
'[clojure.inspector :refer :all]
'[adi.core :as adi]
'[datomic.api :as d]
'[org.httpkit.client :as http]
...
'[midje.repl :refer :all]))
(task-options!
repl {:eval repl-init})
(deftask dev []
(alter-var-root #'midje.sweet/include-midje-checks (constantly false))
(eval repl-init)
(comp
(environ :env {:http-port 3001})
(watch)
(system.boot/system
:sys #'sys/dev
:hot-reload true
:auto-start true)
; (eval repl-init) above is necessary to require the convenience namespaces
; so we can have them when connecting from IntelliJ via lein, which can not
; simply use the `repl-init` defined in this build.boot
(repl :server true)))
@flyboarder: thanks! (trying the adzerk image now. it will take probably 30mins on my connection to download it though...)
you and micha both have terrible interwebs 😛
I made a scratch space for packaging and deployment https://github.com/boot-clj/boot/wiki/Packaging-and-Deployment
@flyboarder: fyi, it took 25mins https://gist.github.com/onetom/6ee78d00dfdfef7602cf
4Mb/s? Yikes, I couldn't function. I get about 100Mb/s down 12Mb/s up and even that doesn't feel very fast to me these days.
5yrs ago i was every other month in Thailand, where i only had 11kbyte/s EDGE mobile connection and still i was administering 40 servers and monitoring them via Newrelic
took a little patience but it was quite doable
@micha: Note added, hopefully it's clear enough: https://github.com/adzerk-oss/boot-cljs/wiki/Usage#compilation-levels
@richiardiandrea: looks great
you may want to mention that the main.out directory is still needed if you want source maps to work
is it?
let me check
oh, I hoped it was a 1:1 mapping from main.js
and you need to do things to make sure it generates the right paths to encode in the compiled js
my JS skills are weak my friend
I will do a couple of tests here
with my brand new command: boot -e flavor=frontend build --type prod
😄
ahahah (ottimo is Italian!)
it means perfect
ahahahhahahahaha
no for a girl is ottim*a*
but it would be maybe too cocky to call your son/daughter like that 😄
in Italian, we also say: ottimo, Andrea
that would become: ottimo Ottimo
a bit weird 😄
I remember you did not need it ^, I am trying in firefox @micha
oh you're right
will change the Readme
I have a library which creates/runs a web worker. The app should not need to know about it. But if I put the cljs.edn file in the library jar by using a resource path, it gets ignored.
Currently the only thing I do in the build.boot of the library is create the jar with all the source files.
i don't think it's appropriate for applications to be built via transitive dependencies
so this way the app only needs to know which jar files might be creating web workers.
And to take it a step further, a library which depends on another library might want to do the curtesy of "pulling in" from its dependencies, so the app only needs to know about the top-level dependencies.
@onetom: i experimented with alpine recently but discovered it doesn't use or come with glibc, so a binary i needed to run in there didn't work
@onetom: just a PSA really - i think if you stick with what they have packaged or if you compile native stuff in the container, you're fine
OK, https://github.com/seancorfield/boot-new 0.4.0 with generator support is up on Clojars. Built-in generators are ns
and defn
. PRs welcomed to add more. Generators can also be part of your own project (although you’ll need to depend on Boot new!).
Oh man cool stuff!
now we need cider
integration 😄
for defn
I use yasnipped
but ns
is very useful indeed
ns
and defn
were just the first two that popped into my head, and for defn
I needed to update boot.new.templates/->files
to support appending to an existing file so it was all good.
I’ll probably switch my FW/1 web framework template from Leiningen to Boot now and add generators for controllers and views etc.
Great yes, it would be nice for instance to generate re-frame handlers/subscriptions boiler plate