Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.AssertionError on 0.7.0 #125

Open
mat926 opened this issue Mar 21, 2022 · 6 comments
Open

java.lang.AssertionError on 0.7.0 #125

mat926 opened this issue Mar 21, 2022 · 6 comments

Comments

@mat926
Copy link

mat926 commented Mar 21, 2022

When running lein ancient on version 0.7.0 I get this error:

Retrieving lein-cloverage/lein-cloverage/1.2.2/lein-cloverage-1.2.2.pom from clojars
Retrieving lein-cloverage/lein-cloverage/1.2.2/lein-cloverage-1.2.2.jar from clojars
←[31m(error)←[m #error {
 :cause "Assert failed: (string-of? s r/linebreak?)"
 :via
 [{:type java.lang.AssertionError
   :message "Assert failed: (string-of? s r/linebreak?)"
   :at [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.node.whitespace$newline_node invokeStatic "whitespace.clj" 89]}]
 :trace
 [[lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.node.whitespace$newline_node invokeStatic "whitespace.clj" 89]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.node.whitespace$newline_node invoke "whitespace.clj" 89]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.whitespace$parse_whitespace invokeStatic "whitespace.clj" 12]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.whitespace$parse_whitespace invoke "whitespace.clj" 6]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$eval9909$fn__9910 invoke "core.clj" 85]
  [clojure.lang.MultiFn invoke "MultiFn.java" 229]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_with_meta invokeStatic "reader.clj" 132]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_with_meta invoke "reader.clj" 128]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_next invokeStatic "core.clj" 35]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_next invoke "core.clj" 33]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_delim$fn__9885 invoke "core.clj" 43]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_repeatedly$fn__8919 invoke "reader.clj" 141]
  [clojure.core$repeatedly$fn__6463 invoke "core.clj" 5149]
  [clojure.lang.LazySeq sval "LazySeq.java" 42]
  [clojure.lang.LazySeq seq "LazySeq.java" 51]
  [clojure.lang.RT seq "RT.java" 535]
  [clojure.core$seq__5402 invokeStatic "core.clj" 137]
  [clojure.core$take_while$fn__5917 invoke "core.clj" 2904]
  [clojure.lang.LazySeq sval "LazySeq.java" 42]
  [clojure.lang.LazySeq seq "LazySeq.java" 51]
  [clojure.lang.Cons next "Cons.java" 39]
  [clojure.lang.RT next "RT.java" 713]
  [clojure.core$next__5386 invokeStatic "core.clj" 64]
  [clojure.core$dorun invokeStatic "core.clj" 3142]
  [clojure.core$doall invokeStatic "core.clj" 3148]
  [clojure.core$doall invoke "core.clj" 3148]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_repeatedly invokeStatic "reader.clj" 143]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_repeatedly invoke "reader.clj" 137]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_delim invokeStatic "core.clj" 44]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_delim invoke "core.clj" 39]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$eval9957$fn__9958 invoke "core.clj" 176]
  [clojure.lang.MultiFn invoke "MultiFn.java" 229]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_with_meta invokeStatic "reader.clj" 132]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_with_meta invoke "reader.clj" 128]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_next invokeStatic "core.clj" 35]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_next invoke "core.clj" 33]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_delim$fn__9885 invoke "core.clj" 43]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_repeatedly$fn__8919 invoke "reader.clj" 141]
  [clojure.core$repeatedly$fn__6463 invoke "core.clj" 5149]
  [clojure.lang.LazySeq sval "LazySeq.java" 42]
  [clojure.lang.LazySeq seq "LazySeq.java" 51]
  [clojure.lang.RT seq "RT.java" 535]
  [clojure.core$seq__5402 invokeStatic "core.clj" 137]
  [clojure.core$take_while$fn__5917 invoke "core.clj" 2904]
  [clojure.lang.LazySeq sval "LazySeq.java" 42]
  [clojure.lang.LazySeq seq "LazySeq.java" 51]
  [clojure.lang.Cons next "Cons.java" 39]
  [clojure.lang.RT next "RT.java" 713]
  [clojure.core$next__5386 invokeStatic "core.clj" 64]
  [clojure.core$dorun invokeStatic "core.clj" 3142]
  [clojure.core$doall invokeStatic "core.clj" 3148]
  [clojure.core$doall invoke "core.clj" 3148]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_repeatedly invokeStatic "reader.clj" 143]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_repeatedly invoke "reader.clj" 137]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_delim invokeStatic "core.clj" 44]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_delim invoke "core.clj" 39]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$eval9953$fn__9954 invoke "core.clj" 172]
  [clojure.lang.MultiFn invoke "MultiFn.java" 229]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_with_meta invokeStatic "reader.clj" 132]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.reader$read_with_meta invoke "reader.clj" 128]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_next invokeStatic "core.clj" 35]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser.core$parse_next invoke "core.clj" 33]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser$parse invokeStatic "parser.clj" 13]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser$parse invoke "parser.clj" 10]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser$parse_all$fn__9970 invoke "parser.clj" 18]
  [clojure.core$repeatedly$fn__6463 invoke "core.clj" 5149]
  [clojure.lang.LazySeq sval "LazySeq.java" 42]
  [clojure.lang.LazySeq seq "LazySeq.java" 51]
  [clojure.lang.RT seq "RT.java" 535]
  [clojure.core$seq__5402 invokeStatic "core.clj" 137]
  [clojure.core$take_while$fn__5917 invoke "core.clj" 2904]
  [clojure.lang.LazySeq sval "LazySeq.java" 42]
  [clojure.lang.LazySeq seq "LazySeq.java" 51]
  [clojure.lang.RT seq "RT.java" 535]
  [clojure.core$seq__5402 invokeStatic "core.clj" 137]
  [clojure.core$dorun invokeStatic "core.clj" 3133]
  [clojure.core$doall invokeStatic "core.clj" 3148]
  [clojure.core$doall invoke "core.clj" 3148]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser$parse_all invokeStatic "parser.clj" 20]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser$parse_all invoke "parser.clj" 15]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser$parse_file_all invokeStatic "parser.clj" 49]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.parser$parse_file_all invoke "parser.clj" 44]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.zip.base$of_file invokeStatic "base.clj" 79]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.zip.base$of_file invoke "base.clj" 75]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.zip.base$of_file invokeStatic "base.clj" 77]
  [lein_ancient.rewrite_clj.v0v6v1.rewrite_clj.zip.base$of_file invoke "base.clj" 75]
  [leiningen.ancient.artifact.reader$read_project_map_BANG_ invokeStatic "reader.clj" 20]
  [leiningen.ancient.artifact.reader$read_project_map_BANG_ invoke "reader.clj" 17]
  [leiningen.ancient.artifact.files.DependencyFile read_BANG_ "files.clj" 73]
  [leiningen.ancient.check$check_file_BANG_ invokeStatic "check.clj" 16]
  [leiningen.ancient.check$check_file_BANG_ invoke "check.clj" 14]
  [leiningen.ancient.utils$call_file$fn__11264 invoke "utils.clj" 60]
  [leiningen.ancient.utils$call_file invokeStatic "utils.clj" 59]
  [leiningen.ancient.utils$call_file invoke "utils.clj" 57]
  [leiningen.ancient.utils$call_on_project_files invokeStatic "utils.clj" 129]
  [leiningen.ancient.utils$call_on_project_files invoke "utils.clj" 115]
  [leiningen.ancient.check$eval11402$check__11403 doInvoke "check.clj" 40]
  [clojure.lang.RestFn invoke "RestFn.java" 410]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.RestFn applyTo "RestFn.java" 132]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$apply invoke "core.clj" 660]
  [leiningen.ancient$run_default invokeStatic "ancient.clj" 24]
  [leiningen.ancient$run_default invoke "ancient.clj" 21]
  [leiningen.ancient$ancient invokeStatic "ancient.clj" 50]
  [leiningen.ancient$ancient doInvoke "ancient.clj" 26]
  [clojure.lang.RestFn invoke "RestFn.java" 410]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.RestFn applyTo "RestFn.java" 132]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$apply invoke "core.clj" 660]
  [leiningen.core.main$partial_task$fn__2043 doInvoke "main.clj" 284]
  [clojure.lang.RestFn invoke "RestFn.java" 410]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.RestFn applyTo "RestFn.java" 132]
  [clojure.lang.AFunction$1 doInvoke "AFunction.java" 31]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$apply invoke "core.clj" 660]
  [leiningen.core.main$apply_task invokeStatic "main.clj" 334]
  [leiningen.core.main$apply_task invoke "main.clj" 320]
  [leiningen.core.main$resolve_and_apply invokeStatic "main.clj" 343]
  [leiningen.core.main$resolve_and_apply invoke "main.clj" 336]
  [leiningen.core.main$_main$fn__2132 invoke "main.clj" 452]
  [leiningen.core.main$_main invokeStatic "main.clj" 442]
  [leiningen.core.main$_main doInvoke "main.clj" 439]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.core$apply invokeStatic "core.clj" 665]
  [clojure.main$main_opt invokeStatic "main.clj" 514]
  [clojure.main$main_opt invoke "main.clj" 510]
  [clojure.main$main invokeStatic "main.clj" 664]
  [clojure.main$main doInvoke "main.clj" 616]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.main main "main.java" 40]]}
@xsc
Copy link
Owner

xsc commented Mar 22, 2022

@leodoi3 Could you provide a minimal project.clj that causes the problem? And can you confirm that the issue still persists in the latest Release Candidate?

@mat926
Copy link
Author

mat926 commented Mar 24, 2022

Here's a sample project.clj that causes the problem.

(defproject sample "001"
  :plugins [[lein-ancient "0.7.0"]]
  :dependencies [[org.clojure/data.json "1.0.0"]]
  ;; :exclusions [[com.google.guava/guava]]
  )

It also fails on 1.0.0-RC3 . But it works on 0.6.15.
Even if I remove the commented line , I will get this:
[org.clojure/data.json ←[32m"2.4.0"←[m] is available but we use ←[33m"1.0.0"←[m

@xsc
Copy link
Owner

xsc commented Mar 25, 2022

@leodoi3 Unfortunately, I cannot reproduce the issue. The above project.clj causes lein ancient to print exactly what it should print:

[org.clojure/data.json "2.4.0"] is available but we use "1.0.0"

That really is the expected output ☝️. From you comment, it seems like you were expecting something else, though?

Can you share the output of lein deps :plugin-tree? It might be that there are some conflicting dependencies somewhere, and you're actually using a completely different version of lein-ancient.

@mat926
Copy link
Author

mat926 commented Apr 6, 2022

Sorry for the late reply. I'm not sure how [org.clojure/data.json ←[32m"2.4.0"←[m] is available but we use ←[33m"1.0.0"←[m would be the same as [org.clojure/data.json "2.4.0"] is available but we use "1.0.0" . But I ran that command using that sample project.clj and here's the output:

 [lein-ancient "0.7.0"]
   [clj-http "3.11.0" :exclusions [[commons-codec] [commons-io]]]
     [org.apache.httpcomponents/httpasyncclient "4.1.4" :exclusions [[org.clojure/clojure]]]
       [org.apache.httpcomponents/httpcore-nio "4.4.10"]
     [org.apache.httpcomponents/httpclient-cache "4.5.13" :exclusions [[org.clojure/clojure]]]
     [org.apache.httpcomponents/httpclient "4.5.13" :exclusions [[org.clojure/clojure]]]
       [commons-logging "1.2"]
     [org.apache.httpcomponents/httpcore "4.4.13" :exclusions [[org.clojure/clojure]]]
     [org.apache.httpcomponents/httpmime "4.5.13" :exclusions [[org.clojure/clojure]]]
     [potemkin "0.4.5" :exclusions [[org.clojure/clojure]]]
       [clj-tuple "0.2.2"]
       [riddley "0.1.12"]
     [slingshot "0.12.2" :exclusions [[org.clojure/clojure]]]

Here's the output from the project.clj that's causing the exception.

 [camechis/deploy-uberjar "0.3.0"]
 [jonase/eastwood "0.3.5" :exclusions [[org.clojure/clojure]]]
   [org.clojars.brenton/google-diff-match-patch "0.1"]
   [org.ow2.asm/asm-all "5.2"]
 [lein-ancient "0.7.0"]
   [clj-http "3.11.0" :exclusions [[commons-codec] [commons-io]]]
     [org.apache.httpcomponents/httpasyncclient "4.1.4" :exclusions [[org.clojure/clojure]]]
       [org.apache.httpcomponents/httpcore-nio "4.4.10"]
     [org.apache.httpcomponents/httpclient-cache "4.5.13" :exclusions [[org.clojure/clojure]]]
     [org.apache.httpcomponents/httpclient "4.5.13" :exclusions [[org.clojure/clojure]]]
       [commons-logging "1.2"]
     [org.apache.httpcomponents/httpcore "4.4.13" :exclusions [[org.clojure/clojure]]]
     [org.apache.httpcomponents/httpmime "4.5.13" :exclusions [[org.clojure/clojure]]]
     [potemkin "0.4.5" :exclusions [[org.clojure/clojure]]]
       [clj-tuple "0.2.2"]
       [riddley "0.1.12"]
     [slingshot "0.12.2" :exclusions [[org.clojure/clojure]]]
 [lein-cloverage "1.1.2"]
 [lein-libdir "0.1.1"]
 [lein-resource "17.06.1"]
   [bultitude "0.2.8" :exclusions [[org.clojure/clojure]]]
     [org.tcrawley/dynapath "0.2.3"]
   [stencil "0.5.0" :exclusions [[org.clojure/core.cache] [org.clojure/clojure]]]
     [quoin "0.1.2"]
     [scout "0.1.0"]
 [test2junit "1.4.2"]
   [clj-assorted-utils "1.18.2"]
   [org.clojure/clojure "1.8.0"]

@xsc
Copy link
Owner

xsc commented Apr 7, 2022

Thanks for the output! Unfortunately, everything looks fine. The error seems to indicate that rewrite-clj (the library used for reading/writing Clojure code) gets confused when handling newline characters. I can't really see where it could even go wrong in the code, but maybe your file format/encoding is the problem.

What OS are you using? Could you upload an actual failing file (e.g. the sample one) somewhere so we could check?

I'm not sure how [org.clojure/data.json ←[32m"2.4.0"←[m] is available but we use ←[33m"1.0.0"←[m would be the same as [org.clojure/data.json "2.4.0"] is available but we use "1.0.0" .

Sorry for that - I thought that was a copy/paste issue. The "weird" sequences you see are ASCII escape sequences, intended to add colours to the output. It looks like your terminal does not understand them and thus just print them as they are. (The library we're using tries to detect these cases, but it seems you'll have to add :no-colors on the command line to explicitly disable them.)

@LouDnl
Copy link

LouDnl commented Oct 5, 2022

After experiencing the same issue mentioned in #123 on 0.7.0 and on 1.0.0-RC3 I tried 1.0.0-RC4-SNAPSHOT and ran the same issue as OP. Changing line endings from CRLF to LF in VSCode fixed this issue for me.
image

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

No branches or pull requests

3 participants