This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-25
Channels
- # aleph (2)
- # announcements (7)
- # babashka (6)
- # beginners (53)
- # calva (17)
- # cider (5)
- # clj-kondo (137)
- # cljs-dev (19)
- # cljsrn (14)
- # clojure (74)
- # clojure-conj (9)
- # clojure-europe (13)
- # clojure-houston (1)
- # clojure-italy (16)
- # clojure-nl (21)
- # clojure-spec (3)
- # clojure-uk (9)
- # clojuredesign-podcast (24)
- # clojurescript (85)
- # cursive (11)
- # datomic (28)
- # duct (3)
- # emacs (6)
- # figwheel-main (1)
- # fulcro (68)
- # graalvm (19)
- # graphql (3)
- # joker (32)
- # kaocha (10)
- # lambdaisland (1)
- # malli (50)
- # off-topic (13)
- # other-languages (7)
- # pathom (2)
- # pedestal (14)
- # re-frame (53)
- # reitit (8)
- # shadow-cljs (57)
- # specter (2)
All JVM tests are succeeding now on Windows 😄 Ran 121 tests containing 1207 assertions. 0 failures, 0 errors.

nice! thanks to @ales.najmann for help 🙂
There is one remaining native test error:
lein test clj-kondo.main-test
Unexpected error. Please report an issue.
lein test :only clj-kondo.main-test/deprecated-var-test
FAIL in (deprecated-var-test) (main_test.clj:1945)
config
expected: (clojure.core/= (clojure.core/count maps__8060__auto__) (clojure.core/count res__8061__auto__))
actual: (not (clojure.core/= 1 0))
Unexpected error. Please report an issue.
Unexpected error. Please report an issue.
Unexpected error. Please report an issue.
Unexpected error. Please report an issue.
This only seems to occur when you run all native tests, not when I run this test in isolation
FAIL in (deprecated-var-test) (main_test.clj:1945)
config
expected: (clojure.core/= (clojure.core/count maps__761__auto__) (clojure.core/count res__762__auto__))
actual: (not (clojure.core/= 1 0))
Ran 1 tests containing 15 assertions.
1 failures, 0 errors.
Tests failed.
This is only when testing the native version.I commented out what looked like what was leading to that:
#_(testing "config"
(assert-submaps
'({:file "corpus/deprecated_var.clj",
:row 10,
:col 1,
:level :warning,
:message "#'foo.foo/deprecated-fn is deprecated"})
in my output, there are the following lines right after the FAIL, whether the section is commented or not:
Unexpected error. Please report an issue.
Unexpected error. Please report an issue.
Unexpected error. Please report an issue.
Unexpected error. Please report an issue.
in main.clj this line is printed. maybe you can include (.getMessage e) in the println
i can try that -- though in my main.clj there is something about printing the stacktrace. is there some reason i'm not seeing any info about the stacktrace?
which is not consistent in this case, but stderr is not visible I think in the tests (which could be a nice for debugging)
lein test clj-kondo.main-test
Unexpected error. Please report an issue. clojure.lang.Symbol cannot be cast to java.lang.String
Unexpected error. Please report an issue. clojure.lang.Symbol cannot be cast to java.lang.String
Unexpected error. Please report an issue. Unsupported character: \\.specs$
Unexpected error. Please report an issue. Unsupported character: \\.specs$
aha... interesting. maybe you can print the entire stacktrace to stdout? which is an argument to .printStackTrace
sounds good, just need to figure out the details of how -- will bug you if i have trouble 🙂
i did something different -- but may be that would have been enough. too much output so adding to issue.
maybe it has to do with that, but clj-kondo also should be able to run with clojure 1.9.0, so I don't know
i'm puzzled as to why the test framework doesn't explain better which test(s) it's experiencing these issues with.
ok, i guess i'll change compile.bat to include: call lein with-profiles +clojure-1.10.1 do clean, uberjar
then?
i allocated another core to my vm to cope with slowness..it's gradually eating away at my real computing resources 🙂
curious...`lein test` leads to this: https://pastebin.com/7a9GwMqj
I found this out:
Could not parse config! Unsupported character: \\.* "{:linters {:unused-binding {:level :off}, :unresolved-symbol {:level :off}, :refer-all {:level :off}, :type-mismatch {:level :off}, :deprecated-var {:exclude #:foo.foo{deprecated-fn {:namespaces [foo.bar bar\\\\.*], :defs [foo.baz/allowed foo\\\\.baz/ign\\\\.*]}}}}}"
> Caused by: java.lang.ClassNotFoundException: clojure.core$with_meta__5420 That's usually caused by stale target files
wherever we turn, there is the windows escaping beast...there is no escape...or should i say, there is always escape?
i don't understand, lein clean was in the original compile.bat file -- i pulled and tried building + test, and i still see an exception. am i misunderstanding?
it should work with that one. see appveyor (the error was there as well, but is now fixed)
i think it's the same as before, but here is a fresh copy-paste: https://pastebin.com/m0ntm5fB
sorry, for completeness: https://pastebin.com/stgtSMJk
it's the same issue:
"{:linters {:unused-binding {:level :off}, :unresolved-symbol {:level :off}, :refer-all {:level :off}, :type-mismatch {:level :off}, :unused-namespace {:exclude [.*\\\\.specs$]}}}"
cannot be parsed as EDN, somehow the backslashes get doubled by ProcessBuilderno idea -- but we used {0,} as a substitute for * to get native-image to succeed in working with building at some point recently, right?
if you put this into an EDN file:
{:linters {:unused-binding {:level :off}, :unresolved-symbol {:level :off}, :refer-all {:level :off}, :type-mismatch {:level :off}, :unused-namespace {:exclude [.*\\\\.specs$]}}}
you will get:
user=> (edn/read-string (slurp "/tmp/foo.edn"))
Execution error at user/eval3 (REPL:1).
Unsupported character: \\.specs$ok, so this works:
(edn/read-string "{:linters {:unused-binding {:level :off}, :unresolved-symbol {:level :off}, :refer-all {:level :off}, :type-mismatch {:level :off}, :deprecated-var {:exclude #:foo.foo{deprecated-fn {:namespaces [foo.bar \"bar\\\\.*\"], :defs [foo.baz/allowed \"foo\\\\.baz/ign\\\\.*\"]}}}}}")
ah this looks like it: https://bugs.openjdk.java.net/browse/JDK-8131908
could be - am reading - fwiw, there is a quoting tips section in the clj-on-windows tools.deps wiki page
Sun/Oracle refers to this document: https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments?redirectedfrom=MSDN&view=vs-2019
there is no mention of "windows" nor "quote" at: https://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html
awesome! > If an odd number of backslashes is followed by a double quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double quotation mark is "escaped" by the remaining backslash, causing a literal double quotation mark (") to be placed in argv. i guess you did this?
It turns out that my editors lint support saves the buffer to a temporary directory before linting, so the feature of finding config from the path doesn't actually help me. :/
some plugins allow the current working directory to be configured based on the file that is being linted
Well, I don't have evidence, but I suspect the feature is still useful generally. And yeah, it doesn't hurt anythin.g
I'm asking a question in the editor's IRC about how we want to proceed. Perhaps we'll change how the linter works.
https://github.com/marketplace/actions/setup-clj-kondo
setup-clj-kondo for hosted runners in github actions is here) including latest clj-kondo.exe
for running on windows
@eraserhd if I'm not mistaking flycheck has the same behavior actually. because you don't have to save the file for linting, it makes a copy of it somewhere and then lints that file
Ok, I'll look into that. If this is something that several linters need, I'll fix the editor.
maybe the linting behavior of kakaune should be the same, setting the cwd to the parent dir of the file
@eraserhd but this behavior could still be useful for VSCode, I'll have to manually test it. Please keep me updated if we should keep this behavior and if nobody is using it (and it's not useful for VSCode) we can maybe deprecate it again
@eraserhd fwiw, I think emacs does the following: it saves the intermediate state of a file to a tmp file and then invokes the linter piping the input from the tmp file to stdin
so in that case the new feature isn't very beneficial. however I think in the case of VSCode marco morains plugin, it's invoked on save and then using the filename, so it works for that case
All JVM + native tests are passing for Windows now: https://ci.appveyor.com/project/borkdude/clj-kondo/builds/29113922
(thanks again @ales.najmann and @sogaiu for mentally supporting me and providing useful additions)
