taoensso / nippy

The fastest serialization library for Clojure
https://www.taoensso.com/nippy
Eclipse Public License 1.0
1.04k stars 60 forks source link

Unable to compile `taoensso/nippy/benchmarks.clj` #96

Closed alichaudry closed 7 years ago

alichaudry commented 7 years ago

This might be a my-machine-only issue, but running (require '[taoensso.nippy.benchmarks :as nippybench]) in the lein repl throws the following error:

java.io.FileNotFoundException: Could not locate clojure/data/fressian__init.class or clojure/data/fressian.clj on classpath.
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate clojure/data/fressian__init.class or clojure/data/fressian.clj on classpath., compiling:(taoensso/nippy/benchmarks.clj:1:1)

I see [org.clojure/data.fressian "0.2.1"] as one of the dependencies in the project.clj file, so is there any reason this dependency wasn't downloaded when lein deps is run?

I'm terribly new to Clojure, so all of this might also be an issue borne of ignorance :)

ptaoussanis commented 7 years ago

Hi @alichaudry,

I'm terribly new to Clojure, so all of this might also be an issue borne of ignorance :)

Zero problem :-)

I see [org.clojure/data.fressian "0.2.1"] as one of the dependencies in the project.clj file, so is there any reason this dependency wasn't downloaded when lein deps is run?

So Leiningen has a concept of profiles. In this case, the Fressian dep is only included when you're running Leiningen under the :dev profile. (Since Fressian isn't required for running Nippy in production, it's just used for the benchmarks).

Nippy's project.clj has an alias configured to make this all easy; if you run lein start-dev in the Nippy project route, it should give you an appropriate REPL with all the dev dependencies included. Otherwise you can Google "Leiningen profiles" for more info.

Hope that helps, cheers! :-)

alichaudry commented 7 years ago

Ah - that explains it! I dove in to Clojure with only enough of an understanding of Leiningen to get the repl up and running. I'll explore the Leiningen documentation more now.

Thanks so much! I'll let myself out now :)

ptaoussanis commented 7 years ago

Really no problem. And good luck with exploring Clojure, lots of nice things to look forward to! :-)