This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-24
Channels
Switched several of our key build script steps from Leiningen to Boot today. We now have a top-level build.boot
file, which is the first step toward retiring seven project.clj
files (and ultimately retiring most of our Ant script, I hope!). We're running our Clojure unit tests via Boot now, with both 1.8.0-RC4 and master SNAPSHOT. All our DB teardown/setup/migration tasks are running via Boot as well now. Very hapy with the way this is all coming along. Thank you!!
@seancorfield: awesome!
Here is my solution to building multiple artifacts using one build.boot: https://github.com/Deraen/less4clj/blob/master/build.boot
Hmm, is it possible to run tests using different clojure versions with one boot process? that is, can I replace clojure version used by a pod with set-env?
Is there an IntelliJ expert here who would be willing to help setting up Cursive with Boot? Is there a video explaining it?
I have a lot of small questions and so far I was not able to achieve a setup where I can see both my hoplon repo and my castra api repo within the same window, properly recognizing all symbols, etc etc
I ran lein-generate of course and somehow I got my dependencies appearing in some dependency browser, but 1, adi was still not recognized as an existing lib 2, the deps contained clojure 1.6.0 only, but not 1.7.0
@onetom: Maybe you should add clojure 1.7.0 as direct dependency to Boot env? The lein-generate task uses the env to create project.clj deps and I think clojure dependency is not automatically added to env.
We tried to use LightTable in the past ~3days for work but it just doesn't cut it really
And if there is no direct dep to clojure in env, it's possible that transitive dep is used.
deraen: we tried to add it to the project.clj manually, but then what's next? when will that change be picked up? should the project.clj be version controlled too? because if it's not, then the repo dir is not really recognized as a "lein" project
I wouldn't add project.clj to VC, I would make sure the lein-generate generates the correct project.clj
just trying to run the hoplon demos and it’s messing with my boot version (castra simple has a BOOT_VERSION=2.2.0). Should I update that to 2.5.2 and make a PR (I’ll check the others too!)
I’ll fix and make a PR as it forces a DL of 2.2.0, which does not make for a good experience
does anybody have an example boot file that uses credentials to access a repo (like datomic pro, in fact exactly datomic pro!)
;; Get credentials for Clojars from the environment.
(configure-repositories!
(fn [{:keys [url] :as repo-map}]
(->> (condp re-find url
#"^\.org/repo"
{:username (get-sys-env "CLOJARS_USER" :required)
:password (get-sys-env "CLOJARS_PASS" :required)}
#".*" nil)
(merge repo-map))))
An alternative would be to read the creds from Leiningen credentials.clj.gpg, it's not simple either but it's few lines less and it's not repo specific
the GPG thing is a bit of a mare to grok and then to manage IMHO, at least on OS/X … I tried that and gave up … way too many moving parts
lein actually supports this in a quite simple way, so maybe I have to think about whether I can add that to boot or find a less fiddly way that the code snippet
Hmm does Lein have some way to automatically read creds from env vars?
(set-env! :repositories [["clojars" {:url " "
:username (System/getenv "CLOJARS_USER")
:password (System/getenv "CLOJARS_PASS")}]])
Yeah you can do that
The idea with configure-repositories is that different people in project might want to define the creds if different ways. So users can set their configure function on ~/.boot/profile.boot
and project doesn't need to specify where the creds are retrieved from.
There's lots more magic on Lein impelementation
I did implement the same for Boot but we decided to go with little different implementation
nice, @juhoteperi thanks for your help
I have this on my profile.boot: https://github.com/boot-clj/boot/wiki/Repository-Credentials-and-Deploying#lein-credentials-file
And I have creds for clojars and datomic in the gpg encrypted file
But yeah, I helped a friend to configure gpg in OS X and it was quite bad
Much easier in Linux
It should also be possible to implement a function which would read the creds from env, for example based on url hostname
IIRC Leiningen uses repo alias/name for the env variable name, but our configure function doesn't see that info
;; Reads creds from env. Uses URL hostname to build env variable name:
;; -> MYDATOMICCOM_USER & MYDATOMICCOM_PASS
(configure-repositories!
(fn [m]
(let [n (-> (:url m)
(.getHost (java.net.URL.))
(clojure.string/upper-case)
(string/replace #"\." ""))
user (System/getenv (str n "_USER"))
pass (System/getenv (str n "_PASS"))]
(merge m (if (and user pass) {:username user :password pass})))))
Something like this could try to read the creds from env
Maybe we'll provide few of these functions in a library or in Boot core in future
@raymcdermott: you should update :repositories value in env: (set-env! :respositories #(conj % ["datomic" {...}]))
Else you lose the default clojars entry
That's the repo map for datomic
% is the current repositories list and that function just appends datomic to it
When a function is provided to set-env value, it works like update
and call the function with current value to create the new value
@juhoteperi: that works 👏
It's a bit unfortunate that repositories are defined as a vector as it makes it quite hard to replace existing repos, but maybe there was a some reason for that...
adding the fact that you need to use the function would be a good addition to the docs
The documentation of so many clojure things reference stuff from the java world that I have no idea about. A bit frustrating!
@mbertheau: we were in the same situation a year ago. don't give up! this ecosystem is by far the best despite all of its warts (compared to perl, python, ruby, node, etc...)
I don't think AOT is a Java term
@juhoteperi, yeah, AOT was not meant as an example of that.
But yeah I guess it's true
It's just that if I know what aot is I don't need the help text, and if I don't know what it is, then the help text doesn't help
@onetom: I have math.comp in :dependencies, currently I'm struggling with loading/requiring/useing my code in the repl.
then: boot.user=> (use 'clojure.math.combinatorics)
(tho use is discouraged if i understood well)
good point, i had the same question when i was learning node and coffee, just as well clojure
boot.user=> (require '[my.code :refer :all] :reload-all)
is ur friend for reloading stuff from the repl
we've learnt the basics from http://www.braveclojure.com
i guess u r not using a repl for that, right? just reload the browser or boot-reload or figwheel does the reloading for u
we also started with cljs 1st and i got everyone to practice on https://github.com/swannodette/lt-cljs-tutorial
Right now I can't load my code from boot repl
, it says boot.user=> (require '[advent.night :refer :all])
java.io.FileNotFoundException: Could not locate advent/night__init.class or advent/night.clj on classpath
(set-env!
:source-path #{"src"}
:dependencies '[[org.clojure/math.combinatorics "0.1.1"]])
So a number of small errors and oversights on my part led to all that. It works now
Also with boot documentation for the default tasks is a bit hard to find, afaik they are available only through boot help
though i have to admit i rarely looked into those. not sure why... maybe the it's too much or the info is in the wrong order?...
i think the problem w having such info in the README or the wiki is that needs maintenance and these tasks were in flux this year
maybe they are solidified enough to be duplicated elsewhere than the only the source code
Or they could be in a readme in the repo as well that can be kept in sync with the code
on that note if u have an idea where would u expect to see the list of tasks in the wiki, just copy it there pls. it's a wiki after all; no permission necessary to edit it i guess
the edits are also mentioned here on slack automatically (hopefully) so we are very aware of them and we can quite immediately discuss it right here
from @martinklepsch to any booter: boot -d boot/greet:2015 greet
Hmh, I wonder where we should mention this boot.properties problem.
Should be pinned to top of readme probably.
@juhoteperi: i was thinking of pushing a new version of boot-bin that fixes this
Ah, even better.
i hardcoded in the unsupported versions and it warns the user then updates them to latest
In addition to saying that version is no longer supported, I think it would be good to mention how to remove boot.properties to fix the problem
Or are old versions ignored?
@juhoteperi: when it updates it should fix their boot.properties automatically
if i have a boot.properties in the cwd with say 2.0.0-rc12, it prints the warning but runs a supported version
https://github.com/boot-clj/boot-bin/commit/f46ed64543b5e3fc87ad5866fbeb349c42f3f8df?w=1
@martinklepsch: new version of boot-bin released today, 2.5.2
@micha happy holidays! Not sure if I'll get to updating homebrew in the next two weeks just fyi :)
@micha: I’d be willing to donate an azure VM to the boot core devs
@flyboarder: that would be awesome!
np, i’ll set something up
@micha: <mailto:[email protected]|[email protected]> can you shoot me an email and i’ll send over the credentials
details away