marcomorain / clojure-lint

GNU General Public License v3.0
18 stars 2 forks source link

Win10: An unexpected error occurred when running clj-kondo #4

Closed PEZ closed 4 years ago

PEZ commented 5 years ago

Hello,

I'm trying this on Windows 10 (fully aware that it is not yet supported) mainly to try to get an idea about what the problems might be.

Using the v2019.07.31-alpha version of clj-kondo. I get this in the Clojure Lint output channel:


Clojure Lint extension loaded.
Please report any issues to https://github.com/marcomorain/clojure-lint/issues
An unexpected error occured when running clj-kondo. Please report a bug
to https://github.com/marcomorain/clojure-lint/issues
[SyntaxError: Unexpected end of JSON input
        at JSON.parse (<anonymous>)
        at child_process_1.execFile (C:\Users\User\.vscode\extensions\marcomorain.clojure-lint-0.4.0\out\extension.js:37:38)
        at ChildProcess.exithandler (child_process.js:306:5)
        at ChildProcess.emit (events.js:182:13)
        at maybeClose (internal/child_process.js:962:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)]```

This does not look to me as a GraalVM problem, but I could be wrong.

I'll do some more looking into this now and will come back if I find out any more.
kstehn commented 5 years ago

The problem right now is that clj-kondo, or more accurately GraalVM, has some problems on windows. I clj-kondo itself working with a workaround using WSL.

PEZ commented 5 years ago

But I was right about the above not being a GraalVM problem. It is a problem with quoting the command line arguments, that work differently on Windows.

If I fix that quoting I advance to a new level of problems that might, or might not be GraalVM related:

java.lang.NoClassDefFoundError: Ljava/io/FileNotFoundException;
        at com.oracle.svm.jni.functions.JNIFunctions.FindClass(JNIFunctions.java:328)
        at java.io.FileInputStream.open0(FileInputStream.java)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at clojure.java.io$fn__10968.invokeStatic(io.clj:229)
        at clojure.java.io$fn__10968.invoke(io.clj:229)
        at clojure.java.io$fn__10881$G__10874__10888.invoke(io.clj:69)
        at clojure.java.io$fn__10980.invokeStatic(io.clj:258)
        at clojure.java.io$fn__10980.invoke(io.clj:254)
        at clojure.java.io$fn__10881$G__10874__10888.invoke(io.clj:69)
        at clojure.java.io$fn__10942.invokeStatic(io.clj:165)
        at clojure.java.io$fn__10942.invoke(io.clj:165)
        at clojure.java.io$fn__10894$G__10870__10901.invoke(io.clj:69)
        at clojure.java.io$reader.invokeStatic(io.clj:102)
        at clojure.java.io$reader.doInvoke(io.clj:86)
        at clojure.lang.RestFn.invoke(RestFn.java:410)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.RestFn.applyTo(RestFn.java:132)
        at clojure.core$apply.invokeStatic(core.clj:659)
        at clojure.core$slurp.invokeStatic(core.clj:6862)
        at clojure.core$slurp.doInvoke(core.clj:6862)
        at clojure.lang.RestFn.invoke(RestFn.java:410)
        at clj_kondo.impl.core$resolve_config.invokeStatic(core.clj:47)
        at clj_kondo.core$run_BANG_.invokeStatic(core.clj:77)
        at clj_kondo.main$main.invokeStatic(main.clj:74)
        at clj_kondo.main$main.doInvoke(main.clj:67)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invokeStatic(core.clj:657)
        at clj_kondo.main$_main$fn__4523.invoke(main.clj:93)
        at clj_kondo.main$_main.invokeStatic(main.clj:93)
        at clj_kondo.main$_main.doInvoke(main.clj:91)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clj_kondo.main.main(Unknown Source)

This error seems to stem from the JSON output format being configured, but I am not sure about that, only had a few moments to test it today. (It could actually be that I haven't got the quoting right yet, just differently wrong. :smile:)

marcomorain commented 5 years ago

@pez do you have a patch for the quoting issue? I’d like to apply that.

PEZ commented 5 years ago

@marcomorain , not really, I just hacked the thing to get me a bit further on my Windows investigation (no regards to still have it working on *nix in that session). :smile:

But I can certainly try to cook a patch for you. I have spent the last two weeks in Windows quoting hell for Calva jack-in so I am somewhat up-to-speed.

PEZ commented 5 years ago

Actually I fail to confirm that this even is a quoting issue. I'll let this be until we have some news about the clj-kondo executable on Windows starting to behave.

marcomorain commented 4 years ago

This is fixed in 0.6.0 using the latest kondo