taoensso / faraday

Amazon DynamoDB client for Clojure
https://www.taoensso.com/faraday
Eclipse Public License 1.0
238 stars 84 forks source link

require faraday results in exception #10

Closed l0st3d closed 10 years ago

l0st3d commented 10 years ago

Cannot load code:

compression.clj:1:1: error: java.lang.Exception: Too many arguments to def (compression.clj:19)

ptaoussanis commented 10 years ago

Hi, sorry - could you get me some more info? What are you doing to prompt this error? Have you tried running lein clean?

l0st3d commented 10 years ago

Hi,

Sure. I'm using maven not leiningen. I have added this to my pom.xml:

    <dependency>
        <groupId>com.taoensso</groupId>
        <artifactId>faraday</artifactId>
        <version>0.13.0</version>
    </dependency>

I have started mvn and connected emacs to get a repl, at which I entered:

(ns my-ns (:require [taoensso.faraday :as ddb]))

and I got the exception mentioned. It seems to be something to do with nippy, since this is the first non-clojure line in the stack trace:

taoensso.nippy$eval41400$loading4414auto____41401.invoke(nippy.clj:1)

ptaoussanis commented 10 years ago

Hi Ed, is there a reason you're not using Leiningen? It's something I'd almost always strongly recommend for Clojure projects.

Anyway to eliminate the possibility that this is a problem with the dependencies, could you try it once with lein (and try lein clean first if you're still seeing the same problem)? Let's go from there.

l0st3d commented 10 years ago

I'm using maven cos we started this project before lein was really stable, and there's never a good time to port your production code build system.

Looking in the source for nippy in compression.clj, the obvious bug is on line 19:

(def snappy-compressor "Default org.iq80.snappy.Snappy compressor." (->SnappyCompressor))

probably should be

(def ^{:doc "Default org.iq80.snappy.Snappy compressor."} snappy-compressor (->SnappyCompressor))

or something. Either way the release is broken.

ptaoussanis commented 10 years ago

the obvious bug is on line 19:

def takes an optional docstring. What version of Clojure are you using?

Either way the release is broken.

Tests are passing on my end, and I have the same version in staging. I would suggest trying a minimal lein project (and lien clean) to rule out possible dependency issues.

l0st3d commented 10 years ago

Ah yes ... apologies ... We're on an old version of clojure too ... Feel free to ignore me if you're not supporting old versions of clojure, and thanks for replying.

ptaoussanis commented 10 years ago

Faraday is 1.5+ unfortunately (you can usually see this in the project.clj btw) - I would recommend taking a look at Rotary which I believe is 1.2+.

Good luck, cheers!