Closed twashing closed 8 years ago
Looks like this is due to the following snippet, at the end of print_method.clj:
(when (resolve 'clojure.core/deref-as-map)
(def-print-method clojure.lang.IDeref c
"#" (deref-name c) "["
(pr-str (#'clojure.core/deref-as-map c))
(format " 0x%x]" (System/identityHashCode c))))
Now I realise that this code does not do what it's supposed to. I will change it to the following:
(when-let [f (resolve 'clojure.core/deref-as-map)]
(def-print-method clojure.lang.IDeref c
"#" (deref-name c) "["
(pr-str (f c))
(format " 0x%x]" (System/identityHashCode c))))
However, that still doesn't answer the question of why the problem comes up for you with Alembic. If this function was defined for you when you started the REPL, why is it suddenly gone when you reload with Alembic? Could it be a bug in Alembic due to the fact that the function is private?
Sweet - thanks for looking at this. And I'm wondering the same thing, as to why it shows up when using Alembic.
But I'm keen to get this cider-nrepl
update. Ping me when you cut a next release. Thanks again!
Already did ;-) You may need to force lein to redownload somehow. I think it only checks once a day.
With the same setup and cider-nrepl "0.12.0-SNAPSHOT", I get this slightly different error. This time while trying to compile _cider/nrepl/middleware/pprint.clj_. Looks like some _cider/inlined_deps/fipp/v0v6v4/fipp/edn.clj_ file is trying to be called. Is this to be expected?
Here's the main bits. But I've put the full stacktrace in this pastebin.
user=> (require '[alembic.still])
user=> (alembic.still/load-project)
user=> clojure.core/eval core.clj: 3105
...
user/eval29206 REPL Input
alembic.still/load-project still.clj: 332
alembic.still/load-project still.clj: 330
...
classlojure.core/eval-in* core.clj: 68
classlojure.core/eval-in* core.clj: 74
classlojure.core/eval-in*/print-read-eval core.clj: 72
...
classlojure.core/invoke-in* core.clj: 50
classlojure.core/invoke-in* core.clj: 54
...
clojure.core$eval256.invoke NO_SOURCE_FILE
clojure.core/eval core.clj: 2927
...
clojure.core$eval1337.invoke NO_SOURCE_FILE
leiningen.core.project/read project.clj: 943
leiningen.core.project/read project.clj: 942
leiningen.core.project/init-project project.clj: 876
leiningen.core.project/activate-middleware project.clj: 769
leiningen.core.project/apply-middleware project.clj: 738
clojure.core/reduce core.clj: 6289
clojure.core.protocols/fn/G protocols.clj: 13
clojure.core.protocols/fn protocols.clj: 54
clojure.core.protocols/seq-reduce protocols.clj: 31
clojure.core.protocols/fn/G protocols.clj: 19
clojure.core.protocols/fn protocols.clj: 143
leiningen.core.project/apply-middleware project.clj: 742
...
...
java.io.FileNotFoundException: Could not locate cider/inlined_deps/fipp/v0v6v4/fipp/edn__init.class or cider/inlined_deps/fipp/v0v6v4/fipp/edn.clj on classpath:
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate cider/inlined_deps/fipp/v0v6v4/fipp/edn__init.class or cider/inlined_deps/fipp/v0v6v4/fipp/edn.clj on classpath: , compiling:(cider/nrepl/middleware/pprint.clj:1:1)
java.lang.reflect.InvocationTargetException:
On a slightly different subject, what are you using alembic for? Is it just to reload your project?
Correct. I'm using alembic.still/load-project . On Mar 5, 2016 5:06 AM, "Artur Malabarba" notifications@github.com wrote:
On a slightly different subject, what are you using alembic for? Is it just to reload your project?
— Reply to this email directly or view it on GitHub https://github.com/clojure-emacs/cider-nrepl/issues/309#issuecomment-192640185 .
Would it be enough to use cider-refresh instead?
I think cider-refresh
just reloads all modified Clojure files on the classpath. Using alembic's load-project
, I can have a running repl, add a new jar to my project, and dynamically load that in, without having to start a new repl. It's pretty handy.
I see. And does it work if you just import the Java class after adding the Jar to your path?
Hmm, well this is interesting. Importing the package went well.
user> (import '[cider.inlined_deps.fipp.v0v6v4.fipp.edn])
nil
But trying to require in (require '[cider.inlined_deps.fipp.v0v6v4.fipp.edn :as ee])
, gave the error:
Show: Clojure Java REPL Tooling Duplicates All (8 frames hidden)
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling *cider-repl thing* at (150:6)
1. Caused by java.lang.Exception
namespace 'cider.inlined_deps.fipp.v0v6v4.fipp.edn' not found after loading
'/cider/inlined_deps/fipp/v0v6v4/fipp/edn'
core.clj: 5672 clojure.core/load-one
core.clj: 5711 clojure.core/load-lib/fn
core.clj: 5710 clojure.core/load-lib
...
core.clj: 630 clojure.core/apply
core.clj: 1868 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
AFn.java: 22 clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 745 java.lang.Thread/run
This is probably a conflict between alembic and mranderson. But I have no idea if it's actually a bug in any of them.
Hmm, on a fresh lein new thing
project, mranderson doesn't show up when I do a lein deps :tree
.
It's not a dep, it's a tool cider uses to inline its own deps. But I'm a little out of my depth here. Maybe @benedekfazekas can verify that.
re mranderson i will check this. just a side node tho, the functionality (add dependency to a running REPL) is also available in clj-refactor https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency we also use alembic btw to implement it
can't really reproduce the problem. with envrionment:
;; Connected to nREPL server running on port 63957 on host localhost - nrepl://localhost:63957
;; CIDER 0.12.0snapshot (package: 20160306.2356), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_31
I get
(require '[alembic.still :as still])
;; contemplate => nil
user> (still/load-project)
WARN: clojure-complete version 0.2.3 requested, but 0.2.4 already on classpath.
WARN: org.clojure/tools.nrepl version 0.2.6 requested, but 0.2.12 already on classpath.
Loaded dependencies:
[[alembic "0.3.2"]
[fipp "0.6.4"]
[lein-as-resource "2.5.0" :exclusions [[org.clojure/clojure]]]
[org.clojure/clojure "1.8.0"]
[org.clojure/core.rrb-vector "0.0.11"]
[org.flatland/classlojure "0.7.0" :exclusions [[org.clojure/clojure]]]
[org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]]
Dependencies not loaded due to conflict with previous jars :
[[clojure-complete
"0.2.3"
:scope
"test"
:exclusions
[[org.clojure/clojure]]]
[org.clojure/tools.nrepl
"0.2.6"
:scope
"test"
:exclusions
[[org.clojure/clojure]]]]
;; contemplate => nil
user>
require fipp.edn
also works:
(require '[cider.inlined-deps.fipp.v0v6v4.fipp.edn])
;; contemplate => nil
user>
(note that you need to use dash not underscore in the require)
am I missing something?
Ok cljr-hotload-dependencies did the trick.
Tim
On Sun, Mar 6, 2016 at 11:42 PM, Benedek Fazekas notifications@github.com wrote:
re mranderson i will check this. just a side node tho, the functionality (add dependency to a running REPL) is also available in clj-refactor https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency we also use alembic btw to implement it
— Reply to this email directly or view it on GitHub https://github.com/clojure-emacs/cider-nrepl/issues/309#issuecomment-193139229 .
And (alembic.still/load-project) works after I turned off my ~/.lein/profiles.clj file. So something in there is trampling on it's functionality.
Anyways, I'll use clj-refactor's library loading in the interim. Thanks for the help.
Tim
On Tue, Mar 8, 2016 at 2:44 AM, Benedek Fazekas notifications@github.com wrote:
can't really reproduce the problem. with envrionment:
;; Connected to nREPL server running on port 63957 on host localhost - nrepl://localhost:63957 ;; CIDER 0.12.0snapshot (package: 20160306.2356), nREPL 0.2.12 ;; Clojure 1.8.0, Java 1.8.0_31
I get
(require '[alembic.still :as still]) ;; contemplate => nil user> (still/load-project) WARN: clojure-complete version 0.2.3 requested, but 0.2.4 already on classpath. WARN: org.clojure/tools.nrepl version 0.2.6 requested, but 0.2.12 already on classpath. Loaded dependencies: [[alembic "0.3.2"] [fipp "0.6.4"] [lein-as-resource "2.5.0" :exclusions [[org.clojure/clojure]]] [org.clojure/clojure "1.8.0"] [org.clojure/core.rrb-vector "0.0.11"] [org.flatland/classlojure "0.7.0" :exclusions [[org.clojure/clojure]]] [org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]] Dependencies not loaded due to conflict with previous jars : [[clojure-complete "0.2.3" :scope "test" :exclusions [[org.clojure/clojure]]] [org.clojure/tools.nrepl "0.2.6" :scope "test" :exclusions [[org.clojure/clojure]]]] ;; contemplate => nil user>
require fipp.edn also works:
(require '[cider.inlined-deps.fipp.v0v6v4.fipp.edn]) ;; contemplate => nil user>
(note that you need to use dash not underscore in the require)
am I missing something?
— Reply to this email directly or view it on GitHub https://github.com/clojure-emacs/cider-nrepl/issues/309#issuecomment-193719529 .
:+1:
Expected behavior
Adding alembic "0.3.2" to my project should let me reload a project by calling
load-project
.Actual behavior
Steps to reproduce the problem
lein new thing
(then cd to thing/)lein repl
to get a repl(require '[alembic.still])
(alembic.still/load-project)
Environment & Version information
cider-nrepl version
[cider/cider-nrepl "0.12.0-snapshot"]
Java version
Java HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02
Operating system
OSX 10.11.3