This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-13
Channels
- # aleph (1)
- # beginners (105)
- # boot (6)
- # cider (9)
- # cljs-dev (61)
- # cljsrn (59)
- # clojure (132)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-russia (18)
- # clojure-spec (1)
- # clojure-uk (58)
- # clojurescript (56)
- # core-async (1)
- # cursive (17)
- # datomic (20)
- # docs (1)
- # duct (5)
- # editors (1)
- # emacs (7)
- # events (2)
- # figwheel (7)
- # fulcro (30)
- # graphql (8)
- # jobs (3)
- # leiningen (23)
- # luminus (14)
- # mount (6)
- # off-topic (41)
- # onyx (14)
- # protorepl (2)
- # re-frame (7)
- # reagent (32)
- # shadow-cljs (236)
- # tools-deps (92)
- # unrepl (8)
- # vim (60)
- # yada (1)
What does a runtime
scope mean for Maven?
Itโs for running things :)
But not needed to compile
Is the classpath assembled for a deps.edn based project intended to get it only as far as compilation? I hit this problem through a transient dependency, and I actually had to use lein deps :tree
to discover the problem, because tools.deps.alpha completely filtered out the existence of the transient dependency
yeah, thereโs a ticket for this already
feel free to add your vote
@richiardiandrea made me do it!
clj -Sdeps '{:deps {seancorfield/clj-new {:git/url "" :sha "653441d86834160124a94065c4d92a4a9ad12554"}}}' -m clj-new.create app myapp/clj-test
The beginnings of a clj
-based new project template generator...So, I can just do clj -m clj-new.create figwheel myapp
and it'll bring in the leiningen template and build it?
When I do clj -Sdeps '{:deps {seancorfield/clj-new {:git/url "
I get
Failed with: Failed to read artifact descriptor for figwheel:lein-template:jar:RELEASE
Exception in thread "main" clojure.lang.ExceptionInfo: Could not load artifact for template: figwheel
Tried coordinates:
[figwheel/boot-template "RELEASE"]
[figwheel/lein-template "RELEASE"] {}
at clojure.core$ex_info.invokeStatic(core.clj:4754)
at clojure.core$ex_info.invoke(core.clj:4754)
...
All in clj
;)
As noted, work in progress. Needs more work before it can do more than the built-in templates. But, yes, the plan is that will work.
I think that fails because I haven't set up the full clj
environment for t.d.a. yet (in particular the repos).
@john OK,
clj -Sdeps '{:deps {seancorfield/clj-new {:git/url "" :sha "a87bdc0347fe1523e8d85283d94b06f5dd68b2cb"}}}' -m clj-new.create figwheel figfig
This should work now!
I plan to add clj-template
support soon, so we can have clj
templates that produce deps.edn
-based projects.
let me try macchiato
works! awesome ๐
(it currently generates boot templates by default -- but it should be able to generate any Leiningen template too)
I spent far too long last night writing an ANSI parser, I feel the sentiment quite hard right now :)

someone dropped a docker command to spin a linux box for testing clj installs here a couple weeks ago - anyone have that handy?
I wasnโt only going to only use it
apt-get update
apt-get install -y rlwrap curl
export CLOJURE_VERSION=1.9.0.341 && curl -O && /bin/bash linux-install-${CLOJURE_VERSION}.sh
although for the purposes of installing clojure, it looks like the getting started guide recommends root anyway
@alexmiller these two things should do or do you want a built image?
Running the script as non-root is the important part, to ensure that OS permissions are correctly set
Now with @bhauman power up mode: docker run -ti openjdk:8 bash -c "$(curl
I have a docker container internally that already has a .cpcache for fast rebel readline startup in a container :) Useful for when I need a totally clean slate
@dominicm curious what you think about https://dev.clojure.org/jira/browse/TDEPS-64
do you think the prefix dir should be created if it doesnโt exist?
with the TDEPS-65 patch for the linux install, it will be created if it doesnโt exist
I think Iโm ok with that behavior
See no reason not to add a guard if we want to ensure that the prefix exists already. I suppose it's keeping with other tools to not create leading directories by default. I ignored that comment because I was fairly certain that the current behavior didn't follow that.
I'd actually argue, just from memory and experience, that directories should be created if it they don't already exist. I can't recall the last time I supplied any directory or prefix argument to a tool and then thought "shoot, I have to manually make that directory"
this is mostly an issue for when you are supplying the prefix dir
right, I'd expect that if I supply the prefix dir, it will be created if it doesn't exist
they definitely mkdir -p, although they do it in the most gloriously overwrought tradition of GNU autotools:
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
Question about classloaders -- when I run code with clj -m ...
should I be able to get at a modifiable classloader?
It seems that when you're in the REPL, you have a DynamicClassLoader from Clojure, but when running via -m
you only have sun.misc.Launcher$AppClassLoader and sun.misc.Launcher$ExtClassLoader neither of which are modifiable...
The goal should be to act like a normal Linux program. Regardless of whether we expect those behaviours ourselves.
Well, to dynamically load Leiningen templates at runtime, I need a modifiable classloader... for now I've made one (`clojure.lang.RT/makeClassLoader`) and stuffed it back into the current thread.
Anyone happen to know what package org.sonatype.aether.collection.DependencyGraphTransformer
is part of? When I try to load leiningen-core
via t.d.a. this doesn't seem to get loaded...
NM, figured it out.
@john OK,
clj -Sdeps '{:deps {seancorfield/clj-new {:git/url "" :sha "a87bdc0347fe1523e8d85283d94b06f5dd68b2cb"}}}' -m clj-new.create figwheel figfig
This should work now!
Qualified project names do not work (they don't work in boot-new
either).
Other known issues https://github.com/seancorfield/clj-new/issues
I plan to add clj-template
support soon, so we can have clj
templates that produce deps.edn
-based projects.
I'll work on it more over the weekend and make an official announcement on Monday I expect.
Don't have to say how cool this is, no more lein
or boot
for template generation is a boon for lumo
projects
might want to add that to https://github.com/clojure/tools.deps.alpha/wiki/Tools
new tools.deps.alpha 0.5.425 is out. new installers working their way through the meat grinder
mostly just bug fix releases for both, Iโll do a ggroups announcement when brew is done
I'll add it to the tools page after it's had some polish this weekend. There are a few issues (opened on GH!) that need addressing before it's ready for real world users! ๐
clj -A:new
right? ๐
(or does it support omitting the leading :
now?)
I have put it directly in my :deps
in ~/.clojure/deps.edn
Yeah, this works for me:
...
:aliases
{:new {:main-opts ["-m" "clj-new.create"]
:extra-deps
{seancorfield/clj-new {:git/url ""
:sha "a87bdc0347fe1523e8d85283d94b06f5dd68b2cb"}}}
...
Adding this magic entry to ~/.clojure/deps.edn
, or a project deps.edn
, seems like something that could be written as a useful tool, similar to npm install
or yarn add
or whatnot - typing all of this info is slightly too annoying right now for use in shell scripts / one-liners IMHO
I'm thinking it might become a general injector eventually which you can then do clj -A:user/inject new
to inject into deps.edn
I intentionally wrote the code to be a little lax on that leading colon so itโs optional
clj-new
SHA "87d175c5e49618fffe8ed16b1bf86aa6f0fbc624"
-- https://github.com/seancorfield/clj-new/blob/master/README.md -- a whole bunch of clean up, refactoring, and rewriting the default project templates.
The built in templates now generate projects with deps.edn
files
$ clj -A:new app myapp
$ cd myapp
$ clj -m myapp.core
Hello World!
$ clj -A:test:runner
...FIXME test failure...
Adding this magic entry to ~/.clojure/deps.edn
, or a project deps.edn
, seems like something that could be written as a useful tool, similar to npm install
or yarn add
or whatnot - typing all of this info is slightly too annoying right now for use in shell scripts / one-liners IMHO