Fork me on GitHub
#tools-deps
<
2018-03-13
>
mhuebert07:03:40

trying clojure.tools.gitlibs, I get a failure loading slf4j:

user=> (require '[clojure.tools.gitlibs :as gl])
nil
user=> (gl/resolve "" "cc1305534b1371df3962fd46503dd0478d81a08a")
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.
NullPointerException   clojure.string/starts-with? (string.clj:364)

mhuebert07:03:20

adding slf4j-simple to class path resolves that warning but doesn’t affect the error

mhuebert07:03:07

ok, I removed the braintripping directories from ~/.gitlibs/_repos (inside <mailto:[email protected]|[email protected]> and http://github.com) and now it works

mhuebert07:03:39

maybe there was some corrupt thing there

mhuebert07:03:35

unfortunately I can’t find a way to reproduce this now

mhuebert07:03:27

oh, now i’ve got it. found the old dir in the trash.

mhuebert07:03:11

well, that is simple.

mhuebert07:03:34

Reproduction steps: 1. create an empty directory at ~/.gitlibs/_repos/github.com/<user>/<repo> 2. try loading any version of with deps => NullPointerException

mhuebert07:03:22

my original empty dir was somehow created by gitlibs, maybe while I was trying to figure out how to properly specify a root dir

Alex Miller (Clojure team)13:03:27

If you want to file a jira at https://dev.clojure.org/jira/browse/TDEPS I’m sure that can be improved

dominicm13:03:15

I need to write my jira from last yesterday

bhauman20:03:22

if clojure.main referenced a *main-repl-fn*

bhauman20:03:43

then we could set that with an -e "(set! clojure.main/*main-repl-fn* rebel-readline.main/repl)"

bhauman20:03:59

and then bobs your uncle

Alex Miller (Clojure team)20:03:56

clojure.main is in Clojure, so this would require a change in Clojure 1.10. I think ultimately we’ll want a change that does something like that. But I’d like to look at a shorter range version.

dominicm20:03:14

I feel like I'm missing some context?

bhauman20:03:12

@dominicm I was just trying to think of a lightweight way for clj to inject rebel-readline, adding an inline dep and extra e arg would be easy

seancorfield20:03:29

Currently, I have

:rebel {:extra-deps {com.bhauman/rebel-readline {:mvn/version "RELEASE"}}
          :main-opts ["-m" "rebel-readline.main"]}
in my ~/.clojure/deps.edn file and just say clj -A:rebel when I want a rebel REPL...

dominicm20:03:46

yeah, I have that, but I namespaced it as :user/rebel.

bhauman20:03:49

but that doesn't help clj

dominicm20:03:14

OH. You mean for including rebel in clj?

dominicm20:03:33

:thinking_face: does rebel have any dependencies

bhauman20:03:24

extremely flat, tools reader is the only one I still want to get rid of

bhauman20:03:53

that requires me writing my own indenting code

bhauman20:03:11

after that there would be no deps besides Jline of course

dominicm20:03:35

I mean, you could use Mr. Anderson to package it?

bhauman21:03:08

oh interesting, didn't know about that

dominicm21:03:45

Shading is a pretty cool thing 🙂

dominicm22:03:51

@seancorfield do you have your handy snippet for clj + socket server?

seancorfield22:03:35

This one?

:socket {:jvm-opts ["-Dclojure.server.repl={:port,5555,:accept,clojure.core.server/repl}"]}

dominicm22:03:03

clj -J-Dclojure.server.repl={:port,5555,:accept,clojure.core.server/repl} -A:dev:build is giving me

Caused by: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
        at clojure.lang.RT.seqFrom(RT.java:547)
        at clojure.lang.RT.seq(RT.java:527)
        at clojure.lang.APersistentMap.cons(APersistentMap.java:40)
        at clojure.lang.RT.conj(RT.java:667)
        at clojure.core$conj__4932.invokeStatic(core.clj:85)
        at clojure.core$merge$fn__5498.invoke(core.clj:3029)
        at clojure.core$reduce1.invokeStatic(core.clj:936)
        at clojure.core$reduce1.invokeStatic(core.clj:926)
        at clojure.core$merge.invokeStatic(core.clj:3028)
        at clojure.core.server$parse_props$fn__8321.invoke(server.clj:149)
        at clojure.core.protocols$naive_seq_reduce.invokeStatic(protocols.clj:62)
        at clojure.core.protocols$interface_or_naive_reduce.invokeStatic(protocols.clj:72)
        at clojure.core.protocols$fn__7665.invokeStatic(protocols.clj:168)
        at clojure.core.protocols$fn__7665.invoke(protocols.clj:124)
        at clojure.core.protocols$fn__7620$G__7615__7629.invoke(protocols.clj:19)
        at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
        at clojure.core.protocols$fn__7642.invokeStatic(protocols.clj:75)
        at clojure.core.protocols$fn__7642.invoke(protocols.clj:75)
        at clojure.core.protocols$fn__7594$G__7589__7607.invoke(protocols.clj:13)
        at clojure.core$reduce.invokeStatic(core.clj:6704)
        at clojure.core.server$parse_props.invokeStatic(server.clj:143)
        at clojure.core.server$start_servers.invokeStatic(server.clj:154)
        at clojure.core.server$start_servers.invoke(server.clj:154)
        at clojure.lang.Var.invoke(Var.java:381)
        at clojure.lang.RT.doInit(RT.java:486)
        at clojure.lang.RT.<clinit>(RT.java:333)
        ... 1 more
java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT
        at clojure.lang.PersistentQueue.pop(PersistentQueue.java:113)
        at clojure.lang.PersistentQueue.pop(PersistentQueue.java:25)
        at clojure.lang.Agent$Action.doRun(Agent.java:149)
        at clojure.lang.Agent$Action.run(Agent.java:163)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
which is interesting

dominicm22:03:43

Works in ~/.clojure/deps.edn though.

seancorfield22:03:52

You need "..." around it.

seancorfield22:03:02

clj -J"-Dclojure..."

seancorfield22:03:41

Or this

clj -J-Dclojure.server.repl="{:port,5555,:accept,clojure.core.server/repl}"

dominicm22:03:03

I did the latter originally. But I got the above error.

seancorfield22:03:44

(! 614)-> clj -J-Dclojure.server.repl="{:port,5555,:accept,clojure.core.server/repl}"
Clojure 1.9.0
user=> ^D

Tue Mar 13 15:32:30
(sean)-(jobs:0)-(~/clojure/lsnape)
(! 615)-> clj -J-Dclojure.server.repl={:port,5555,:accept,clojure.core.server/repl}
Exception in thread "main" java.lang.ExceptionInInitializerError
	at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol

seancorfield22:03:03

I get the exception without the quotes -- but it works with quotes as seen above.

dominicm22:03:12

I'll explore it later. ¯\(ツ)