Fork me on GitHub
#tools-deps
<
2019-01-31
>
seancorfield05:01:24

I just updated my .clojure/deps.edn file on GitHub to add REBL support etc https://github.com/seancorfield/dot-clojure/commit/66f2b8fe1d1fd44ba42c79cd9489e7ac620e5fef

borkdude21:01:27

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

dominicm21:01:52

Nope! Why do you ask?

borkdude21:01:34

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

dottedmag21:01:28

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

borkdude21:01:46

yup, can do it like that

unbalanced21: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?

lilactown22:01:54

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

lilactown22:01:22

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

unbalanced22:01:54

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

alexmiller22:01:17

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

alexmiller22:01:34

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

alexmiller22:01:54

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

unbalanced22:01:56

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

unbalanced22:01:14

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

alexmiller22:01:16

^^ some tools

alexmiller22:01:20

no one idea what build.clj is

alexmiller22:01:34

but it’s not deps.edn / clj

lilactown22:01:15

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

unbalanced22:01:17

here's the only example I can find

lilactown22:01:30

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

unbalanced22:01:09

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

lilactown22:01:54

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

unbalanced22: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

lilactown22:01:21

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

lilactown22:01:28

ah yep. same for uberjars

unbalanced22:01:58

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

alexmiller22:01:49

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

unbalanced22:01:22

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

unbalanced22:01:05

thanks everyone for fielding questions πŸ˜„

lilactown22:01:23

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

alexmiller22:01:09

they are certainly convenient as a unit of deployment

unbalanced22:01:23

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

lilactown22:01:37

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 Β―\(ツ)/Β―

alexmiller22:01:24

AOT is orthogonal

πŸ‘ 1
seancorfield22:01:56

@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).

seancorfield23:01:48

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.

unbalanced23:01:53

gotcha (worth a lot, as always!)

seancorfield23:01:06

We do not AOT anything.

seancorfield23:01:27

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.