taylorwood / clj.native-image

Build GraalVM native images with Clojure Deps and CLI tools
MIT License
271 stars 20 forks source link

Building with GraalVM on Windows (in Powershell) crashes #6

Closed borkdude closed 5 years ago

borkdude commented 5 years ago

I'm trying to build a binary for Windows with GraalVM 19. I installed tools.deps as per https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows in a Windows VM.

Right now clj.native-image crashes. This is when calling deps.reader/clojure-env. The issue is that tools.deps shells out to clojure (https://github.com/clojure/tools.deps.alpha/blob/0884eb03fda6967204431b59b11a7d56b36bab36/src/main/clojure/clojure/tools/deps/alpha/reader.clj#L19) but apparently this program cannot be resolved, although it is a known command in Powershell itself.

Screenshot 2019-05-13 16 12 23
borkdude commented 5 years ago

Might be helpful, this is how you can set environment variables in PowerShell:

$env:JAVA_HOME="C:\Users\IEUser\Downloads\graalvm"
borkdude commented 5 years ago

@taylorwood FYI, I posted an issue at tools.deps.alpha as well:

https://dev.clojure.org/jira/browse/TDEPS-128

borkdude commented 5 years ago

@taylorwood As a workaround for TDEPS-128 we might just wrap the crashing call in a try/catch, until it's fixed upstream. Windows users of clj.native-image would have to do without deps in their system-wide deps.edn until then (but that's better than nothing at all).

borkdude commented 5 years ago

This is fixed with https://github.com/taylorwood/clj.native-image/pull/9

taylorwood commented 5 years ago

Fixed in 546a77a4492be2f1d9b48e43cb48fb0ebfa39cc2.