Fork me on GitHub

I just updated my .clojure/deps.edn file on GitHub to add REBL support etc


is it possible to access environment variables in deps.edn like $HOME? probably not..


Nope! Why do you ask?


because I want to say ~/git/... in a local dep. just a convenience


Is it a transient thing for working on a local copy of a library? clj -Sdeps "...$HOME..."?


yup, can do it like that

Lone Ranger21:01:43

hi all... so I've been attempting to transition over to the deps.edn -- first of all, is there a name for this style of build tools? aka lein vs boot vs ... what... deps?. In general it's great but there seems to be "something else going on". I'm seeing blog posts about a build.clj file but I don't see anything official on it. Can anyone explain what that's all about or have a good reference for it?


@goomba leiningen and boot are fully-featured toolbelts for doing things like fetching and loading dependencies, building uber jars, running tests, etc.


tools.deps is only about fetching and dependencies and building a classpath to run your JVM program. it doesn't handle any of the other things

Lone Ranger22:01:54

okay, maybe I'm in the wrong place? is the clj tool not part of this and deps.edn?

Alex Miller (Clojure team)22:01:17

clj is about two things: making classpaths from transitive deps, and launching programs

Alex Miller (Clojure team)22:01:34

deps.edn describes the deps and ways to modify the making of classpaths

Alex Miller (Clojure team)22:01:54

all other tasks are programs, so you launch a program to do the task

Lone Ranger22:01:56

so far it's been great at those πŸ˜„

Lone Ranger22:01:14

is that where these build.clj files I'm seeing come in?

Alex Miller (Clojure team)22:01:20

no one idea what build.clj is

Alex Miller (Clojure team)22:01:34

but it’s not deps.edn / clj


because clj doesn't do all those other things, some people have decided to write their own script for e.g. building a JAR file, or bundling the CLJS code. instead of using a leiningen feature or plugin

Lone Ranger22:01:17

here's the only example I can find


one might decide to call that script build.clj πŸ™‚

Lone Ranger22:01:09

okay so that stuff is essentially home-rolled scripting that some decide to call build.clj


yeah. in this case, they wrote a script to bundle their CLJS code for deploying

Lone Ranger22:01:01

interesting. That is the one area in which I'm hurting right now -- I've been running lein in parallel with clj because I can't find a reliable way to do uberjars


in leiningen, I believe there's a cljsbuild plugin to do that for you


ah yep. same for uberjars

Lone Ranger22:01:58

mhm. Are uberjars not really a thing for clojure? I assumed that was the defacto standard for deployment

Alex Miller (Clojure team)22:01:49

they are very common. there are at least 3 tools in that tools page above that build them

Lone Ranger22:01:22

indeed. Just trying to consolidate methodologies as much as possible.

Lone Ranger22:01:05

thanks everyone for fielding questions πŸ˜„


I think some people are moving away from them for Clojure, since there's not a ton of benefit you get other than improved startup time in most cases

Alex Miller (Clojure team)22:01:09

they are certainly convenient as a unit of deployment

Lone Ranger22:01:23

what do they otherwise deploy with then? clj -m mything.core?


ah I was also conflating it with AOT. but currently I throw it all in a docker container because I already have infrastructure for that Β―\(ツ)/Β―

Alex Miller (Clojure team)22:01:24

AOT is orthogonal

πŸ‘ 5

@goomba FWIW, at work we use (my fork of) depstar to build all-source uberjars for pure convenience of shipping an "artifact" to a server; to run those we do java -cp path/to/the.jar clojure.main -m entry.point ... where entry.point is the namespace containing the -main we wish to run (our artifacts often contain several, related -main functions in different namespaces).


All of our dev/test process uses clojure (the core of clj) wrapped in a small bash script to simplify handling of command line options.

Lone Ranger23:01:53

gotcha (worth a lot, as always!)


We do not AOT anything.


It's also worth mentioning, as background, that we started with lein back in 2011 (ish -- that was when we first took Clojure to production), and we switched completely to boot at the end of 2015 (I think, I'd have to go consult my blog to be sure), and then we switched completely to clj/`deps.edn` last year.