liquidz / antq

Point out your outdated dependencies.
Other
395 stars 22 forks source link

Execution error on Windows since 1.6.0 #172

Closed skynet-gh closed 2 years ago

skynet-gh commented 2 years ago

I get the following error on Windows in this project of mine running using the alias method in /.clojure/deps.edn:

> clj -M:antq
Execution error (IllegalArgumentException) at antq.util.file/normalize-path (file.clj:8).
Invalid match arg:

Full report at:
<file>

and the contents of that file are:

{:clojure.main/message
 "Execution error (IllegalArgumentException) at antq.util.file/normalize-path (file.clj:8).\r\nInvalid match arg: \r\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.IllegalArgumentException,
  :clojure.error/line 8,
  :clojure.error/cause "Invalid match arg: ",
  :clojure.error/symbol antq.util.file/normalize-path,
  :clojure.error/source "file.clj",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.lang.IllegalArgumentException,
    :message "Invalid match arg: ",
    :at [clojure.string$replace invokeStatic "string.clj" 102]}],
  :trace
  [[clojure.string$replace invokeStatic "string.clj" 102]
   [clojure.string$replace invoke "string.clj" 75]
   [antq.util.file$normalize_path invokeStatic "file.clj" 8]
   [antq.util.file$normalize_path invoke "file.clj" 6]
   [clojure.core$update invokeStatic "core.clj" 6237]
   [clojure.core$update invoke "core.clj" 6229]
   [antq.report.table$eval4258$fn__4259$fn__4262 invoke "table.clj" 29]
   [clojure.core$map$fn__5949 invoke "core.clj" 2770]
   [clojure.lang.LazySeq sval "LazySeq.java" 44]
   [clojure.lang.LazySeq seq "LazySeq.java" 53]
   [clojure.lang.RT seq "RT.java" 535]
   [clojure.core$seq__5481 invokeStatic "core.clj" 139]
   [clojure.core$map$fn__5949 invoke "core.clj" 2763]
   [clojure.lang.LazySeq sval "LazySeq.java" 44]
   [clojure.lang.LazySeq seq "LazySeq.java" 53]
   [clojure.lang.RT seq "RT.java" 535]
   [clojure.core$seq__5481 invokeStatic "core.clj" 139]
   [clojure.pprint$print_table invokeStatic "print_table.clj" 17]
   [clojure.pprint$print_table invoke "print_table.clj" 11]
   [antq.report.table$eval4258$fn__4259 invoke "table.clj" 35]
   [clojure.lang.MultiFn invoke "MultiFn.java" 234]
   [antq.core$antq invokeStatic "core.clj" 244]
   [antq.core$antq invoke "core.clj" 236]
   [antq.core$main_STAR_ invokeStatic "core.clj" 262]
   [antq.core$main_STAR_ invoke "core.clj" 247]
   [antq.core$_main invokeStatic "core.clj" 278]
   [antq.core$_main doInvoke "core.clj" 274]
   [clojure.lang.RestFn applyTo "RestFn.java" 140]
   [clojure.lang.Var applyTo "Var.java" 707]
   [clojure.core$apply invokeStatic "core.clj" 667]
   [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" 140]
   [clojure.lang.Var applyTo "Var.java" 707]
   [clojure.main main "main.java" 40]],
  :cause "Invalid match arg: "}}

I get the same error on both 1.6.0 as well as the current latest, 1.9.859.

This works on version 1.5.1 on Windows, as well as 1.6.0+ on Linux.

liquidz commented 2 years ago

@skynet-gh Thanks for your reporting!

Unfortunately I don't have Windiows environment, so I can't reproduce the problem. Could you tell me actual values for file-path and (u.env/getenv "HOME") in the following code?

https://github.com/liquidz/antq/blob/d4bed61ba7f02554d6ecf5704d9507b1b7da3cc5/src/antq/util/file.clj#L6-L8

E.g.

(defn normalize-path
  [file-path]
  (println (format "DEBUG: file-path = '%s', home = '%s'"
                   file-path
                   (u.env/getenv "HOME")))
  (str/replace file-path (u.env/getenv "HOME") "~"))
skynet-gh commented 2 years ago

@liquidz in my local clone with that change to normalize-path I get:

> clj -M:outdated
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
DEBUG: file-path = '.\deps.edn', home = 'null'###### ] 23/23
Execution error (IllegalArgumentException) at antq.util.file/normalize-path (file.clj:15).
Invalid match arg:

Full report at:
...

so looks like file-path is ".\deps.edn" and (u.env/getenv "HOME") is null.

liquidz commented 2 years ago

@skynet-gh Sorry for late response. I've tried to fix the problem in dev branch.

Could you try dev branch?

skynet-gh commented 2 years ago

@liquidz hey thanks, that seems to work just fine:

antq> clj -M:outdated
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[ ################################################## ] 23/23
|      :file |                        :name |  :current |   :latest |
|------------+------------------------------+-----------+-----------|
| .\deps.edn | org.clojure/tools.deps.alpha | 0.12.1090 | 0.14.1212 |

Available diffs:
- https://github.com/clojure/tools.deps.alpha/compare/v0.12.1090...v0.14.1212
liquidz commented 2 years ago

@skynet-gh Thanks for your quick confirmation! Just released v1.9.863.

skynet-gh commented 2 years ago

That works too, thanks!