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

version 1.3.0 broken #125

Closed
markokocic opened this issue Dec 8, 2021 · 6 comments
Closed

version 1.3.0 broken #125

markokocic opened this issue Dec 8, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@markokocic
Copy link

Steps to reproduce:

> cd ~/.clojure/
> cat deps.edn
{
 :aliases
 {:outdated
  {:extra-deps {com.github.liquidz/antq {:mvn/version "1.3.0"}} :main-opts ["-m" "antq.core"]}}
 }

> clojure -M:outdated
Execution error (PatternSyntaxException) at java.util.regex.Pattern/error (Pattern.java:2027).
Unexpected internal error near index 1
\

Full report at:
C:\Users\Marko.Kocic\scoop\apps\msys2\2021-11-30\tmp\clojure-13384489796296388982.edn

> cat /tmp/clojure-13384489796296388982.edn
{:clojure.main/message
 "Execution error (PatternSyntaxException) at java.util.regex.Pattern/error (Pattern.java:2027).\r\nUnexpected internal error near index 1\r\n\\\r\n",
 :clojure.main/triage
 {:clojure.error/class java.util.regex.PatternSyntaxException,
  :clojure.error/line 2027,
  :clojure.error/cause "Unexpected internal error near index 1\r\n\\",
  :clojure.error/symbol java.util.regex.Pattern/error,
  :clojure.error/source "Pattern.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.util.regex.PatternSyntaxException,
    :message "Unexpected internal error near index 1\r\n\\",
    :at [java.util.regex.Pattern error "Pattern.java" 2027]}],
  :trace
  [[java.util.regex.Pattern error "Pattern.java" 2027]
   [java.util.regex.Pattern compile "Pattern.java" 1788]
   [java.util.regex.Pattern <init> "Pattern.java" 1428]
   [java.util.regex.Pattern compile "Pattern.java" 1068]
   [java.lang.String split "String.java" 2317]
   [java.lang.String split "String.java" 2364]
   [antq.util.dep$normalize_path invokeStatic "dep.clj" 37]
   [antq.util.dep$normalize_path invoke "dep.clj" 34]
   [antq.dep.clojure$load_deps invokeStatic "clojure.clj" 145]
   [antq.dep.clojure$load_deps invoke "clojure.clj" 141]
   [antq.dep.clojure$load_deps invokeStatic "clojure.clj" 143]
   [antq.dep.clojure$load_deps invoke "clojure.clj" 141]
   [antq.core$fetch_deps$fn__8581 invoke "core.clj" 200]
   [clojure.core$map$fn__5884 invoke "core.clj" 2759]
   [clojure.lang.LazySeq sval "LazySeq.java" 42]
   [clojure.lang.LazySeq seq "LazySeq.java" 51]
   [clojure.lang.RT seq "RT.java" 535]
   [clojure.core$seq__5419 invokeStatic "core.clj" 139]
   [clojure.core$apply invokeStatic "core.clj" 662]
   [clojure.core$mapcat invokeStatic "core.clj" 2787]
   [clojure.core$mapcat doInvoke "core.clj" 2787]
   [clojure.lang.RestFn invoke "RestFn.java" 423]
   [antq.core$fetch_deps invokeStatic "core.clj" 198]
   [antq.core$fetch_deps invoke "core.clj" 195]
   [antq.core$main_STAR_ invokeStatic "core.clj" 246]
   [antq.core$main_STAR_ invoke "core.clj" 240]
   [antq.core$_main invokeStatic "core.clj" 270]
   [antq.core$_main doInvoke "core.clj" 266]
   [clojure.lang.RestFn invoke "RestFn.java" 397]
   [clojure.lang.AFn applyToHelper "AFn.java" 152]
   [clojure.lang.RestFn applyTo "RestFn.java" 132]
   [clojure.lang.Var applyTo "Var.java" 705]
   [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" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "Unexpected internal error near index 1\r\n\\"}}
>
@liquidz
Copy link
Owner

liquidz commented Dec 9, 2021

@markokocic Thanks for your reporting!

It seems Windows specific problem.

(defn normalize-path

I don't have WIndows environment, but I'll try to fix.

@liquidz liquidz added the bug Something isn't working label Dec 9, 2021
@markokocic
Copy link
Author

I admit I'm not familiar with the reason behind normalize-path function, but is there a reason why not using java.io.File/getCanonicalPath instead of custom path parsing?

liquidz added a commit that referenced this issue Dec 10, 2021
This is not a permanent solution
@liquidz
Copy link
Owner

liquidz commented Dec 10, 2021

@markokocic Oh, I missed getCanonicalPath! Thank!

But we want to return a relative path with normalize-path if possible.
Do you have a good way?

The purpose of normalize-path is to normalize the directory specified by :local/root in deps.edn.
Normalized paths are used to detect infinite loops and report results.

Anyway, I patched a workaround for now.
Could you try dev branch?

@markokocic
Copy link
Author

But we want to return a relative path with normalize-path if possible.
Do you have a good way?

In Java you can look at java.nio.file/Path docs. Maybe normalize, releativize and resolve methods can help you.

Anyway, I patched a workaround for now.
Could you try dev branch?

I tried dev branch and it seems to fix error.

@liquidz
Copy link
Owner

liquidz commented Dec 18, 2021

@markokocic Sorry for late reply.

In Java you can look at java.nio.file/Path docs. Maybe normalize, releativize and resolve methods can help you.

Thanks so much for letting me know!

I tried dev branch and it seems to fix error.

Great. Thanks.
I'll cut a new release.

liquidz added a commit that referenced this issue Dec 18, 2021
This is not a permanent solution
@liquidz
Copy link
Owner

liquidz commented Dec 19, 2021

Just released v1.3.1 #128

@liquidz liquidz closed this as completed Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants