This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-24
Channels
- # announcements (11)
- # beginners (72)
- # calva (11)
- # cider (12)
- # clj-kondo (147)
- # clojure (6)
- # clojure-new-zealand (2)
- # clojuredesign-podcast (2)
- # clojurescript (36)
- # cursive (2)
- # datomic (5)
- # emacs (4)
- # fulcro (57)
- # graalvm (104)
- # graphql (2)
- # jobs (1)
- # joker (1)
- # kaocha (3)
- # malli (51)
- # off-topic (2)
- # portkey (1)
- # reagent (18)
- # shadow-cljs (26)
- # spacemacs (7)
- # tools-deps (5)
- # vim (4)
If someone is using the Windows executable or just wants to do a tedious but useful task: https://github.com/borkdude/clj-kondo/issues/233
after installation of clj-on-windows, for an invocation of clojure
in clj-kondo's directory i get:
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
2019/11/24 08:56:38 open .cpcache/ec67dd60.cp: The system cannot find the path specified.
for reference, the above was pilot errorsure for reference, the output at the bottom is:
Ran 120 tests containing 1105 assertions.
44 failures, 2 errors.
Tests failed.
i guess one could take the windows output and make the changes in a non-windows env first
actual: .IOException: Cannot run program "rm": CreateProcess error=2, The system cannot find the file specified
actual: (not (clj-kondo.test-utils/submap? {:file "corpus/defmulti.clj", :row 7, :col 12, :level :error, :message "unresolved symbol greetingx"} {:file "corpus\\defmulti.clj", :row 7, :col 12, :level :error, :message "unresolved symbol greetingx"}))
I could probably patch assert-submaps to handle that magically for :filename
or something, that would already be a quickwin
my summary is slightly different:
Ran 120 tests containing 1105 assertions.
41 failures, 2 errors.
PS C:\Users\alesn> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 18362 145
> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 771
fwiw, when i do lein test
from git bash i get:
Ran 120 tests containing 1113 assertions.
44 failures, 2 errors.
Tests failed.
@ales.najmann btw, thanks for the clojure scoop bucket 🙂
You're welcome 🙂 it's actually not such a big deal. Most of the work has been already done before. I just focused a bit more to deliver the experience.
I'm not sure it it is helpful, but there is probably better way to deal with filepaths with java.nio.file.Paths.get("foo/bar.txt")
and java.nio.file.Path.normalize()
but just swap impl. of normalize-filename
is obviously not enough.
I made a windows-tests branch. Feel free to re-test there and make PRs, even small ones
One useful one would be to port the script/test script to .bat and hook it up on Appveyor
Also wrote it down here: https://github.com/borkdude/clj-kondo/issues/233
@ales.najmann normalize-filename
just coerces all backward slashes to forward slashes, it's a bit of a hack, but I think it suffices.
command prompt results with windows-test branch:
Ran 120 tests containing 1166 assertions.
9 failures, 3 errors.
Tests failed.
that's interesting:
Ran 120 tests containing 1166 assertions.
6 failures, 3 errors.
https://gist.github.com/littleli/a7c77530d3b0a9b5544a65bb2a21da29@ales.najmann I suspect you have the rm
and mv
commands on the path?
PS C:\Users\alesn\Projects\clj-kondo> rm
cmdlet Remove-Item at command pipeline position 1
Supply values for the following parameters:
Path[0]:
PS C:\Users\alesn\Projects\clj-kondo> mv
cmdlet Move-Item at command pipeline position 1
Supply values for the following parameters:
Path[0]:
ERROR in (import-vars-test) (ProcessBuilder.java:1128)
Uncaught exception, not in assertion.
expected: nil
actual: .IOException: Cannot run program "mv": ...
rough summary:
ERRORS
run!-test
cache-test
import-vars-test
FAIL
extract-cljs-core-vars-test x3
nested-namespaced-maps-test
redundant-let-test
read-error-test
exclude-clojure-test
inline-def-tes
invalid-arity-test
In my case:
312:FAIL in (nested-namespaced-maps-test) (main_test.clj:256)
318:FAIL in (redundant-let-test) (main_test.clj:34)
324:FAIL in (read-error-test) (main_test.clj:238)
331:FAIL in (exclude-clojure-test) (main_test.clj:210)
337:FAIL in (inline-def-test) (main_test.clj:19)
522:FAIL in (invalid-arity-test) (main_test.clj:117)
12:ERROR in (run!-test) (Pattern.java:2027)
115:ERROR in (cache-test) (ProcessBuilder.java:1128)
343:ERROR in (import-vars-test) (ProcessBuilder.java:1128)
@ales.najmann i missed some -- now i think my list is complete
'clojure' is not recognized as an internal or external command,
operable program or batch file.
'clojure' is not recognized as an internal or external command,
operable program or batch file.
'clojure' is not recognized as an internal or external command,
operable program or batch file.
'else' is not recognized as an internal or external command,
operable program or batch file.
"Testing with Clojure 1.9.0"
'clojure' is not recognized as an internal or external command,
operable program or batch file.
Terminate batch job (Y/N)? y
Adding ~\scoop\shims to your path.
'lastupdate' has been set to '2019-11-24T19:42:43.8238427+00:00'
Scoop was installed successfully!
Type 'scoop help' for instructions.
powershell -Command "scoop install clojure"
scoop : The term 'scoop' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ scoop install clojure
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (scoop:String) [], CommandNotFou
ndException
+ FullyQualifiedErrorId : CommandNotFoundException
Command exited with code 1
I'll try this as the first step so I don't have to wait for the compilation to finish
Adding ~\scoop\shims to your path.
'lastupdate' has been set to '2019-11-24T19:45:23.8762273+00:00'
Scoop was installed successfully!
Type 'scoop help' for instructions.
scoop install clojure"
'scoop' is not recognized as an internal or external command,
operable program or batch file.
Command exited with code 1
fun with quoting issues:
> clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.9.0"}}}' -Spath
Error while parsing option "--config-data {:deps {org.clojure/clojure {:mvn/version 1.9.0}}}": java.lang.NumberFormatException: Invalid number: 1.9.0
> clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version ""1.9.0""}}}' -Spath
src;parser;resources;inlined;C:\Users\user\.m2\repository\com\cognitect\transit-java\0.8.337\transit-java-0.8.337.jar;C:\Users\user\.m2\repository\org\clojure\clojure\1.9.0\clojure-1.9.0.jar;C:\Users\user\.m2\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;C:\Users\user\.m2\repository\io\lambdaforge\datalog-parser\0.1.1\datalog-parser-0.1.1.jar;C:\Users\user\.m2\repository\org\clojure\core.specs.alpha\0.1.24\core.specs.alpha-0.1.24.jar;C:\Users\user\.m2\repository\org\clojure\spec.alpha\0.1.143\spec.alpha-0.1.143.jar;C:\Users\user\.m2\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.9.6\jackson-dataformat-cbor-2.9.6.jar;C:\Users\user\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\user\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.6\jackson-core-2.9.6.jar;C:\Users\user\.m2\repository\org\javassist\javassist\3.18.1-GA\javassist-3.18.1-GA.jar;C:\Users\user\.m2\repository\org\msgpack\msgpack\0.6.12\msgpack-0.6.12.jar;C:\Users\user\.m2\repository\com\cognitect\transit-clj\0.8.313\transit-clj-0.8.313.jar;C:\Users\user\.m2\repository\cheshire\cheshire\5.8.1\cheshire-5.8.1.jar;C:\Users\user\.m2\repository\tigris\tigris\0.1.1\tigris-0.1.1.jar;C:\Users\user\.m2\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-smile\2.9.6\jackson-dataformat-smile-2.9.6.jar;C:\Users\user\.m2\repository\javax\xml\bind\jaxb-api\2.3.0\jaxb-api-2.3.0.jar
Installing PowerShell module 'ClojureTools'
Linking ~\scoop\modules\ClojureTools => ~\scoop\apps\clojure\current
'clojure' (1.10.1.489) was installed successfully!
'clojure' suggests installing 'java/adopt8-hotspot' or 'java/adoptopenjdk-lts-hotspot' or 'java/oraclejdk' or 'java/openjdk'.
clojure
'clojure' is not recognized as an internal or external command
running clojure from powershell does seem to work, but not from the cmd.exe, using your scoop @ales.najmann?
using powershell I now get:
clojure
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Downloading: org/clojure/clojure/1.10.1/clojure-1.10.1.pom from
I bet that for that reasons there were those shims in the some of the previous versions
"bin" section, see https://github.com/littleli/scoop-clojure/blob/542f156735757aaf007e63aee3a13eba5be422e3/clojure.json#L9
should I add those "-NoProfile -ExecutionPolicy Bypass -Command Invoke-Clojure"
to the powershell command?
init:
- ps: iex (new-object net.webclient).downloadstring('')
- ps: scoop bucket add java
- ps: scoop bucket add scoop-clojure
- ps: scoop install java/adopt8-hotspot
- ps: scoop install clojure
- ps: clojure
it fails in the last stephm: Set-ExecutionPolicy : The method or operation is not implemented. At line:1 char:1 + Set-ExecutionPolicy RemoteSigned -scope CurrentUser
no output:
Linking ~\scoop\modules\ClojureTools => ~\scoop\apps\clojure\current
'clojure' (1.10.1.489) was installed successfully!
scoop which clojure
git clone -q --branch=windows-tests C:\projects\clj-kondo
git checkout -qf 957d1efacc3b9f4dfc8015de2ec6b828dd25e4b5
cmd /C "set CLJ_KONDO_TEST_ENV=jvm && call script/test.bat"
'clojure' is not recognized as an internal or external command,
operable program or batch file.
'clojure' is not recognized as an internal or external command,
operable program or batch file.
afaik, it is correct, because clojure really is a powershell alias, actually defined directly in distribution from official source. There is psmodule definition. You can find it here on this path: \scoop\apps\clojure\current
well, i think what could help is to add some shim that does not interfere with tools like calva
I don't know... clj-cmd, it will be eventually able to run as a command. because scoop creates shim binary for the command, and you can use clj-cmd.exe as a launching command. but that is theoretical.
again, clojure is not a command, it is powershell alias... so cmd.exe sees nothing, right? 🙂
PS C:\Users\alesn> cmd Microsoft Windows [Version 10.0.18362.476]
(c) 2019 Microsoft Corporation. Všechna práva vyhrazena.
C:\Users\alesn>clojure
'clojure' is not recognized as an internal or external command,
operable program or batch file.
the lein tests appear to be running now though: https://ci.appveyor.com/project/borkdude/clj-kondo
which is correct, there should be no shims. unfortunately this is not visible in the above output 😕
only 10 failures and 2 errors on appveyor, progress. clojure is needed to download a few deps