This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-25
Channels
- # bangalore-clj (1)
- # beginners (13)
- # boot (163)
- # cljsrn (23)
- # clojure (70)
- # clojure-czech (1)
- # clojure-russia (6)
- # clojure-spec (8)
- # clojurescript (47)
- # cloverage (16)
- # cursive (2)
- # editors (1)
- # garden (2)
- # lein-figwheel (1)
- # om (30)
- # om-next (2)
- # perun (2)
- # planck (23)
- # rdf (4)
- # reagent (1)
- # specter (2)
- # untangled (8)
- # vim (7)
how long does it normally take from the time you launch boot to the time you have a cljs repl in the browser?
mine took like 45seconds so idk if that is normal
@adamkowalski: for initial launch that seems reasonable. Also depends on hardware etc
Hey everyone - I'm relatively new to boot but really liking it so far. So I thought I'd start to write my own task (it's going to be open source in case someone else finds it useful) but I'm hitting a problem that I can't explain at all at the moment:
None of the changes I made today is picked up by boot; instead it looks like an older version of my task gets executed.
I tried to reduce the problem as much as possible and ended up with just a build.boot
file in an otherwise empty folder. As you can see below the only thing I do is requiring the original task namespace but I'm not adding any dependencies:
(require '[schranz.boot-resource-filter :refer [filter-resources]])
I would expect an error that it can't find the namespace but instead this lets me execute the task; but not the current version
Where is it finding that namespace? Is Boot doing some caching of tasks that I'm not aware of? (I haven't been able to reproduce it with any other task so far)
Things I've tried so far:
• I deleted the target folder and ~/.boot/cache
folder just in case
• removed the task artifact from my local maven repository (which I don't think mattered since I didn't specify any dependencies)
• updated to the latest boot 2.7.0-rc1 (but I'm back on 2.6.0 now)
• getting slightly desperate I even deleted the original project folder at some point
• I also renamed the namespace at some point (just added a character at the end) which allowed me to see my latest changes.
• boot show -c
is not showing anything that is related to my task except for a few folders in ~/.boot/cache/tmp
but all of them are empty
I'm probably missing something really silly and obvious but I can't see it just yet - if anyone has an idea what's going on that would be greatly appreciated 🙂@xla: is that require statement the only thing in your build.boot?
I don't have any explanation unfortunately, have you tried reproducing in a new directory?
It doesn't sound like the kind of issue I could reproduce on my machine but I'm happy to try if you put it on GitHub or something
I'm completely baffled by it - and yes I tried it in a new directory. Unfortunately I don't have my company laptop here or I would have tried on that machine (I'm sure it'll fail) I've already pushed my work in progress to my github repository: https://github.com/danielschranz/boot-resource-filter (btw I also updated the doc string yesterday via a force push to see if boot is downloading it somehow from there, but that's not the case either) Thanks for having a look at it!
@xla: now there are more files etc in there, what are you observing and how does it differ from what you expect?
When I make changes to the filter-resources
task in the boot-resource-filter
namespace (a simple example would be changing the doc string) and running boot
in the terminal again I expect to see the new docstring - but it doesn't change.
Cool, I'll check it out in 20min or so
@xla after commenting out the (*usage*)
line (so that the task returns a fileset) it seems to work fine for me
@xla also you might want to try Clojure 1.8 instead of 1.7
I changed the task docstring and ran boot filter-resources -h
and the printed docstring is updated
Weird, I commented out that line but it still behaves the same for me. - Actually this is the expected behaviour so it must be something that I did on my laptop.
Btw I took that pattern to return *usage*
from an example online - it does return a fileset if the parameter checks pass - which I confirmed by adding a string to the processed files (but I'll check whether that is a correct pattern)
Seems like I have to do more digging here - but thanks @martinklepsch for taking the time to confirm it's not something boot does...
An alternative to installing boot on ox that is not via brew because brew’s version of boot is old.
@urbanslug boot's version on homebrew is up to date
The binary is upwards compatible
@urbanslug when you specify a higher version via BOOT_VERSION
it will use the given version
the version of the binary is not coupled to the version of Boot itself: https://github.com/boot-clj/boot-bin/releases
Then the error I’m getting has nothing to do with boot version. Thanks @martinklepsch
@urbanslug make sure you always pin the Boot version via boot.properties
Ha @martinklepsch - I think I found it!
Following your suggestion I updated the Clojure version in boot.properties
to 1.8.0
and got the new docstring - went back to 1.7.0
I saw the older doc string again... tested version 1.6 and also got the new docstring.
So I deleted Clojure from my local maven repo and now I get the correct doc string with version 1.7.0
as well.
I think I also know how it happened: when I first experimented with installing the task locally I didn't get the config right and I remember it saying it installed the Clojure artifact into the repo (I didn't encounter any problems so I didn't think much about it, but apparently it installed my task there)
@xla: Yeah! 🎉
Has anyone attempted a simplified terminal based boot-cljs-repl? What I'm imagining is a sort of browser based planck
. Without any other configuration, you can do boot -d com.andrewmcveigh/cljs-time browser-repl
and it greets you with a working command-line repl.
In the background it could automaticaly open a page in chrome or whatever, and it'd serve a default index.html
containing only script
tag
I think that'd be very useful for trying out clojurescript without diving into a boot setup etc.
I have a project in which the dependencies depend on the task executed (production needs another dependency). So, for example, for testing, I can add my own deftask
in which I set the env, in which I only execute the boot-check test task:
(deftask test-project "" []
(set-env! :dependencies #(conj % ...))
(test))
However, in this case, if there are task options, I also must implement all these options to pass them to (test)
. I know there's a task-options
I possibly can know, but can it be used to set the environment? Doing:
(task-options!
test {:source-paths #{"src/clj" "test/clj"}
:dependencies #(conj % ...) }
results in:
test: unknown option(s): :source-paths, :dependencies
How can I set dependencies in an task defined in another dependency (`boot-check`)?Pretty new to Clojure and just learning boot... I'm trying to get a repl going on a hello world project. At the root of the project I have build.boot with (set-env! :source-paths #{"src"}). When I run a boot repl and print the classpath, I see file:/usr/local/Cellar/boot-clj/2.5.2/bin/boot and file:/Users/keith/.boot/cache/bin/2.6.0/boot.jar only.
I must be doing something really dumb because I expected my source path to be in there as well 🙂
@keithsparkjoy how are you printing the classpath?
(println (clojure.string/join "\n" (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))))
D’oh right
I think I need to learn the basics about how boot deals with classloaders and paths and such - is there a good resource you can suggest?
there are functions in the boot.pod namespace that expose various classloader functionality in a handy way
I think I understand the basics yea
and those remain isolated in that pod, they are not on the classpath in the context that created the pod
gotcha
in boot, to make it possible to achieve isolation, we ensure that the clojure runtime is not loaded into an classloader that could ever be the parent of another pod
I see - so I was printing the classpath of that.
Makes sense. Ultimately what I’m trying to figure out here is why boot repl is not finding my source files, even though I’ve set up the path to them in my build.boot file.
... is it possible to set an environment (`set-env`) of a task defined by a dependency? (For example, can I set the environment of the test task of tolitius/boot-check
)?
@keithsparkjoy you can try (boot.pod/get-classpath)
yep, @micha that gives me a nice long list
you can also try (
, assuming you have a src/foo/bar.clj
file in your project
I don’t see my project directory anywhere on the classpath
that I printed via (boot.pod/get-classpath)
(lights coming on)
this way it doesn't need to have all kinds of special cases for what to do if it needs to delete a file from your project
also this make the whole immutable fileset stuff straightforward to implement and understand
ahh okay so I’m seeing some stuff I recognize now that I’m looking at the boot/cache file paths in that classpath
some paths that are clearly from my project
interesting
an interesting consequence of this is that you can remove directories from the classpath
it just copies files into there from different places depending on your source-paths and resource-paths settings
So I guess what I really need at this point
Is to know how to get an interactive development workflow going for a simple project with boot
An app in this case (hello world).
I’ve had success with a hoplon app
Right.
Project is called “wf” for workflow - just trying to figure this out.
I have a subdir src
with a couple clojure source files
user.clj and core.clj
with a simple def in each one.
I was having trouble loading these namespaces (use ‘wf.core) for example
getting file not found errors
I see my problem. I need a wf dir under the src dir.
(dopeslap self)
so after you create the wf dir and moev the sources in there, you can do (require 'wf.core)
working better already 🙂
makes sense
Okay going to take this new knowledge and hack a bit. Thanks for the help, @micha!
Hello everyone.
Let's say I want a boot task that downloads a file from a url. This task accepts url
and taget-file
. Should this task add downloaded file to a fileset or it has to be done by a callee (the code that invokes this task)? What if I save a file under random name? How do I provide a path to this file to a callee?
you may get inspiration here: https://github.com/cljsjs/boot-cljsjs/blob/master/src/cljsjs/boot_cljsjs/packaging.clj#L74-L93