Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Doesn't work properly in core.async projects #81

Open
zilti opened this issue Jul 2, 2014 · 10 comments
Open

Doesn't work properly in core.async projects #81

zilti opened this issue Jul 2, 2014 · 10 comments

Comments

@zilti
Copy link

zilti commented Jul 2, 2014

Slamhound fails to work properly in core.async projects, stating to

clojure.lang.ExceptionInfo: Could not resolve var: <! {:file "/tmp/form-init3522239263416655239.clj", :var <!}, compiling:(/tmp/form-init3522239263416655239.clj:1:130)

Same goes, by the way, for the lz4-compressor addon for nippy.

@guns
Copy link
Collaborator

guns commented Jul 2, 2014

Could you please provide an example namespace? I believe <! should be ignored once the surrounding go macro is resolved. Thank you!

EDIT: By ignored, I mean that that <! is not present in the macroexpansion of go

@zilti
Copy link
Author

zilti commented Jul 3, 2014

I made this, but it only got me a totally different error message:

(ns slamhoundtest.core
  (:require [clojure.core.async :refer [go chan >!] :as async]))

(defn something [x]
  (let [ch (chan)]
    (go (>! ch x))
    ch))
Failed to reconstruct: #<File src/slamhoundtest/core.clj>
java.lang.IllegalArgumentException: No implementation of method: :has? of protocol: #'clojure.core.cache/CacheProtocol found for class: clojure.core.memoize.PluggableMemoization, compiling:(/tmp/form-init5412601528044524872.clj:1:130)

@guns
Copy link
Collaborator

guns commented Jul 3, 2014

Hello,

This example ns works for me. However, that error is familiar: one of your dependencies is pulling in an old version of clojure.core.cache (or clojure.core.memoize; I don't recall precisely).

Googling that exception message should turn up workarounds by Ambrose Bonnaire-Sergeant and Andy Fingerhut.

As far as Slamhound is concerned, could you please test again with a clean :dependencies vector in both ~/.lein/profiles.clj and project.clj? (Aside from slamhound, of course).

Thank you!

@zilti
Copy link
Author

zilti commented Jul 4, 2014

All I get now is

Couldn't resolve go, got as far as {:refer {clojure.core.async.impl.channels #{chan}}, :old {:load nil, :exclude {}, :xr
efer #{}, :require #{}, :refer-all #{}, :verbose #{}, :rename {}, :alias {}, :reload #{}, :reload-all #{}, :gen-class ni
l, :import #{}, :refer {clojure.core.async #{chan go >!}}}, :meta nil, :name testslamhound.core}

@guns
Copy link
Collaborator

guns commented Jul 4, 2014

Could you post an example buffer please? I have not personally run into any problems with core.async

@zilti
Copy link
Author

zilti commented Jul 4, 2014

It's the exact buffer I posted in here.

@guns
Copy link
Collaborator

guns commented Jul 4, 2014

Then I can not reproduce, unfortunately. I am interested in uncovering the issue, so could you please post an example repository with project.clj + example source?

@ktsujister
Copy link

I also got the same issue.

project.clj

(defproject sh-issue "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [org.clojure/core.async "0.1.338.0-5c5012-alpha"]])

core.clj

(ns sh-issue.core)

(defn something [x]
  (let [ch (chan)]
    (go (>! ch x))
        ch))

error in cider:

java.lang.IllegalArgumentException: No implementation of method: :has? of protocol: #'clojure.core.cache/CacheProtocol found for class: clojure.core.memoize.PluggableMemoization, compiling:(/tmp/form-init6791368952718665537.clj:1:34)

lein version:
Leiningen 2.4.3 on Java 1.7.0_40 Java HotSpot(TM) 64-Bit Server VM

CIDER version:
CIDER 0.7.0 (package: 20140805.516) (Java 1.7.0_40, Clojure 1.6.0, nREPL 0.2.3, cider-nrepl 0.7.0)

slamhound version:
[slamhound "1.5.5"]

@ktsujister
Copy link

above project failed from command line too.

$ lein slamhound src/sh_issue/core.clj
Failed to reconstruct: #<File src/sh_issue/core.clj>
ava.lang.IllegalArgumentException: No implementation of method: :has? of protocol: #'clojure.core.cache/CacheProtocol found for class: clojure.core.memoize.PluggableMemoization, compiling:(/tmp/form-init1312218144590476856.clj:1:45)

@ToBeReplaced
Copy link

Confirming I see the same issue. Moreover, if you bump core.cache to 0.6.4, you get back to the Could not resolve var issue for >! and <!. I was unable to get slamhound to work with any version of core.async past 0.1.278.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants