Fork me on GitHub
#cider
<
2018-07-18
>
tianshu04:07:03

can I jump to the file when browsing the namespaces? I think this will be much easier than jump file by projectile-find-file.

jumar06:07:33

@U0NBGRGD6 maybe you want to use cider-find-ns instead.

jumar06:07:47

You can also press s when in the browser to jump to the source code of a particular function or a namespace

tianshu07:07:54

yes, this is what I'm looking for.

richiardiandrea04:07:38

@bozhidar @hagmonk what is the status of the boot and nRepl? I am back and tomorrow my time I can check and try to come up with the second function for it if I understand correctly

richiardiandrea04:07:49

Yeah I think so too I was wondering if there is any additional step on either side

bozhidar04:07:58

Getting cider-nrepl to work with nREPL 0.4, so we can finally make the switch and focus on more creative endeavours.

bozhidar04:07:52

Well, unfortunately it’s not going very well. I expected it’d be a trivial rename tasks, but some middlewares (like info and track-state) are currently not working properly, so I’d love some help in debugging the root of the damn problems.

richiardiandrea04:07:58

Uhm ok maybe I can help there then

bozhidar05:07:24

@richiardiandrea That would be much appreciated!

hagmonk05:07:08

I would dive in to help, now that I know roughly how things are laid out, but I have a monster work deliverable due in the next 24 hrs. I’ll check in tomorrow to see if there’s anything I can do.

hagmonk05:07:02

I will add that for asshole grade hangs and/or socket problems, I often lean on jstack or FlameGraphs. Especially the latter, I’ve debugged many perf issues and hangs that way

bozhidar05:07:15

@hagmonk Thanks! I’ll likely wait a couple of days before diving into this again with a fresh mind. What puzzles me the most is how can something break if everything is identical and only the namespace has changed. I see that most middlewares are working just fine, there are just some isolated problems and even though there’s error reporting for each middleware op nothing triggers. I’ve left plenty of notes in the PR, so people won’t have to waste time on the things that I’ve discovered so far.

👍 4
hagmonk05:07:34

LOL, I know that miserable feeling so well, I feel for you! I think the last time I went on such a wild goose chase was because of a Java API returning a primitive bool false which is actually truthy in Clojure because it’s not a java.lang.Boolean. Printing out the value and shouting it’s fucking false, why are you branching like it’s true??? Good times

parens 4
bozhidar05:07:56

Yeah, I’m reasonably sure something like this is going to be at the root of the current problem. 🙂

bozhidar05:07:52

On a related note - can someone help me understand why this simple plugin https://github.com/nrepl/lein-nrepl is raising this error when I try to use it outside its source folder

Exception in thread "main" java.lang.ClassNotFoundException: leiningen.nrepl, compiling:(/private/var/folders/f0/cm24s0qd0s5cch5jvj6ctnb00000gn/T/form-init15686757270206144100.clj:1:126)
Seems that the plugin can’t find its only namespace which looks quite bizarre to me.

hagmonk06:07:07

@bozhidar you could try using fs_events (on Mac, can’t remember command on Linux) to discover the path it’s trying to reach … or see what’s in that temporary .clj file to check for clues there. Reminds me of the weird errors you get if you try to (compile ‘foobar) and the foobar namespace exists, but the target folder (“classes” by default) does not - you just get an error about not finding a file

hagmonk06:07:52

Indeed since this error is thrown when compiling, I wonder if that is related … just a guess …

bozhidar06:07:16

@hagmonk Hmm, I don’t see an fs_events command. I guess I’ll google around for it.

bozhidar06:07:46

It’s a pity that temp file gets deleted after the compilation failure, so I can’t easily peek into it.

hagmonk06:07:00

@bozhidar oh I’m sorry, you want sudo fs_usage -w

hagmonk06:07:32

If you do man -k dtrace there are some other occasionally handy tools. For instance, execsnoop and newproc let you trace transient processes. Often handy in cases where tools are spawning other tools, or you suspect they might be

tangrammer08:07:20

Hi ciders! I’m wondering why I’m getting this error command-execute: Wrong type argument: commandp, cider-find-var when i try cider-find-var with M-. debugging a bit the code I had to explicitly add (require 'cider-find) to cider-browse-ns.el to get it running again …. does it make sense? I’m using … https://github.com/clojure-emacs/cider/commit/82d379c2c5be5bf061931ed29bf95b3cf5440c14 with GNU Emacs 25.3.1 (x86_64-apple-darwin16.4.0, NS appkit-1504.81 Version 10.12.3 (Build 16D32)) of 2018-05-24

dominicm08:07:56

I think I've figured out how to get dynamic dependency loading working with nrepl again 🙂

jumar08:07:10

@U09LZR36F that's great! Any details?

dominicm08:07:40

I just need to set a context class loader in the right spot 🙂 and I know where that is, just testing. The patch is horribly short, like 10 loc max.

dominicm08:07:23

I'm saying it works based on tools.deps.alpha, alembic may need to change a little, I'm not sure on how it works exactly.

jumar08:07:34

I'm looking forward to having this in master 🙂.

dominicm08:07:28

network-repl
Clojure 1.9.0
user=> (use 'clojure.tools.deps.alpha.repl)
nil
user=> (add-lib 'org.clojure/core.memoize {:mvn/version "0.7.1"})
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.pom from 
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.pom from 
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.pom from 
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.jar from 
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.jar from 
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.jar from 
true
user=> (require 'clojure.core.memoize)
nil
Promising result!

bozhidar08:07:40

Great news!

bozhidar08:07:09

I think that alembic is pretty much dead at this point (I know refactor-nrepl plans to replace it with pomegranate), and there’s also a promising PR there https://github.com/cemerick/pomegranate/pull/102

dominicm08:07:21

I don't think that PR would be necessary if my changes are merged. But it could be useful on it's own.

dominicm09:07:40

https://github.com/nrepl/nREPL/pull/35 builds are passing, looks good 🙂 I can try pomegranate I guess 🙂

dominicm08:07:28

network-repl
Clojure 1.9.0
user=> (use 'clojure.tools.deps.alpha.repl)
nil
user=> (add-lib 'org.clojure/core.memoize {:mvn/version "0.7.1"})
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.pom from 
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.pom from 
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.pom from 
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.jar from 
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.jar from 
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.jar from 
true
user=> (require 'clojure.core.memoize)
nil
Promising result!

bozhidar08:07:40

@tangrammer How did you install CIDER? cider-find-var is an autoloaded command, so probably in your case something’s wrong with your autoloads. package.el generates those automatically, but perhaps you installed CIDER differently.

tangrammer09:07:08

Hi Bozhidar! here you are 🙂

(add-to-list 'load-path "~/git/tangrammer/sesman") ;; boths locally cloned 

 (add-to-list 'load-path "~/git/tangrammer/cider")

 (require 'cider)

tangrammer09:07:05

:thinking_face:

tangrammer09:07:06

sorry about the noise! I thought i have read this doc part 😬

bozhidar09:07:02

No problem! Finally someone who managed to solve their problem by reading the manual! 🙂

tangrammer09:07:16

now I’m feeling proud of it

dominicm17:07:21

@bozhidar how should I be building your PR? I'm getting orchard.misc related issues trying to run your build

dominicm17:07:39

Caused by: java.io.FileNotFoundException: Could not locate orchard/misc__init.class or orchard/misc.clj on classpath.
    at clojure.lang.RT.load(RT.java:463)
    at clojure.lang.RT.load(RT.java:426)
    at clojure.core$load$fn__6548.invoke(core.clj:6046)
    at clojure.core$load.invokeStatic(core.clj:6045)
    at clojure.core$load.doInvoke(core.clj:6029)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5848)
    at clojure.core$load_one.invoke(core.clj:5843)
    at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
    at clojure.core$load_lib.invokeStatic(core.clj:5887)
    at clojure.core$load_lib.doInvoke(core.clj:5868)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$load_libs.invokeStatic(core.clj:5925)
    at clojure.core$load_libs.doInvoke(core.clj:5909)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:659)
    at clojure.core$require.invokeStatic(core.clj:5947)
    at clojure.core$require.doInvoke(core.clj:5947)
    at clojure.lang.RestFn.invoke(RestFn.java:619)
    at cider.nrepl.middleware.pprint$eval1518$loading__6434__auto____1519.invoke(pprint.clj:1)
    at cider.nrepl.middleware.pprint$eval1518.invokeStatic(pprint.clj:1)
    at cider.nrepl.middleware.pprint$eval1518.invoke(pprint.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7062)
    at clojure.lang.Compiler.eval(Compiler.java:7051)
    at clojure.lang.Compiler.load(Compiler.java:7514)

bozhidar17:07:39

Can’t imagine why. I just run lein install in that brach and that’s all. I don’t even apply MrAnderson when doing my tests.

dominicm17:07:15

lein install? But doesn't that bypass Mr. Anderson?

dominicm17:07:28

I thought ./build.sh install or make install was necessary.

bozhidar17:07:40

Yes, it does, but that shouldn’t be an issue.

bozhidar17:07:53

(unless you have some conflicting libs in project you’ll be just fine)

dominicm17:07:01

It seems that Mr. Anderson isn't working correctly for that branch though.

bozhidar17:07:57

~/p/cider-nrepl ❯❯❯ ./build.sh install                                                                                                                                                                                                                                nrepl-0.4
project prefix:  cider.inlined-deps
retrieve dependencies and munge clojure source files
  retrieving profile artifact.
  retrieving tools.trace artifact.
  retrieving puget artifact.
    prefixing imports in clojure files in 'target/srcdeps/puget' ...
    prefixing imports in clojure files in 'target/srcdeps/puget/color' ...
  retrieving arrangement artifact.
    prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/puget/v1v0v2' ...
  retrieving compliment artifact.
    prefixing imports in clojure files in 'target/srcdeps/compliment' ...
    prefixing imports in clojure files in 'target/srcdeps/compliment/sources' ...
  retrieving cljs-tooling artifact.
    prefixing imports in clojure files in 'target/srcdeps/cljs_tooling' ...
    prefixing imports in clojure files in 'target/srcdeps/cljs_tooling/util' ...
  retrieving cljfmt artifact.
    prefixing imports in clojure files in 'target/srcdeps/cljfmt/indents' ...
  retrieving rewrite-clj artifact.
    prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/cljfmt/v0v5v7' ...
  retrieving rewrite-cljs artifact.
    prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/cljfmt/v0v5v7' ...
  retrieving orchard artifact.
    prefixing imports in clojure files in 'target/srcdeps/orchard' ...
  retrieving dynapath artifact.
    prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/orchard/v0v3v0' ...
  retrieving fipp artifact.
    prefixing imports in clojure files in 'target/srcdeps/fipp' ...
  retrieving core.rrb-vector artifact.
    prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/fipp/v0v6v12' ...
  retrieving tools.namespace artifact.
    prefixing imports in clojure files in 'target/srcdeps/clojure/tools/namespace' ...
  retrieving java.classpath artifact.
  retrieving tools.reader artifact.
    prefixing imports in clojure files in 'target/srcdeps/cljs/tools/reader' ...
    prefixing imports in clojure files in 'target/srcdeps/cljs/tools/reader/impl' ...
    prefixing imports in clojure files in 'target/srcdeps/clojure/tools/reader' ...
    prefixing imports in clojure files in 'target/srcdeps/clojure/tools/reader/impl' ...
Created /Users/bozhidar/projects/cider-nrepl/target/cider-nrepl-0.19.0-SNAPSHOT.jar
Wrote /Users/bozhidar/projects/cider-nrepl/pom.xml
Installed jar and pom into local repo.

bozhidar17:07:23

Works fine for me. Nothing really changed, so I can’t imagine what can be affecting it (compared to master).

dominicm17:07:40

The build works, but when I try to run it, it blows up

bozhidar17:07:37

Tried the build - works for me.

bozhidar17:07:49

I’ll just push it to clojars now, so you can get it from there if you want.

dominicm17:07:05

Seems to work, now I'm double suspicious 😛

bozhidar17:07:56

As you should be…

dominicm17:07:37

Having looked a little, I think lein-nrepl#1 has the right idea, you need to add a dep to the project

dominicm17:07:47

the plugin example in the lein docs is even about adding a swank dependency to the project!