Fork me on GitHub
#clj-kondo
<
2019-11-21
>
sogaiu01:11:59

one step closer to windows support command prompt:

echo (inc) | .\clj-kondo.exe --lint -
:1:1: error: clojure.core/inc is called with 0 args but expects 1
linting took 16ms, errors: 1, warnings: 0
powershell:
echo '(inc)' | .\clj-kondo.exe --lint -
:1:1: error: clojure.core/inc is called with 0 args but expects 1
linting took 31ms, errors: 1, warnings: 0

sogaiu02:11:20

@borkdude it appears the following is sufficient for getting IncludeResources to work on windows:

call %GRAALVM_HOME%\bin\native-image.cmd ^
  -jar target/clj-kondo-%CLJ_KONDO_VERSION%-standalone.jar ^
  "-H:Name=clj-kondo" ^
  -H:+ReportExceptionStackTraces ^
  "-J-Dclojure.spec.skip-macros=true" ^
  "-J-Dclojure.compiler.direct-linking=true" ^
  "-H:IncludeResources=clj_kondo/impl/cache/built_in/.{0,}" ^
  "-H:ReflectionConfigurationFiles=reflection.json" ^
  --initialize-at-build-time  ^
  "-H:Log=registerResource:" ^
  --verbose ^
  --no-fallback ^
  "-J-Xmx3g"

borkdude09:11:52

From what I'm seeing on CI, this looks pretty good

borkdude13:11:35

I'm happy to have confirmation from @filipematossilva that the .exe works under Windows now!

4
Filipe Silva13:11:45

if you add it to the release assets for releases, the npm package will just pick it up

Filipe Silva13:11:13

btw I haven't been updating the npm package on each of clj-kondo's release... I wanted to automate that, but haven't

borkdude13:11:53

no worries, I guess people will start asking if they really need it faster than you are doing it

borkdude14:11:51

@marc-omorain maybe there are some Windows users in CircleCI that want to give the clj-kondo.exe a test? Maybe some Calva users, @pez?

Filipe Silva14:11:47

I should make a github action to do that, check the release version of another repo and run a script with the new version

borkdude14:11:36

so the npm package is looking for a windows exe and if it's not there it falls back to the jar?

Filipe Silva14:11:03

for npm distributions the 18mb single file might be a problem

Filipe Silva14:11:40

it makes it more likely that the retrieval from the registry will not succeed

Filipe Silva14:11:15

on some CI envs we see that happening with yarn and large packages

borkdude14:11:20

I see two potential problems with this script: https://github.com/filipesilva/clj-kondo/blob/e4e48a1f2f1ae01dbc2ea4d362b4f44da579f743/index.js#L22 the entry for windows is not there and the binary is named clj-kondo.exe on Windows (not just clj-kondo)

borkdude14:11:44

for now let's just leave it like this

borkdude14:11:00

I'll provide the binary via scoop, and when it gives no further problems, we can migrate it to npm

Filipe Silva14:11:27

but yes, there's no url entry for the windows one there

Marc O'Morain14:11:59

We don’t have any Windows developers afaik

pez15:11:05

@borkdude, just ask for testers in #calva-dev . My experience is that I succeed in recruiting one or two. 😃

borkdude19:11:08

I or someone else should really make a flow diagram of how text -> code -> analysis -> linting works in clj-kondo. If someone really really feels like this, please yell. Probably http://draw.io is a good tool to use because it's free and thus friendly for OSS.

sogaiu19:11:13

have interest in participating, but am in the camp of "needing lots of practice drawing". not sure if i can be much help here.