boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 180 forks source link

Boot 2.2.0: clojure.lang.ExceptionInfo: Wrong number of args (4) passed to: StringReader #267

Closed giorgio-v closed 9 years ago

giorgio-v commented 9 years ago

I get this error with the 2.2.0 version. Everything works ok with the 2.1.2 one.

> boot dev
 clojure.lang.ExceptionInfo: Wrong number of args (4) passed to: StringReader
    data: {:file "abnf.clj", :line 186}
clojure.lang.ArityException: Wrong number of args (4) passed to: StringReader
                                      ...
            instaparse.cfg/wrap-reader/fn                           cfg.clj:  162
instaparse.cfg/eval14083/safe-read-string                           cfg.clj:  170
            instaparse.cfg/process-string                           cfg.clj:  187
                instaparse.cfg/build-rule                           cfg.clj:  224
                      clojure.core/map/fn                          core.clj: 2557
                                      ...
                         clojure.core/seq                          core.clj:  133
                       clojure.core/apply                          core.clj:  624
                instaparse.cfg/build-rule                           cfg.clj:  222
                      clojure.core/map/fn                          core.clj: 2557
                                      ...
                         clojure.core/seq                          core.clj:  133
                       clojure.core/apply                          core.clj:  624
                instaparse.cfg/build-rule                           cfg.clj:  218
                instaparse.cfg/build-rule                           cfg.clj:  221
                      clojure.core/map/fn                          core.clj: 2557
                                      ...
                         clojure.core/seq                          core.clj:  133
                       clojure.core/apply                          core.clj:  624
                instaparse.cfg/build-rule                           cfg.clj:  222
                      clojure.core/map/fn                          core.clj: 2557
                                      ...
                         clojure.core/seq                          core.clj:  133
                       clojure.core/apply                          core.clj:  624
                instaparse.cfg/build-rule                           cfg.clj:  218
                instaparse.cfg/build-rule                           cfg.clj:  214
                      clojure.core/map/fn                          core.clj: 2557
                                      ...
                         clojure.core/seq                          core.clj:  133
        clojure.core.protocols/seq-reduce                     protocols.clj:   30
                clojure.core.protocols/fn                     protocols.clj:   54
              clojure.core.protocols/fn/G                     protocols.clj:   13
                      clojure.core/reduce                          core.clj: 6289
                        clojure.core/into                          core.clj: 6341
                      instaparse.cfg/ebnf                           cfg.clj:  284
                                      ...
                     clojure.core/load/fn                          core.clj: 5641
                        clojure.core/load                          core.clj: 5640
                                      ...
                    clojure.core/load-one                          core.clj: 5446
                 clojure.core/load-lib/fn                          core.clj: 5486
                    clojure.core/load-lib                          core.clj: 5485
                                      ...
                       clojure.core/apply                          core.clj:  626
                   clojure.core/load-libs                          core.clj: 5524
                                      ...
                       clojure.core/apply                          core.clj:  626
                     clojure.core/require                          core.clj: 5607
                                      ...
instaparse.core/eval13323/loading--auto--                          core.clj:    1
                instaparse.core/eval13323                          core.clj:    1
                                      ...
                     clojure.core/load/fn                          core.clj: 5641
                        clojure.core/load                          core.clj: 5640
                                      ...
                    clojure.core/load-one                          core.clj: 5446
                 clojure.core/load-lib/fn                          core.clj: 5486
                    clojure.core/load-lib                          core.clj: 5485
                                      ...
                       clojure.core/apply                          core.clj:  626
                   clojure.core/load-libs                          core.clj: 5524
                                      ...
                       clojure.core/apply                          core.clj:  626
                     clojure.core/require                          core.clj: 5607
                                      ...
     clout.core/eval13317/loading--auto--                          core.clj:    1
                     clout.core/eval13317                          core.clj:    1
                                      ...
                     clojure.core/load/fn                          core.clj: 5641
                        clojure.core/load                          core.clj: 5640
                                      ...
                    clojure.core/load-one                          core.clj: 5446
                 clojure.core/load-lib/fn                          core.clj: 5486
                    clojure.core/load-lib                          core.clj: 5485
                                      ...
                       clojure.core/apply                          core.clj:  626
                   clojure.core/load-libs                          core.clj: 5524
                                      ...
                       clojure.core/apply                          core.clj:  626
                     clojure.core/require                          core.clj: 5607
                                      ...
 compojure.core/eval13122/loading--auto--                          core.clj:    1
                 compojure.core/eval13122                          core.clj:    1
                                      ...
                     clojure.core/load/fn                          core.clj: 5641
                        clojure.core/load                          core.clj: 5640
                                      ...
                    clojure.core/load-one                          core.clj: 5446
                 clojure.core/load-lib/fn                          core.clj: 5486
                    clojure.core/load-lib                          core.clj: 5485
                                      ...
                       clojure.core/apply                          core.clj:  626
                   clojure.core/load-libs                          core.clj: 5524
                                      ...
                       clojure.core/apply                          core.clj:  626
                     clojure.core/require                          core.clj: 5607
                                      ...
        aim.app/eval11725/loading--auto--                           app.clj:    1
                        aim.app/eval11725                           app.clj:    1
                                      ...
                     clojure.core/load/fn                          core.clj: 5641
                        clojure.core/load                          core.clj: 5640
                                      ...
                    clojure.core/load-one                          core.clj: 5446
                 clojure.core/load-lib/fn                          core.clj: 5486
                    clojure.core/load-lib                          core.clj: 5485
                                      ...
                       clojure.core/apply                          core.clj:  626
                   clojure.core/load-libs                          core.clj: 5524
                                      ...
                       clojure.core/apply                          core.clj:  626
                     clojure.core/require                          core.clj: 5607
                                      ...
     aim.systems/eval1722/loading--auto--                       systems.clj:    1
                     aim.systems/eval1722                       systems.clj:    1
                                      ...
                     clojure.core/load/fn                          core.clj: 5641
                        clojure.core/load                          core.clj: 5640
                                      ...
                    clojure.core/load-one                          core.clj: 5446
                 clojure.core/load-lib/fn                          core.clj: 5486
                    clojure.core/load-lib                          core.clj: 5485
                                      ...
                       clojure.core/apply                          core.clj:  626
                   clojure.core/load-libs                          core.clj: 5524
                                      ...
                       clojure.core/apply                          core.clj:  626
                     clojure.core/require                          core.clj: 5607
                                      ...
                        boot.user/eval242  boot.user3573121541377916831.clj:    7
                                      ...
                       boot.main/-main/fn                          main.clj:  161
                          boot.main/-main                          main.clj:  161
                                      ...
                         boot.App.runBoot                          App.java:  231
                            boot.App.main                          App.java:  338
ragnard commented 9 years ago

Are you using a boot.properties file and if so what is in it? Also, which version of Clojure are you expecting and which version of instaparse are you depending on?

giorgio-v commented 9 years ago

Here is the current boot.properties file:

#https://github.com/boot-clj/boot
#Thu Jul 23 10:09:10 CEST 2015
BOOT_CLOJURE_VERSION=1.7.0
BOOT_JVM_OPTIONS=-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx2g -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xverify:none
BOOT_VERSION=2.1.2

I don’t have any explicit dependencies on Instaparse, but maybe are you referring to the transitive ones?

ragnard commented 9 years ago

Were you using Clojure 1.7.0 before you updated boot to 2.2.0? If not, I'd try changing BOOT_CLOJURE_VERSION to 1.6.0.

martinklepsch commented 9 years ago

@giorgio-v from #210: make sure you don't add two versions of Clojure to the classpath by specifying one in build.boot and a different one in boot.properties.

giorgio-v commented 9 years ago

I am using 1.7.0 on both.

martinklepsch commented 9 years ago

Stab in the dark but try specifying an explicit dependency on [instaparse "1.4.1"].

ragnard commented 9 years ago

I think this is a problem with instaparse (that you're getting through compojure and clout) and Clojure 1.7.0. See: https://github.com/weavejester/compojure/issues/137 https://github.com/Engelberg/instaparse/issues/90

Try [compojure "1.4.0"].

ragnard commented 9 years ago

@giorgio-v Were you able to solve this problem? Would be great to close this if it's not related to boot.

giorgio-v commented 9 years ago

Got sucked into another trap. But I’m getting out of it! :)

giorgio-v commented 9 years ago

Mmh I get this:

   clojure.lang.ExceptionInfo: Could not locate aim/api__init.class or aim/api.clj on classpath:
    data: {:file "aim/app.clj", :line 1}
java.io.FileNotFoundException: Could not locate aim/api__init.class or aim/api.clj on classpath:

:/

ragnard commented 9 years ago

That's looks like a completely different error. What did you do to produce that result? Did you try just bumping the compojure version in your build.boot?

giorgio-v commented 9 years ago

It is already the latest version.

martinklepsch commented 9 years ago

@giorgio-v would you mind pasting your build.boot file?

giorgio-v commented 9 years ago

Sure, here it is:

(set-env!
 :source-paths   #{"src"}
 :resource-paths #{"resources"}
 :dependencies '[[org.clojure/clojure        "1.7.0"]
                 [environ                    "1.0.0"
                  :exclusions [org.clojure/clojure]]
                 [danielsz/boot-environ      "0.0.5"]
                 [org.danielsz/system        "0.1.8"
                  :exclusions [ns-tracker org.clojure/clojure]]
                 [org.clojure/core.async     "0.1.346.0-17112a-alpha"
                  :exclusions [org.clojure/clojure]]
                 [com.cognitect/transit-clj  "0.8.275"
                  :exclusions [commons-codec
                               com.fasterxml.jackson.core/jackson-core]]
                 [com.taoensso/timbre        "4.0.2"
                  :exclusions [com.taoensso/encore org.clojure/clojure]]
                 ;; HTTP stack
                 [com.taoensso/sente         "1.6.0-RC1"
                  :exclusions [org.clojure/clojure]]
                 [http-kit                   "2.1.19"
                  :exclusions [org.clojure/clojure]]
                 [ring/ring-core             "1.4.0"
                  :exclusions [commons-codec
                               org.clojure/clojure
                               org.clojure/tools.reader]]
                 [ring/ring-defaults         "0.1.5"
                  :exclusions [clj-time
                               commons-codec
                               commons-fileupload
                               org.clojure/clojure
                               org.clojure/tools.reader
                               ring/ring-core]]
                 [compojure                 "1.4.0"
                  :exclusions [commons-codec
                               org.clojure/clojure
                               org.clojure/tools.reader]]
                 [buddy                      "0.6.0"
                  :exclusions [com.taoensso/encore
                               org.clojure/clojure
                               org.clojure/tools.reader]]
                 [hiccup                    "1.0.5"
                  :exclusions [org.clojure/clojure]]
                 ;; Frontend
                 [org.clojure/clojurescript  "1.7.28"
                  :exclusions [org.clojure/clojure
                               org.clojure/tools.reader]]
                 [com.cognitect/transit-cljs "0.8.220"
                  :exclusions [org.clojure/clojure]]
                 [quiescent                   "0.2.0-RC2"
                  :exclusions [com.google.guava/guava
                               com.google.javascript/closure-compiler
                               com.google.javascript/closure-compiler-externs
                               org.clojure/clojure
                               org.clojure/clojurescript
                               org.clojure/data.json
                               org.clojure/google-closure-library
                               org.clojure/google-closure-library-third-party
                               org.clojure/tools.reader
                               org.mozilla/rhino]]
                 ;; Dev env libs
                 [adzerk/boot-cljs           "0.0-3308-0" :scope "test"]
                 [adzerk/boot-cljs-repl      "0.1.9"      :scope "test"]
                 [adzerk/boot-reload         "0.3.1"      :scope "test"]
                 [ring/ring-devel            "1.4.0"      :scope "test"
                  :exclusions [commons-codec
                               org.clojure/clojure
                               org.clojure/tools.namespace
                               org.clojure/tools.reader]]])

(require
 '[adzerk.boot-cljs      :refer [cljs]]
 '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
 '[adzerk.boot-reload    :refer [reload]]
 '[reloaded.repl         :refer [init start stop go reset]]
 '[danielsz.boot-environ :refer [environ]]
 '[system.boot           :refer [system run]]
 '[aim.systems           :refer [dev-system]])

(deftask dev []
  (set-env! :source-paths #{"src" "test"})
  (comp (environ :env {:http-port 3000 :web-root "/"})
     (watch)
     (system :sys #'dev-system
             :auto-start true
             :hot-reload true
             :files ["app.clj"])
     (reload :on-jsload 'aim.main/main)
     (cljs-repl)
     (cljs :source-map true :optimizations :none)))

(deftask build []
  (set-env! :source-paths #{"src"})
  (comp (cljs :optimizations :advanced)))
ragnard commented 9 years ago

I can't reproduce an error but I can succesfully run boot dev if I create the necessary placeholder files:

[ragge@computero:~/projects/slask/boot-issue]$ tree .
.
├── build.boot
└── src
    └── aim
        ├── main.cljs
        └── systems.clj

2 directories, 3 files

[ragge@computero:~/projects/slask/boot-issue]$ cat src/aim/main.cljs 
(ns aim.main)

(defn main [])

[ragge@computero:~/projects/slask/boot-issue]$ cat src/aim/systems.clj 
(ns aim.systems)

(def dev-system (fn [] {}))

[ragge@computero:~/projects/slask/boot-issue]$ boot dev
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
<< started reload server on ws://localhost:55258 >>
Writing boot_reload.cljs...
temp-dir! was deprecated, please use tmp-dir! instead
Writing boot_cljs_repl.cljs...

Starting file watcher (CTRL-C to quit)...

Current system: #'aim.systems/dev-system
Autostarting the system: :started
nREPL server started on port 47949 on host 127.0.0.1 - nrepl://127.0.0.1:47949
Writing main.cljs.edn...
Compiling main.js...
Elapsed time: 8.028 sec

I can't really see an issue with your build.boot. Are you sure you have a aim/api.clj in src?

On a slightly unrelated note, you shouldn't need all of those :exclusions you have. Dependencies should take precedence in the order specified, so if you specify [clojure/clojure "1.7.0"] at top, any other dependencies depending on clojure would get the version you specified.

giorgio-v commented 9 years ago

Well, actually there is not an api.clj file, it is .cljc. So maybe that's the cause? Let's not forget that everything works fine with boot 2.1.2.

As for the exclusions, I just followed the output of boot show -p.

Giorgio Valoti

Il giorno 06/ago/2015, alle ore 22:16, Ragnar Dahlén notifications@github.com ha scritto:

I can't reproduce an error but I can succesfully run boot dev if I create the necessary placeholder files:

[ragge@computero:~/projects/slask/boot-issue]$ tree . . ├── build.boot └── src └── aim ├── main.cljs └── systems.clj

2 directories, 3 files

[ragge@computero:~/projects/slask/boot-issue]$ cat src/aim/main.cljs (ns aim.main)

(defn main [])

[ragge@computero:~/projects/slask/boot-issue]$ cat src/aim/systems.clj (ns aim.systems)

(def dev-system (fn [] {}))

[ragge@computero:~/projects/slask/boot-issue]$ boot dev OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 << started reload server on ws://localhost:55258 >> Writing boot_reload.cljs... temp-dir! was deprecated, please use tmp-dir! instead Writing boot_cljs_repl.cljs...

Starting file watcher (CTRL-C to quit)...

Current system: #'aim.systems/dev-system Autostarting the system: :started nREPL server started on port 47949 on host 127.0.0.1 - nrepl://127.0.0.1:47949 Writing main.cljs.edn... Compiling main.js... Elapsed time: 8.028 sec I can't really see an issue with your build.boot. Are you sure you have a aim/api.clj in src?

On a slightly unrelated note, you shouldn't need all of those :exclusions you have. Dependencies should take precedence in the order specified, so if you specify [clojure/clojure "1.7.0"] at top, any other dependencies depending on clojure would get the version you specified.

— Reply to this email directly or view it on GitHub.

ragnard commented 9 years ago

Can you provide us with a minimal reproducing repo for this?

giorgio-v commented 9 years ago

It seems that just by requiring a namespace like buddy.auth.middleware in the build.boot file is enough to trigger the problem.

giorgio-v commented 9 years ago

Seems fixed with version 2.2.0