bitemyapp / revise

RethinkDB client for Clojure
146 stars 8 forks source link

Tests failing on OS X 10.9 #11

Closed john2x closed 10 years ago

john2x commented 10 years ago

Trying to run the tests on my machine, but I'm getting errors with lein protobuf

$ lein test
 ...
 >  /Users/John/.lein/cache/lein-protobuf/protobuf-2.4.1/src/protoc rethinkdb.proto --java_out=/Users/John/Projects/clojure/revise/target/protosrc -I. -I/Users/John/Projects/clojure/revise/target/proto -I/Users/John/Projects/clojure/revise/resources/proto
java.io.IOException: Cannot run program "/Users/John/.lein/cache/lein-protobuf/protobuf-2.4.1/src/protoc" (in directory "resources/proto"): error=2, No such file or directory
cesarbp commented 10 years ago

Hum yeah I'm not sure what changed in the lein protobuf project :(. I think I will figure out how to compile the protocol buffers separately and place them on a separate jar.

coffeemug commented 10 years ago

Note that as of the next release (1.13) we're adding a pure JSON transport layer to the server. The drivers will be able to send pure JSON instead of protobufs, and you'll be able to completely drop the protobuf dependency. Also, it's way faster, so it's a win-win for everyone.

See https://github.com/rethinkdb/rethinkdb/issues/1868.

bitemyapp commented 10 years ago

@coffeemug I'm surprised JSON anything would be faster than protobufs. What happened there?

coffeemug commented 10 years ago

We were surprised too. But if you dig into it, it turns out that JSON parsing is really, really, really fast (often faster than binary) because most language have really good, fast, optimized JSON libraries.

john2x commented 10 years ago

@cesarbp oh, it's failing for you too? Or is there some manual steps I can do as a temporary workaround? Thanks.

bitemyapp commented 10 years ago

@john2x I don't write Clojure anymore as a general rule (prefer Haskell now), I haven't tested this issue.

cesarbp commented 10 years ago

@john2x Yes sorry. Neither the version in the project nor the most recent version work. I should have the protobufs on a different dependency by tomorrow. I'll check out the json stuff too.

cesarbp commented 10 years ago

Ok well an update on this.

I placed the latest (from the actual rethinkdb project) protocol buffers on a separate jar here https://clojars.org/org.clojars.cbp/rethinkdb-1.0.0 I messed up the artifact name heh.

I removed the lein-protobuf plugin and changed the clojure-protobuf version to 0.8.1. I also removed the resources folder so no more rethinkdb.proto file for lein-protobuf to compile.

So the new project.clj looks like this:

(defproject revise "0.0.7"
  :description "RethinkDB client for Clojure"
  :url "github.com/bitemyapp/revise/"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :main bitemyapp.revise.core
  :plugins [[com.jakemccrary/lein-test-refresh "0.1.2"]
            [lein-difftest "2.0.0"]]
  :test-selectors {:default (fn [_] true) ;; (complement :integration)
                   :race-condition :race-condition
                   :all (fn [_] true)}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [robert/bruce "0.7.1"]
                 [org.flatland/protobuf "0.8.1"]
                 [org.clojars.cbp/rethinkdb-1.0.0 "1.0.0"]]
  :repl-options {:port 7779})

The good news is that apparently the protobufs work.

The bad news are actually 2:

1) org.flatland/protobuf has some really annoying "batteries included" behaviour where it automatically adds in lein-protobuf, downloads all the protobuf source code, compiles protoc and then downloads a 2.4.1 protobuf jar (wat? latest is 2.5.0). And of course in the end it doesn't do anything since there is no .proto file. 2) lein test gives 9 errors out of the 97 tests on rethinkdb version 1.9.0. This is probably because the latest .proto file from rethinkdb has evolved way more than revise has :-P. So in the end I need to get this project up to speed. Will do so these following days.

On a separate note. @john2x, if it's urgent, in your fork you might wanna try the following in the meantime:

On project.clj:

  1. Remove the lein-protobuf plugin
  2. Bump the protobuf dep to 0.8.1
  3. Bump the project version to 0.0.7 or something.
  4. Run lein install to locally install that version and see if it works.