[ANN] clojure tools 1.9.0.315, tools.deps.alpha 0.5.342

506 views
Skip to first unread message

Alex Miller

unread,
Jan 23, 2018, 3:37:31 PM1/23/18
to Clojure
clojure tools 1.9.0.315 is now available in brew and via https://clojure.org/guides/getting_started

Highlights:

  * NEW -Stree to print dependency tree
  * NEW -Sdeps to supply a deps.edn on the command line as data
  * FIX bug with git deps using :deps/root writing File objects to libs files

Bozhidar Batsov

unread,
Jan 24, 2018, 7:20:51 AM1/24/18
to clo...@googlegroups.com
How would you suggest running an nREPL server with clj? I want to use the new functionality to just inject nREPL and some middleware as deps and start a REPL server that CIDER could connect to. Basically I want to use it do something like:

lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.17.0-SNAPSHOT\"\] -- repl :headless :host ::... (that's how we boot a CIDER compatible repl with leiningen)

I've got a few ideas, but you might know something that I don't.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Miller

unread,
Jan 24, 2018, 8:56:17 AM1/24/18
to clo...@googlegroups.com
For the deps, you can either create an alias (probably best in ~/.clojure/deps.edn):

{ ...
  :aliases 
  {:nrepl 
    {:extra-deps
      {org.clojure/tools.nrepl {:mvn/version “0.2.13”} 
       cider/cider-nrepl {:mvn/version “0.17.0-SNAPSHOT”}}}}}

Which you’ll activate with clojure -R:nrepl

Or inject them directly on the command line with the new -Sdeps:

clojure -Sdeps “{:deps {org.clojure/tools.nrepl {:mvn/version \“0.2.13\”} cider/cider-nrepl {:mvn/version \“0.17.0-SNAPSHOT\”}}}” 

Then it’s a matter of figuring out whatever setup you need to run a headless nrepl server with the right middleware starting from a main. I’m guessing this probably involves a few lines of code. It’s certainly possible to handle that through some combination of clojure.main’s -m -i -e params or it might be simplest to just write a .clj file and have clojure.main execute that.

One of the things in my queue for the next few weeks is a way to create a main args alias so that may come in handy if it is possible to do it without a script and embed it in the shared aliases.

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/RlHjnJPpFbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

Bozhidar Batsov

unread,
Jan 24, 2018, 9:12:24 AM1/24/18
to clo...@googlegroups.com
Yeah, I was thinking exactly of this - passing some deps as command-line args and running some simply script, that we can bundle with CIDER. I was just wondering if I could do it easy without a script. :-)

At any rate I think that clj will lower the bar to entry significantly for newcomers, as asking people to install something like lein or boot to start playing with the language is a bit too much IMO. 

You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/RlHjnJPpFbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alex Miller

unread,
Jan 24, 2018, 9:26:16 AM1/24/18
to clo...@googlegroups.com
If you had a simple main that could be used to do the startup, that could also be delivered via an extra dep (even a git dep) and could declare tools.nrepl and cider-nrepl as deps itself. Then you would have basically one thing you can add and run. 

Bozhidar Batsov

unread,
Jan 24, 2018, 12:19:16 PM1/24/18
to clo...@googlegroups.com
That's exactly what I'm planning to do. Thanks for the help, Alex! And thanks for working on this!

Alex Miller

unread,
Jan 24, 2018, 12:39:59 PM1/24/18
to clo...@googlegroups.com
Let me know if you find any bugs! :)

Bozhidar Batsov

unread,
Jan 27, 2018, 12:05:10 PM1/27/18
to clo...@googlegroups.com
Well, I might have found one - seems transitive snapshot deps are not handled properly (at least in the version of tools.deps that's shipped with Clojure by default:

clj -Sdeps '{:deps {cider/orchard {:mvn/version "0.1.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"} }}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'

This works, but this doesn't:

clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"} }}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'

As orchard is a dep of cider-nrepl I find it pretty odd. All non-snapshot deps seem to be processed normally. 



Alex Miller

unread,
Jan 27, 2018, 1:07:51 PM1/27/18
to clo...@googlegroups.com
Can you describe what “not works” looks like? Exception? Wrong dep?

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/RlHjnJPpFbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

Bozhidar Batsov

unread,
Jan 27, 2018, 10:06:03 PM1/27/18
to clo...@googlegroups.com
That's what I get if I don't specify the orchard dep explicitly:

Exception in thread "main" java.io.FileNotFoundException: Could not locate orchard/misc__init.class or orchard/misc.clj on classpath., compiling:(cider/nrepl/middleware/pprint.clj:1:1)

You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/RlHjnJPpFbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alex Miller

unread,
Jan 27, 2018, 10:38:58 PM1/27/18
to clo...@googlegroups.com
clj uses the dependencies for the published Maven artifact. The published artifact has a pom with dependencies only on clojure and tools.nrepl, so orchard is not a dependency that is found or can be traversed. Here's an example snapshot pom in clojars, which is what any Maven user of this artifact will see:


It seems that this is related to the use of the mranderson source-deps plugin. The orchard dependency is renamed and included as part of the cider source rather than depending on the actual namespaces. Thus, the cider-nrepl artifact actually contains the orchard namespaces already, but under a name like cider.inlined-deps.orchard.v0v1v0-20180123v122522-8.orchard.misc (note that this is snapshot version specific). 

So, this looks like clj is doing what is expected given the setup for cider-nrepl.

Sean Corfield

unread,
Jan 28, 2018, 7:16:24 PM1/28/18
to clo...@googlegroups.com

[seancorfield/boot-tools-deps “0.2.0”] -- https://github.com/seancorfield/boot-tools-deps

 

Bringing tools.deps functionality to a Boot task!

 

Reads deps.edn files (and EDN from the command line, like clj’s new -Sdeps option), uses tools.deps to resolve dependencies to produce a classpath, and then updates Boot’s resource and source paths, and Boot’s classpath. Optionally updates Boot’s dependencies too (for use by other tasks such as uber). Supports Git and local dependencies (adds them to the source paths after tools.deps has processed them).

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 


From: clo...@googlegroups.com <clo...@googlegroups.com> on behalf of Alex Miller <al...@puredanger.com>
Sent: Tuesday, January 23, 2018 12:37:31 PM
To: Clojure
Subject: [ANN] clojure tools 1.9.0.315, tools.deps.alpha 0.5.342
 
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.

Bozhidar Batsov

unread,
Jan 29, 2018, 4:39:02 AM1/29/18
to clo...@googlegroups.com, woz
Ah, yeah - that's an odd situation that I didn't think about. I guess with clj we'll have to enumerate all the deps explicitly, although this would make the code vulnerable to dependency conflicts (the reason why we're doing this source rewriting to begin with). 

Bozhidar Batsov

unread,
Jan 29, 2018, 5:00:12 AM1/29/18
to clo...@googlegroups.com, woz
My bad. Actually we shouldn't need the deps at all as they're supposed to be inlined in the artefact even now. No idea what exactly's going on here, but I guess we'll sort it out with Benedek. 

David Bürgin

unread,
Jan 29, 2018, 3:55:37 PM1/29/18
to clo...@googlegroups.com
These changes are missing on the master branch at
https://github.com/clojure/brew-install?

Also, in the help text the ‘-Sdeps’ and ‘-Stree’ lines use spaces
instead of tabs which makes the output a bit less tidy.

Sean Corfield

unread,
Jan 29, 2018, 4:13:59 PM1/29/18
to clo...@googlegroups.com

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 


From: clo...@googlegroups.com <clo...@googlegroups.com> on behalf of David Bürgin <dbue...@gluet.ch>
Sent: Monday, January 29, 2018 12:55:05 PM
To: clo...@googlegroups.com
Subject: Re: [ANN] clojure tools 1.9.0.315, tools.deps.alpha 0.5.342
 
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.

Alex Miller

unread,
Jan 29, 2018, 4:20:05 PM1/29/18
to clo...@googlegroups.com
Correct - the current releases are coming out of the 1.9.0 branch. I have (pre 1.9) used master for dev releases, which I have not yet done since 1.9 came out. At some point I will port everything to master and release with a dev version tracking Clojure 1.10.

On the help message, that’s been fixed for the next release. Of course, I noticed it right after I did the release. :)
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/RlHjnJPpFbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

David Bürgin

unread,
Jan 29, 2018, 4:35:09 PM1/29/18
to clo...@googlegroups.com
Ah, I didn’t think of checking other branches, thank you both.

Alex Miller

unread,
Jan 29, 2018, 4:41:55 PM1/29/18
to clo...@googlegroups.com
On Mon, Jan 29, 2018 at 3:34 PM, David Bürgin <dbue...@gluet.ch> wrote:
Ah, I didn’t think of checking other branches, thank you both.

There are tags for all the releases as well which will take you to the right place.

 
Reply all
Reply to author
Forward
0 new messages