Fork me on GitHub
#tools-deps
<
2019-08-06
>
dharrigan12:08:28

Pulling in tools.deps.alpha via a git/url hash, to access the branch that allows me to load in a jar from the repl

dharrigan12:08:38

I'm also using slf4j

dharrigan12:08:47

My logs stopped working (i.e., output)

dharrigan12:08:08

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/david/.m2/repository/org/slf4j/slf4j-nop/1.6.2/slf4j-nop-1.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/david/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See  for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]

dharrigan12:08:20

according to the doc, the choice is totally random

dharrigan12:08:33

why does deps include the nop static binding?

dharrigan12:08:56

I can't exclude it, like I can if I'm doing "mvn/version"

dharrigan12:08:02

(using :exclusions)

dharrigan12:08:42

org.clojure/tools.deps.alpha  d0b33e0
...
...
chopped for brevity
...
    org.slf4j/slf4j-nop 1.6.2

dharrigan12:08:10

From the slf4j doc

dharrigan12:08:12

The warning emitted by SLF4J is just that, a warning. Even when multiple bindings are present, SLF4J will pick one logging framework/implementation and bind with it. The way SLF4J picks a binding is determined by the JVM and for all practical purposes should be considered random. As of version 1.6.6, SLF4J will name the framework/implementation class it is actually bound to.

Alex Miller (Clojure team)12:08:36

I think we have a ticket for this, probably need to stop including that

dharrigan12:08:00

Yes please! Having a library link in the static binding ain't right 🙂

Alex Miller (Clojure team)12:08:20

Why did the exclusion not work?

dharrigan12:08:29

not supported, according to the docs:

dharrigan12:08:01

you can for maven coordinates, but not for git coordinates

dharrigan12:08:32

org.clojure/tools.deps.alpha {:git/url ""
                                      :sha "d0b33e0d346736aa985c150145b332f97b92135e"
                                      :exclusions ["org.slf4j/jcl-over-slf4j"
                                                   "org.slf4j/slf4j-nop"] }}}

Alex Miller (Clojure team)12:08:50

Should be a symbol, not a string

dharrigan12:08:32

ah good spot

dharrigan12:08:33

that worked, after rm -rf'ing my .cpcache dir

dharrigan12:08:19

ta very much, but still, I think the nop should be excluded totally, may catch others out 😉

rickmoynihan13:08:43

Hey a new colleague is getting the following error when resolving a git dep in a private github repo. Not sure what to do… I’ve seen the ticket https://clojure.atlassian.net/projects/TDEPS/issues/TDEPS-91 which looks relevant.

rickmoynihan13:08:24

Her ssh key appears to be the same version as mine which works…

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,xxxx

rickmoynihan13:08:03

she’s also running ssh-agent and has added the key

Alex Miller (Clojure team)13:08:41

so ssh-add -l lists her identity?

Alex Miller (Clojure team)13:08:33

and I assume she does actually have access to the git repo (can access via git)

Alex Miller (Clojure team)13:08:16

I've found on mac that I had a setting in my ~/.ssh/config under "Host *" that had a setting for IdentityFile or something like that which I had to delete

rickmoynihan13:08:18

yes to both of those

Alex Miller (Clojure team)13:08:04

my ssh config looks like:

Alex Miller (Clojure team)13:08:08

Host *
 AddKeysToAgent yes
 UseKeychain yes

rickmoynihan13:08:35

thanks @alexmiller dropping IdentityFile works

Alex Miller (Clojure team)13:08:48

I added that to that jira issue in a comment

rickmoynihan13:08:25

:thumbsup: my future self with thank you again for that

Alex Miller (Clojure team)13:08:06

ditto, I had to look it up (again)

rgm14:08:58

@alexmiller 🎉 … private deps seem to be working for me now

rgm14:08:07

(to be clear, this is just a general man-are-there-ever-a-lot-of-moving-parts-to-auth gripe, not a tools.deps gripe 🙂)

zane18:08:31

I'm curious how y'all are switching between different Java versions when using clj and clojure.

Alex Miller (Clojure team)18:08:09

hint: the answer has nothing to do with clj and clojure :)

Alex Miller (Clojure team)18:08:23

they just use whatever java is on the path

Alex Miller (Clojure team)18:08:23

so to rephrase, how are y'all switching between Java versions on your OS of choice?

zane18:08:03

> they just use whatever java is on the path Got it. So that means that clj and clojure will ignore the version set by, for example, jenv?

zane18:08:09

I suppose since jenv works by providing a java shim it ought to still work provided that the jenv shim is the first java on the path. :thinking_face:

Alex Miller (Clojure team)18:08:51

I don't know what jenv does but that seems right

zane18:08:34

Thank you! 🙂

seancorfield19:08:02

@zane I set JAVA_HOME to point to the JDK installation that I want to use...

(! 586)-> JAVA_HOME=$OPENJDK11_HOME clj
Clojure 1.10.1
user=> (System/getProperty "java.version")
"11.0.1"
user=> ^D

Tue Aug 06 12:16:46
(sean)-(jobs:0)-(~/clojure)
(! 587)-> JAVA_HOME=$OPENJDK8_HOME clj
Clojure 1.10.1
user=> (System/getProperty "java.version")
"1.8.0_192"
user=> 

zane21:08:26

Hey Sean, thanks for sharing your process! This only changes the JAVA_HOME for the command that follows, right? (Or for the shell that does the export if export is included.)

seancorfield21:08:54

Just for that command, yes. Which is why it's nice for testing.

4
zane21:08:58

Makes a ton of sense for testing. I've done that myself.

zane21:08:01

The particular use case I'm solving for is when I have a long-running Emacs process that occasionally launches clojure processes via cider-jack-in.

zane21:08:30

In that case setting JAVA_HOME in the shell won't result in it getting picked up by the already-running Emacs process.

seancorfield22:08:06

But you could get Emacs to set the env var for the invocation of clojure by changing the command line it uses?

zane22:08:20

If I'm understanding you correctly, probably? Would require delving deeper into Cider than I want to do right now. 🙂

Ahmed Hassan14:08:41

@zane you can connect to running clojure process by using cider-connect-clj

Ahmed Hassan14:08:11

Similarly for ClojureScript you can use cider-connect-cljs

zane14:08:33

Yes, I'm aware. I prefer to let Cider launch Clojure because choosing compatible versions of all the middleware can be difficult. But thank you! 🙂

🙂 4
seancorfield16:08:04

"because choosing compatible versions of all the middleware can be difficult" -- a big part of why I stopped using Emacs/CIDER/nREPL

Ahmed Hassan16:08:08

@U04V70XH6 What do you use now?

seancorfield16:08:47

I switched from Emacs to Atom/ProtoREPL and then to Atom/Chlorine. I can connect Atom/Chlorine to any Clojure process since it only requires a Socket REPL.

seancorfield16:08:42

(so I can, and do, connect Atom/Chlorine to QA and production processes that were configured to start a Socket REPL using JVM options -- no dependencies needed in the project, no logic to start a custom REPL)

Ahmed Hassan16:08:37

How is experience of Atom/Chlorine as compared with Cider/Emacs?

seancorfield16:08:17

I find it a lot smoother and a lot less "fiddly". I talked a bit about why I switched from Emacs in this blog post https://corfield.org/blog/2018/12/19/atom-chlorine/

❤️ 4
zane17:08:14

Yeah. I can understand why people make that switch, though for me it wouldn't be worth it.

dominicm20:08:28

I think the way voidlinux does it is neat. JAVA_HOME points at a symlink, and xbps-alternatives changes the symlink.

dharrigan21:08:24

I use arch, so I do sudo archlinux-java set java-12-openjdk

dharrigan21:08:40

or sudo archlinux-java set java-8-openjdk