Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows binary #138

Closed
filipesilva opened this issue Dec 5, 2019 · 59 comments
Closed

Windows binary #138

filipesilva opened this issue Dec 5, 2019 · 59 comments

Comments

@filipesilva
Copy link

Is your feature request related to a problem? Please describe.
It would be nice to also have a windows binary.

Describe the solution you'd like
A windows binary distributed on github, maybe a way to install it too (e.g. a install script like the others).

I'm not sure if there are limitations on how it works, but ideally for me it would work when invoked from cmd, powershell, and gitbash.

Describe alternatives you've considered
I could use WSL and use babashka from there. But that's a fair bit of overhead just to launch it.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I've had success building a stripped-down babashka in a Windows 10 VM.

I don't have a summary ATM of what I did, but one thing that came out of it was:

oracle/graal#1876

It appears there is a fix on the way for that.


Will try to accumulate a summary of the current state in this comment.

TLDR:

By removing some bits, it appears possible to build a version of babashka that runs on Windows 10. Such bits include some unix-specifc parts (e.g. signal-handing) and SSL.

What needs to be done may be different for a Java 8-based build vs a Java 11-based build (e.g. also removed network bits and reflection bits).

The required dev environments also appear to differ (Windows 7.1 SDK vs VS 2017 + bits).

Longer Version:

Java 8-based (Windows 7.1 SDK) build:

reflection.json:

  • removed sun.nio.fs.UnixPath bits
  • removed java.lang.UNIXProcess bits

compile.bat (#138 (comment)):

  • removed SSL bits (the https part of "-H:EnableURLProtocols=http,https")

babashka/main.clj:

  • removed babashka.impl.pipe-signal-handler (handle-pipe! pipe-signal-received?) bits

Java 11-based (VS 2017 + Visual C++ compilers and libraries for ARM64 and Visual C++ tools for CMake) build:

In addition to the Java-8 bits mentioned above:

sci/src/sci/impl/interop.cljc:

  • removed clojure.lang.Reflector bits

network portions:

  • removed clojure.core.server.clj
  • removed socket-repl.clj

some network portions:

  • removed some of wait.clj
  • removed some of main.clj

compile.bat:

  • removed the remaining "-H:EnableURLProtocols=http"

Note: info concerning automated installation of dev bits here: #138 (comment)

@filipesilva
Copy link
Author

Are there considerations that dictate it must be stripped down, or would it be possible to have full functionality?

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I'll try to replicate what was involved.

One thing that didn't work was the pipe-signal-related functionality. Disabling that was one of the things that I did.

@filipesilva
Copy link
Author

Do you think that might work in a gitbash environment or was it just something that's out of the question if running on windows at all?

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I honestly don't know :)

IIRC, at least part of the reason for pipe-signal is there is to support the appropriate termination of the sequence-of-processes-connected-by-pipes construct.

If you don't use babashka in that kind of situation, may be it will be fine for the most part?

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Some other things I removed:

'sun.nio.fs.UnixPath sun.nio.fs.UnixPath

from main.clj and the associated part from reflection.json, and

  {
    "name":"java.lang.UNIXProcess",
    "allPublicMethods":true
  },

from reflection.json.

@filipesilva
Copy link
Author

I hadn't really thought about it, but it does seem both cmd and powershell have pipes. So compatibility there might have specific semantics.

I assume gitbash pipes are similar to unix pipes? I don't really know. But gitbash seems to generally work with bash scripts so it must be doing something right on that front.

Path libs might be hard... I don't know how that's dealt with in the Java ecosystem. But I assume there's a good way, since Java was meant to generally run everywhere.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I just tried this in git bash:

$ ls | ./bb -i '*in*'
("bb.exe*" "bb.exp" "bb.lib" "bb.pdb" "bb-0.0.38-SNAPSHOT-windows-amd64.zip" "doc/" "examples/" "install*" "LICENSE" "project.clj" "README.md" "reflection - Copy.json" "reflection.json" "reflection.json.trial" "resources/" "sci/" "script/" "src/" "target/" "test/" "test-resources/")

@borkdude
Copy link
Collaborator

borkdude commented Dec 5, 2019

A good test for the pipe stuff is the following:

$ bb -O '(range)' | bb -I '(take 3 *in*)'
(0 1 2)

Without the pipe signal, this chain would hang forever.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

It looks messy, but in the vaniall command prompt, I get:

dir | .\bb -i "*in*"
(" Volume in drive C has no label." " Volume Serial Number is DEAD-BEEF" "" " Directory of C:\\Users\\user\\Desktop\\babashka" "" "12/05/2019  11:15 AM    <DIR>          ." "12/05/2019  11:15 AM    <DIR>          .." "11/20/2019  08:00 PM    <DIR>          .circleci" "11/20/2019  08:00 PM    <DIR>          .clj-kondo" "11/20/2019  08:00 PM    <DIR>          .github" "11/20/2019  08:00 PM               187 .gitignore" "11/20/2019  08:00 PM                90 .gitmodules" "12/05/2019  11:15 AM         5,683,781 bb-0.0.38-SNAPSHOT-windows-amd64.zip" "12/05/2019  11:15 AM        19,508,736 bb.exe" "12/05/2019  11:15 AM            70,798 bb.exp" "12/05/2019  11:15 AM           115,352 bb.lib" "12/05/2019  11:15 AM         1,092,608 bb.pdb" "11/20/2019  08:00 PM    <DIR>          doc" "12/05/2019  10:54 AM    <DIR>          examples" "11/20/2019  08:00 PM             1,342 install" "11/20/2019  08:00 PM            11,712 LICENSE" "12/05/2019  10:54 AM             1,415 project.clj" "12/05/2019  10:54 AM            18,002 README.md" "11/20/2019  08:00 PM             3,671 reflection - Copy.json" "12/05/2019  11:03 AM             4,426 reflection.json" "11/20/2019  08:52 PM             3,594 reflection.json.trial" "12/05/2019  10:54 AM    <DIR>          resources" "12/05/2019  10:56 AM    <DIR>          sci" "11/20/2019  08:01 PM    <DIR>          script" "11/20/2019  08:00 PM    <DIR>          src" "12/05/2019  11:12 AM    <DIR>          target" "11/20/2019  08:00 PM    <DIR>          test" "11/20/2019  08:00 PM    <DIR>          test-resources" "              14 File(s)     26,515,714 bytes" "              14 Dir(s)  35,725,574,144 bytes free")

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I tried borkdude's command and it is hanging after giving the following output:

(0 1 2)

This was with both git bash and the vanilla command prompt.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

For reference, below is what I used for compiling:

@echo off

Rem set GRAALVM_HOME=C:\Users\IEUser\Downloads\graalvm\graalvm-ce-19.0.0
Rem set PATH=%PATH%;C:\Users\IEUser\bin

if "%GRAALVM_HOME%"=="" ( 
    echo Please set GRAALVM_HOME
    exit /b
)
set JAVA_HOME=%GRAALVM_HOME%\bin
set PATH=%PATH%;%GRAALVM_HOME%\bin

set /P BABASHKA_VERSION=< resources\BABASHKA_VERSION
echo Building bb %BABASHKA_VERSION%

call lein do clean, uberjar
if %errorlevel% neq 0 exit /b %errorlevel%

Rem the --no-server option is not supported in GraalVM Windows.
call %GRAALVM_HOME%\bin\native-image.cmd ^
  -jar target/babashka-%BABASHKA_VERSION%-standalone.jar ^
  "-H:Name=bb" ^
  -H:+ReportExceptionStackTraces ^
  "-J-Dclojure.spec.skip-macros=true" ^
  "-J-Dclojure.compiler.direct-linking=true" ^
  "-H:IncludeResources=BABASHKA_VERSION" ^
  "-H:IncludeResources=SCI_VERSION" ^
  "-H:ReflectionConfigurationFiles=reflection.json" ^
  "--initialize-at-run-time=java.lang.Math\$RandomNumberGeneratorHolder" ^
  --initialize-at-build-time ^
  "-H:Log=registerResource:" ^
  "-H:EnableURLProtocols=http" ^
  -H:+JNI ^
  --verbose ^
  --no-fallback ^
  "-J-Xmx3g"
if %errorlevel% neq 0 exit /b %errorlevel%

REM echo Creating zip archive
jar -cMf bb-%BABASHKA_VERSION%-windows-amd64.zip bb.exe

I think all I did was to adapt some other borkdude (TM) compile.bat + compile scripts and removed the SSL bits.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Below is a diff for reflection.json:

diff --git a/reflection.json b/reflection.json
index f7253b1..102348f 100644
--- a/reflection.json
+++ b/reflection.json
@@ -118,10 +118,6 @@
     "allPublicFields": true,
     "allPublicConstructors": true
   },
-  {
-    "name":"java.lang.UNIXProcess",
-    "allPublicMethods":true
-  },
   {
     "name":"java.nio.file.Path",
     "allPublicMethods":true
@@ -155,11 +151,5 @@
     "allPublicMethods":true,
     "allPublicFields": true,
     "allPublicConstructors": true
-  },
-  {
-    "name":"sun.nio.fs.UnixPath",
-    "allPublicMethods":true,
-    "allPublicFields": true,
-    "allPublicConstructors": true
   }
 ]

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Below is a diff from main.clj:

diff --git a/src/babashka/main.clj b/src/babashka/main.clj
index b9e2e29..315132f 100644
--- a/src/babashka/main.clj
+++ b/src/babashka/main.clj
@@ -7,7 +7,7 @@
    [babashka.impl.clojure.stacktrace :refer [print-stack-trace]]
    [babashka.impl.conch :refer [conch-namespace]]
    [babashka.impl.csv :as csv]
-   [babashka.impl.pipe-signal-handler :refer [handle-pipe! pipe-signal-received?]]
+   ;;[babashka.impl.pipe-signal-handler :refer [handle-pipe! pipe-signal-received?]]
    [babashka.impl.socket-repl :as socket-repl]
    [babashka.impl.tools.cli :refer [tools-cli-namespace]]
    [babashka.wait :as wait]
@@ -165,7 +165,7 @@ Everything after that is bound to *command-line-args*."))

 (defn main
   [& args]
-  (handle-pipe!)
+  #_(handle-pipe!)
   #_(binding [*out* *err*]
       (prn "M" (meta (get bindings 'future))))
   (let [t0 (System/currentTimeMillis)
@@ -174,7 +174,7 @@ Everything after that is bound to *command-line-args*."))
                 :expression :stream? :time? :socket-repl :verbose?] :as _opts}
         (parse-opts args)
         read-next (fn [*in*]
-                    (if (pipe-signal-received?)
+                    (if nil #_(pipe-signal-received?)
                       ::EOF
                       (if stream?
                         (if shell-in (or (read-line) ::EOF)
@@ -189,7 +189,7 @@ Everything after that is bound to *command-line-args*."))
         ctx {:aliases '{tools.cli 'clojure.tools.cli
                         edn clojure.edn
                         wait babashka.wait
-                        sig babashka.signal
+                        ;;sig babashka.signal
                         shell clojure.java.shell
                         io clojure.java.io
                         conch me.raynes.conch.low-level
@@ -202,7 +202,7 @@ Everything after that is bound to *command-line-args*."))
                           'clojure.java.shell {'sh shell/sh}
                           'babashka.wait {'wait-for-port wait/wait-for-port
                                           'wait-for-path wait/wait-for-path}
-                          'babashka.signal {'pipe-signal-received? pipe-signal-received?}
+                          ;;'babashka.signal {'pipe-signal-received? pipe-signal-received?}
                           'clojure.java.io io-namespace
                           'me.raynes.conch.low-level conch-namespace
                           'clojure.core.async async-namespace
@@ -228,7 +228,6 @@ Everything after that is bound to *command-line-args*."))
                        'java.io.StringWriter java.io.StringWriter
                        'java.lang.System System
                        'java.lang.Thread Thread
-                       'sun.nio.fs.UnixPath sun.nio.fs.UnixPath
                        'java.nio.file.CopyOption java.nio.file.CopyOption
                        'java.nio.file.FileAlreadyExistsException java.nio.file.FileAlreadyExistsException
                        'java.nio.file.Files java.nio.file.Files
@@ -275,7 +274,7 @@ Everything after that is bound to *command-line-args*."))
                                                                edn-out prn)]
                                              (if (coll? res)
                                                (doseq [l res
-                                                       :while (not (pipe-signal-received?))]
+                                                       #_ #_ :while (not (pipe-signal-received?))]
                                                  (pr-f l))
                                                (pr-f res))
                                              (prn res)))) 0]]

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I think that about covers it as I made those changes to the latest babashka, compiled, and reported those command results above.

Haven't tried to port the tests :)

@borkdude
Copy link
Collaborator

borkdude commented Dec 5, 2019

Maybe JDK 11 has better support for the commented out functionality?
Also see: #120

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

That would be nice.

I guess I can get graal 19.3.0 Java 11 and give it a try.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Tried with graal 19.3.0 Java 11...

Could this be some of that Reflector fun you mentioned in #120?

[thread:17] scope: ForkJoinPool-2-worker-3
  [thread:17] scope: ForkJoinPool-2-worker-3.ClosedWorldAnalysis
  Context: StructuredGraph:4234{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
  Context: AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
      [thread:17] scope: ForkJoinPool-2-worker-3.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles
      Context: StructuredGraph:4252{HotSpotMethod<Invokers$Holder.invoke_MT(Object, Object, Object, Object)>}
      Exception raised in scope ForkJoinPool-2-worker-3.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
      To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
        at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.processInvokeWithMethodHandle(IntrinsifyMethodHandlesInvocationPlugin.java:483)
        at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.handleInvoke(IntrinsifyMethodHandlesInvocationPlugin.java:194)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2110)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1793)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1682)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1630)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1615)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5168)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3286)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3093)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:977)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:871)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:221)
        at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
        at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346)
        at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511)
        at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Full details
.\script\compile.bat
Building bb 0.0.38-SNAPSHOT
Compiling babashka.impl.Boolean
Compiling babashka.impl.Double
Compiling babashka.impl.async
Compiling babashka.impl.clojure.core
Compiling babashka.impl.clojure.core.server
Compiling babashka.impl.clojure.java.io
Compiling babashka.impl.clojure.main
Compiling babashka.impl.clojure.stacktrace
Compiling babashka.impl.conch
Compiling babashka.impl.csv
Compiling babashka.impl.exceptions
Compiling babashka.impl.me.raynes.conch.low-level
Compiling babashka.impl.pipe-signal-handler
Compiling babashka.impl.socket-repl
Compiling babashka.impl.tools.cli
Compiling babashka.main
Compiling babashka.wait
Compiling sci.core
Compiling sci.impl.analyzer
Compiling sci.impl.destructure
Compiling sci.impl.doseq-macro
Compiling sci.impl.fns
Compiling sci.impl.for-macro
Compiling sci.impl.interop
Compiling sci.impl.interpreter
Compiling sci.impl.main
Compiling sci.impl.max-or-throw
Compiling sci.impl.namespaces
Compiling sci.impl.parser
Compiling sci.impl.readers
Compiling sci.impl.utils
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT.jar
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar
Warning: the '=' character in program arguments is not fully supported.
Make sure that command line arguments using it are wrapped in double quotes.
Example:
"--vm.Dfoo=bar"

Executing [
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\bin\java.exe
-XX:+UnlockExperimentalVMOptions
-XX:+EnableJVMCI
-Dtruffle.TrustAllTruffleRuntimeProviders=true
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime
-Dgraalvm.ForcePolyglotInvalid=true
-Dgraalvm.locatorDisabled=true
-Dsubstratevm.IgnoreGraalVersionCheck=true
-Djava.lang.invoke.stringConcat=BC_SB
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED
--add-exports
jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED
--add-opens
jdk.internal.vm.compiler/org.graalvm.compiler.debug=ALL-UNNAMED
--add-opens
jdk.internal.vm.compiler/org.graalvm.compiler.nodes=ALL-UNNAMED
--add-opens
jdk.unsupported/sun.reflect=ALL-UNNAMED
--add-opens
java.base/jdk.internal.module=ALL-UNNAMED
--add-opens
java.base/jdk.internal.ref=ALL-UNNAMED
--add-opens
java.base/jdk.internal.reflect=ALL-UNNAMED
--add-opens
java.base/java.io=ALL-UNNAMED
--add-opens
java.base/java.lang=ALL-UNNAMED
--add-opens
java.base/java.lang.reflect=ALL-UNNAMED
--add-opens
java.base/java.lang.invoke=ALL-UNNAMED
--add-opens
java.base/java.lang.ref=ALL-UNNAMED
--add-opens
java.base/java.net=ALL-UNNAMED
--add-opens
java.base/java.nio=ALL-UNNAMED
--add-opens
java.base/java.nio.file=ALL-UNNAMED
--add-opens
java.base/java.security=ALL-UNNAMED
--add-opens
java.base/javax.crypto=ALL-UNNAMED
--add-opens
java.base/java.util=ALL-UNNAMED
--add-opens
java.base/java.util.concurrent.atomic=ALL-UNNAMED
--add-opens
java.base/sun.security.x509=ALL-UNNAMED
--add-opens
java.base/jdk.internal.logger=ALL-UNNAMED
--add-opens
org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED
--add-opens
org.graalvm.sdk/org.graalvm.polyglot=ALL-UNNAMED
--add-opens
org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED
--add-opens
org.graalvm.truffle/com.oracle.truffle.api.impl=ALL-UNNAMED
-XX:+UseJVMCINativeLibrary
-Xss10m
-Xms1g
-Xmx10307544672
-Duser.country=US
-Duser.language=en
-Dorg.graalvm.version=dev
-Dorg.graalvm.config=
-Dcom.oracle.graalvm.isaot=true
--module-path
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\truffle\truffle-api.jar
-javaagent:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar
-Djdk.internal.lambda.disableEagerInitialization=true
-Djdk.internal.lambda.eagerlyInitialize=false
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false
-Dclojure.spec.skip-macros=true
-Dclojure.compiler.direct-linking=true
-Xmx3g
-cp
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar
com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus
-imagecp
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\library-support.jar;C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar
-H:Path=C:\Users\user\Desktop\babashka
-H:Class=babashka.main
-H:+ReportExceptionStackTraces
-H:IncludeResources=BABASHKA_VERSION
-H:IncludeResources=SCI_VERSION
-H:ClassInitialization=java.lang.Math$RandomNumberGeneratorHolder:run_time
-H:ClassInitialization=:build_time
-H:Log=registerResource:
-H:EnableURLProtocols=http
-H:+JNI
-H:FallbackThreshold=0
-H:CLibraryPath=C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64
-H:ReflectionConfigurationFiles=C:\Users\user\Desktop\babashka\reflection.json
-H:Name=bb
]
[bb:3640] classlist: 5,903.64 ms
[bb:3640] (cap): 3,054.70 ms
[bb:3640] setup: 5,791.44 ms
[Use -Dgraal.LogFile= to redirect Graal log output to a file.]
[thread:17] scope: ForkJoinPool-2-worker-3
[thread:17] scope: ForkJoinPool-2-worker-3.ClosedWorldAnalysis
Context: StructuredGraph:4234{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
Context: AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
[thread:17] scope: ForkJoinPool-2-worker-3.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles
Context: StructuredGraph:4252{HotSpotMethod<Invokers$Holder.invoke_MT(Object, Object, Object, Object)>}
Exception raised in scope ForkJoinPool-2-worker-3.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.processInvokeWithMethodHandle(IntrinsifyMethodHandlesInvocationPlugin.java:483)
at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.handleInvoke(IntrinsifyMethodHandlesInvocationPlugin.java:194)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2110)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1793)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1682)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1630)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1615)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5168)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3286)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3093)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:977)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:871)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:221)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346)
at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511)
at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

  Context obj StructuredGraph:4252{HotSpotMethod<Invokers$Holder.invoke_MT(Object, Object, Object, Object)>}
  Context obj com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase@655629b0
  Context obj StructuredGraph:4234{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
  Context obj AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
  Context obj com.oracle.svm.hosted.analysis.flow.SVMMethodTypeFlowBuilder@2851132a
Exception raised in scope ForkJoinPool-2-worker-3.ClosedWorldAnalysis.AnalysisGraphBuilderPhase: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
    at parsing clojure.lang.Reflector.canAccess(Reflector.java:49)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2475)
    at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:93)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3291)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3093)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:977)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:871)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
    at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:221)
    at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340)
    at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310)
    at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300)
    at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
    at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346)
    at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511)
    at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
    at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.processInvokeWithMethodHandle(IntrinsifyMethodHandlesInvocationPlugin.java:483)
    at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.handleInvoke(IntrinsifyMethodHandlesInvocationPlugin.java:194)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2110)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1793)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1682)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1630)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1615)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5168)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3286)
    ... 22 more

Context obj com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase@655629b0
Context obj StructuredGraph:4234{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
Context obj AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
Context obj com.oracle.svm.hosted.analysis.flow.SVMMethodTypeFlowBuilder@2851132a

[thread:14] scope: ForkJoinPool-4-worker-3
[thread:14] scope: ForkJoinPool-4-worker-3.registerResource
ServiceLoaderFeature: registerResource: META-INF/services/java.nio.file.spi.FileSystemProvider
[thread:14] scope: ForkJoinPool-4-worker-3.registerResource
Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
[thread:14] scope: ForkJoinPool-4-worker-3.registerResource
ResourcesFeature: registerResource: SCI_VERSION
[thread:14] scope: ForkJoinPool-4-worker-3.registerResource
ResourcesFeature: registerResource: BABASHKA_VERSION
[bb:3640] analysis: 100,128.94 ms
Fatal error: com.oracle.svm.core.util.VMError$HostedError: class java.net.TwoStacksPlainSocketImpl not found
at com.oracle.svm.core.util.VMError.guarantee(VMError.java:85)
at com.oracle.svm.core.jdk.JNIRegistrationUtil.clazz(JNIRegistrationUtil.java:71)
at com.oracle.svm.core.jdk.JNIRegistrationUtil.fields(JNIRegistrationUtil.java:84)
at com.oracle.svm.hosted.jdk.JNIRegistrationJavaNet.registerPlainSocketImplInitProto(JNIRegistrationJavaNet.java:229)
at com.oracle.svm.hosted.ReachabilityHandlerFeature.duringAnalysis(ReachabilityHandlerFeature.java:114)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$8(NativeImageGenerator.java:710)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:710)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:530)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482)
at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260)
at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222)
at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181)
at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1665)

@borkdude
Copy link
Collaborator

borkdude commented Dec 5, 2019

@sogaiu For now you can comment out the use of clojure.lang.Reflector. I might just copy it and change the source for JDK 11. It doesn't understand the usage of this conditional and dynamic access of a method:

https://github.com/clojure/clojure/blob/653b8465845a78ef7543e0a250078eea2d56b659/src/jvm/clojure/lang/Reflector.java#L37

At the bottom of #120 are some other suggestions.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

@borkdude Please provide more details regarding where to comment out the use of clojure.lang.Reflector :)

@borkdude
Copy link
Collaborator

borkdude commented Dec 5, 2019

@sogaiu That would be here in sci:

https://github.com/borkdude/sci/blob/9ab0b1d181605e4c78eb8a90a75982df5c822514/src/sci/impl/interop.cljc#L3

What we could do is copy the Reflector.java class and distribute it as a separate library that is suited for JDK 11.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Thanks -- though isn't Reflector referred to in the rest of the file in multple locations?

@borkdude
Copy link
Collaborator

borkdude commented Dec 5, 2019

@sogaiu Let me rg that for you:

borkdude@MBP2019 ~/Dropbox/dev/clojure/babashka (var*) $ rg Reflector
sci/src/sci/impl/interop.cljc
3:  #?(:clj (:import [clojure.lang Reflector])))
5:;; see https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java
13:     (Reflector/invokeInstanceMethod obj method (object-array args))
19:     (Reflector/invokeStaticMethod class (str method-name) (object-array args))
24:  #?(:clj (Reflector/getStaticField class (str field-name-sym))
29:  #?(:clj (Reflector/invokeConstructor class (object-array args))

@borkdude
Copy link
Collaborator

borkdude commented Dec 5, 2019

@sogaiu Sorry, I think I misread you. Yes, but you can just uneval those expressions. You won't have interop so things like (.getPath (io/file ".")) won't work, but for the experiment that's ok.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Thanks. I think I misunderstood too, but I have a better idea now :)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

@borkdude Ok, those changes and adding --report-unsupported-elements-at-run-time yields:

[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
[thread:14] scope: ForkJoinPool-4-worker-3
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/java.nio.file.spi.FileSystemProvider
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ResourcesFeature: registerResource: SCI_VERSION
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ResourcesFeature: registerResource: BABASHKA_VERSION
[bb:3816]     analysis:  85,516.86 ms
Fatal error: com.oracle.svm.core.util.VMError$HostedError: class java.net.TwoStacksPlainSocketImpl not found
        at com.oracle.svm.core.util.VMError.guarantee(VMError.java:85)
        at com.oracle.svm.core.jdk.JNIRegistrationUtil.clazz(JNIRegistrationUtil.java:71)
        at com.oracle.svm.core.jdk.JNIRegistrationUtil.fields(JNIRegistrationUtil.java:84)
        at com.oracle.svm.hosted.jdk.JNIRegistrationJavaNet.registerPlainSocketImplInitProto(JNIRegistrationJavaNet.java:229)
        at com.oracle.svm.hosted.ReachabilityHandlerFeature.duringAnalysis(ReachabilityHandlerFeature.java:114)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$8(NativeImageGenerator.java:710)
        at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:710)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:530)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
        at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482)
        at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260)
        at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222)
        at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181)
        at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1665)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Searching for TwoStacksPlainSocketImpl yields a comment in an issue we posted recently...and this: oracle/graal#1870

At least a couple of people have been assigned to 1870 -- but ATM it appears there is no feedback.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I wil try to disable / remove the socket repl and/or network part of wait.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Ah, I just realized I haven't been using the "recommended" dev environment mentioned in oracle/graal#1852 (comment)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

@borkdude I tried removing various network-related looking bits, but I still see the same thing about TwoStacksPlainSocketImpl.

What I did:

  • removed clojure.core.server.clj
  • removed socket-repl.clj
  • removed bits from wait.clj
  • removed bits from main.clj

Is there anything obviously missing at this level of description without going into the details of what I did?

P.S. I have not changed my dev env.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Will try that, thanks.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Ok, got a bit further -- after examining a bit of what's in the reports directory, I remembered having added the following to compile.bat (native-image options):

"-H:EnableURLProtocols=http"

So I took that out, and now I get:

.\script\compile.bat
Building bb 0.0.38-SNAPSHOT
Compiling babashka.impl.Boolean
Compiling babashka.impl.Double
Compiling babashka.impl.async
Compiling babashka.impl.clojure.core
Compiling babashka.impl.clojure.java.io
Compiling babashka.impl.clojure.main
Compiling babashka.impl.clojure.stacktrace
Compiling babashka.impl.conch
Compiling babashka.impl.csv
Compiling babashka.impl.exceptions
Compiling babashka.impl.me.raynes.conch.low-level
Compiling babashka.impl.pipe-signal-handler
Compiling babashka.impl.tools.cli
Compiling babashka.main
Compiling babashka.wait
Compiling sci.core
Compiling sci.impl.analyzer
Compiling sci.impl.destructure
Compiling sci.impl.doseq-macro
Compiling sci.impl.fns
Compiling sci.impl.for-macro
Compiling sci.impl.interop
Compiling sci.impl.interpreter
Compiling sci.impl.main
Compiling sci.impl.max-or-throw
Compiling sci.impl.namespaces
Compiling sci.impl.parser
Compiling sci.impl.readers
Compiling sci.impl.utils
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT.jar
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar
Warning: the '=' character in program arguments is not fully supported.
Make sure that command line arguments using it are wrapped in double quotes.
Example:
"--vm.Dfoo=bar"

Executing [
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\bin\java.exe \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
-Djava.lang.invoke.stringConcat=BC_SB \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.debug=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.nodes=ALL-UNNAMED \
--add-opens \
jdk.unsupported/sun.reflect=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.module=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.io=ALL-UNNAMED \
--add-opens \
java.base/java.lang=ALL-UNNAMED \
--add-opens \
java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens \
java.base/java.lang.ref=ALL-UNNAMED \
--add-opens \
java.base/java.net=ALL-UNNAMED \
--add-opens \
java.base/java.nio=ALL-UNNAMED \
--add-opens \
java.base/java.nio.file=ALL-UNNAMED \
--add-opens \
java.base/java.security=ALL-UNNAMED \
--add-opens \
java.base/javax.crypto=ALL-UNNAMED \
--add-opens \
java.base/java.util=ALL-UNNAMED \
--add-opens \
java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens \
java.base/sun.security.x509=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.logger=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.api.impl=ALL-UNNAMED \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Xmx10307544672 \
-Duser.country=US \
-Duser.language=en \
-Dorg.graalvm.version=dev \
-Dorg.graalvm.config= \
-Dcom.oracle.graalvm.isaot=true \
--module-path \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\truffle\truffle-api.jar \
-javaagent:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
-Dclojure.spec.skip-macros=true \
-Dclojure.compiler.direct-linking=true \
-Xmx3g \
-cp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus \
-imagecp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\library-support.jar;C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar \
-H:Path=C:\Users\user\Desktop\babashka \
-H:Class=babashka.main \
-H:+ReportExceptionStackTraces \
-H:IncludeResources=BABASHKA_VERSION \
-H:IncludeResources=SCI_VERSION \
-H:ClassInitialization=java.lang.Math\$RandomNumberGeneratorHolder:run_time \
-H:ClassInitialization=:build_time \
-H:+ReportUnsupportedElementsAtRuntime \
-H:Log=registerResource: \
-H:+JNI \
-H:FallbackThreshold=0 \
-H:+PrintAnalysisCallTree \
-H:CLibraryPath=C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64 \
-H:ReflectionConfigurationFiles=C:\Users\user\Desktop\babashka\reflection.json \
-H:Name=bb
]
[bb:3652]    classlist:   6,319.31 ms
[bb:3652]        (cap):   3,201.66 ms
[bb:3652]        setup:   6,060.81 ms
[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
[thread:14] scope: ForkJoinPool-4-worker-3
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ResourcesFeature: registerResource: SCI_VERSION
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ResourcesFeature: registerResource: BABASHKA_VERSION
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/java.nio.file.spi.FileSystemProvider
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
[bb:3652]   (typeflow):  50,817.56 ms
[bb:3652]    (objects):  68,571.53 ms
[bb:3652]   (features):   1,236.19 ms
[bb:3652]     analysis: 122,998.48 ms
Printing call tree to C:\Users\user\Desktop\babashka\reports\call_tree_bb_20191205_135801.txt
Printing list of used methods to C:\Users\user\Desktop\babashka\reports\used_methods_bb_20191205_135808.txt
Printing list of used classes to C:\Users\user\Desktop\babashka\reports\used_classes_bb_20191205_135808.txt
Printing list of used packages to C:\Users\user\Desktop\babashka\reports\used_packages_bb_20191205_135808.txt
[bb:3652]     (clinit):     645.43 ms
[bb:3652]     universe:   2,295.10 ms
[bb:3652]      (parse):   7,968.66 ms
[bb:3652]     (inline):   8,069.08 ms
[bb:3652]    (compile):  52,273.64 ms
[bb:3652]      compile:  70,362.32 ms
[bb:3652]        image:   4,249.15 ms
[bb:3652]        write:     728.90 ms
Fatal error: java.lang.RuntimeException: java.lang.RuntimeException: host C compiler or linker does not seem to work: java.lang.RuntimeException: returned 2

Running command: CL /MD /Zi /PDBSTRIPPED /FeC:\Users\user\Desktop\babashka\bb.exe C:\Users\user\AppData\Local\Temp\SVM-17952485241648453338\bb.obj C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib /link /INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64 advapi32.lib ws2_32.lib secur32.lib iphlpapi.lib

Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/PDBSTRIPPED'
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/debug
/out:C:\Users\user\Desktop\babashka\bb.exe
/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib
C:\Users\user\AppData\Local\Temp\SVM-17952485241648453338\bb.obj
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib
   Creating library C:\Users\user\Desktop\babashka\bb.lib and object C:\Users\user\Desktop\babashka\bb.exp
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___acrt_iob_func referenced in function JVM_AddModuleExports
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp___acrt_iob_func
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp___acrt_iob_func
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vfprintf referenced in function _vfprintf_l
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vfprintf
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vfprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vsprintf referenced in function jio_snprintf
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf
net.lib(NetworkInterface_winXP.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf
java.lib(Console_md.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf
net.lib(NetworkInterface.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vsnprintf_s referenced in function _snprintf_s
net.lib(NetworkInterface_winXP.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsnprintf_s
java.lib(ProcessImpl_md.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vswprintf referenced in function _vswprintf_c_l
C:\Users\user\Desktop\babashka\bb.exe : fatal error LNK1120: 5 unresolved externals

        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:600)
        at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:462)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:315)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:454)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:115)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:479)
Caused by: java.lang.RuntimeException: host C compiler or linker does not seem to work: java.lang.RuntimeException: returned 2

Running command: CL /MD /Zi /PDBSTRIPPED /FeC:\Users\user\Desktop\babashka\bb.exe C:\Users\user\AppData\Local\Temp\SVM-17952485241648453338\bb.obj C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib /link /INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64 advapi32.lib ws2_32.lib secur32.lib iphlpapi.lib

Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/PDBSTRIPPED'
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/debug
/out:C:\Users\user\Desktop\babashka\bb.exe
/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib
C:\Users\user\AppData\Local\Temp\SVM-17952485241648453338\bb.obj
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\nio.lib
   Creating library C:\Users\user\Desktop\babashka\bb.lib and object C:\Users\user\Desktop\babashka\bb.exp
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___acrt_iob_func referenced in function JVM_AddModuleExports
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp___acrt_iob_func
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp___acrt_iob_func
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vfprintf referenced in function _vfprintf_l
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vfprintf
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vfprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vsprintf referenced in function jio_snprintf
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf
net.lib(NetworkInterface_winXP.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf
java.lib(Console_md.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf
net.lib(NetworkInterface.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vsnprintf_s referenced in function _snprintf_s
net.lib(NetworkInterface_winXP.obj) : error LNK2001: unresolved external symbol __imp___stdio_common_vsnprintf_s
java.lib(ProcessImpl_md.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vswprintf referenced in function _vswprintf_c_l
C:\Users\user\Desktop\babashka\bb.exe : fatal error LNK1120: 5 unresolved externals

        at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:382)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:652)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
        at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482)
        at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260)
        at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222)
        at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181)
        at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1665)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Found this eclipse-openj9/openj9#1697

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Not really clear yet, but may be this is a place where it will make a difference which dev env is used.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Also found oracle/graal#1850

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

I tried installing https://chocolatey.org/packages/visualstudio2017buildtools -- but the build produced (via the developer prompt):

.\script\compile.bat
Building bb 0.0.38-SNAPSHOT
Compiling babashka.impl.Boolean
Compiling babashka.impl.Double
Compiling babashka.impl.async
Compiling babashka.impl.clojure.core
Compiling babashka.impl.clojure.java.io
Compiling babashka.impl.clojure.main
Compiling babashka.impl.clojure.stacktrace
Compiling babashka.impl.conch
Compiling babashka.impl.csv
Compiling babashka.impl.exceptions
Compiling babashka.impl.me.raynes.conch.low-level
Compiling babashka.impl.pipe-signal-handler
Compiling babashka.impl.tools.cli
Compiling babashka.main
Compiling babashka.wait
Compiling sci.core
Compiling sci.impl.analyzer
Compiling sci.impl.destructure
Compiling sci.impl.doseq-macro
Compiling sci.impl.fns
Compiling sci.impl.for-macro
Compiling sci.impl.interop
Compiling sci.impl.interpreter
Compiling sci.impl.main
Compiling sci.impl.max-or-throw
Compiling sci.impl.namespaces
Compiling sci.impl.parser
Compiling sci.impl.readers
Compiling sci.impl.utils
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT.jar
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar
Warning: the '=' character in program arguments is not fully supported.
Make sure that command line arguments using it are wrapped in double quotes.
Example:
"--vm.Dfoo=bar"

Executing [
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\bin\java.exe \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
-Djava.lang.invoke.stringConcat=BC_SB \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.debug=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.nodes=ALL-UNNAMED \
--add-opens \
jdk.unsupported/sun.reflect=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.module=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.io=ALL-UNNAMED \
--add-opens \
java.base/java.lang=ALL-UNNAMED \
--add-opens \
java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens \
java.base/java.lang.ref=ALL-UNNAMED \
--add-opens \
java.base/java.net=ALL-UNNAMED \
--add-opens \
java.base/java.nio=ALL-UNNAMED \
--add-opens \
java.base/java.nio.file=ALL-UNNAMED \
--add-opens \
java.base/java.security=ALL-UNNAMED \
--add-opens \
java.base/javax.crypto=ALL-UNNAMED \
--add-opens \
java.base/java.util=ALL-UNNAMED \
--add-opens \
java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens \
java.base/sun.security.x509=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.logger=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.api.impl=ALL-UNNAMED \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Xmx10307544672 \
-Duser.country=US \
-Duser.language=en \
-Dorg.graalvm.version=dev \
-Dorg.graalvm.config= \
-Dcom.oracle.graalvm.isaot=true \
--module-path \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\truffle\truffle-api.jar \
-javaagent:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
-Dclojure.spec.skip-macros=true \
-Dclojure.compiler.direct-linking=true \
-Xmx3g \
-cp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus \
-imagecp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\library-support.jar;C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar \
-H:Path=C:\Users\user\Desktop\babashka \
-H:Class=babashka.main \
-H:+ReportExceptionStackTraces \
-H:IncludeResources=BABASHKA_VERSION \
-H:IncludeResources=SCI_VERSION \
-H:ClassInitialization=java.lang.Math\$RandomNumberGeneratorHolder:run_time \
-H:ClassInitialization=:build_time \
-H:+ReportUnsupportedElementsAtRuntime \
-H:Log=registerResource: \
-H:+JNI \
-H:FallbackThreshold=0 \
-H:+PrintAnalysisCallTree \
-H:CLibraryPath=C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64 \
-H:ReflectionConfigurationFiles=C:\Users\user\Desktop\babashka\reflection.json \
-H:Name=bb
]
[bb:1292]    classlist:   6,124.23 ms
[bb:1292]        (cap):     587.88 ms
[bb:1292]        setup:   1,194.32 ms
Error: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system.
com.oracle.svm.core.util.UserError$UserException: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system.
        at com.oracle.svm.core.util.UserError.abort(UserError.java:75)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:93)
        at com.oracle.svm.hosted.c.CAnnotationProcessor.compileQueryCode(CAnnotationProcessor.java:131)
        at com.oracle.svm.hosted.c.CAnnotationProcessor.process(CAnnotationProcessor.java:84)
        at com.oracle.svm.hosted.c.NativeLibraries.finish(NativeLibraries.java:369)
        at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1517)
        at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:1006)
        at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:835)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:528)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: java.io.IOException: Cannot run program "CL" (in directory "C:\Users\user\AppData\Local\Temp\SVM-16612737639506175762"): CreateProcess error=2, The system cannot find the file specified
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.startCommand(CCompilerInvoker.java:146)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.startCompiler(CCompilerInvoker.java:128)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:69)
        ... 14 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.base/java.lang.ProcessImpl.create(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:478)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
        ... 18 more
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
        at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482)
        at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260)
        at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222)
        at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181)
        at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1665)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

Looking closely at some of the commands for activating the development environment [1], it might be better to try:

choco install visualstudio2017community

I'll try that next.


[1] remkop mentioned:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

in oracle/graal#1852 (comment)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 5, 2019

As a side note, remkop mentioned in oracle/graal#1852 (comment):

making sure to include Visual C++ compilers and libraries for ARM64 and Visual C++ tools for CMake

I don't know if either of the choco commands above cause this to occur.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

Unfortunately, the above choco command for the community edition appears to have been insufficient:

.\script\compile.bat
Building bb 0.0.38-SNAPSHOT
Compiling babashka.impl.Boolean
Compiling babashka.impl.Double
Compiling babashka.impl.async
Compiling babashka.impl.clojure.core
Compiling babashka.impl.clojure.java.io
Compiling babashka.impl.clojure.main
Compiling babashka.impl.clojure.stacktrace
Compiling babashka.impl.conch
Compiling babashka.impl.csv
Compiling babashka.impl.exceptions
Compiling babashka.impl.me.raynes.conch.low-level
Compiling babashka.impl.pipe-signal-handler
Compiling babashka.impl.tools.cli
Compiling babashka.main
Compiling babashka.wait
Compiling sci.core
Compiling sci.impl.analyzer
Compiling sci.impl.destructure
Compiling sci.impl.doseq-macro
Compiling sci.impl.fns
Compiling sci.impl.for-macro
Compiling sci.impl.interop
Compiling sci.impl.interpreter
Compiling sci.impl.main
Compiling sci.impl.max-or-throw
Compiling sci.impl.namespaces
Compiling sci.impl.parser
Compiling sci.impl.readers
Compiling sci.impl.utils
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT.jar
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar
Warning: the '=' character in program arguments is not fully supported.
Make sure that command line arguments using it are wrapped in double quotes.
Example:
"--vm.Dfoo=bar"

Executing [
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\bin\java.exe \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
-Djava.lang.invoke.stringConcat=BC_SB \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.debug=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.nodes=ALL-UNNAMED \
--add-opens \
jdk.unsupported/sun.reflect=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.module=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.io=ALL-UNNAMED \
--add-opens \
java.base/java.lang=ALL-UNNAMED \
--add-opens \
java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens \
java.base/java.lang.ref=ALL-UNNAMED \
--add-opens \
java.base/java.net=ALL-UNNAMED \
--add-opens \
java.base/java.nio=ALL-UNNAMED \
--add-opens \
java.base/java.nio.file=ALL-UNNAMED \
--add-opens \
java.base/java.security=ALL-UNNAMED \
--add-opens \
java.base/javax.crypto=ALL-UNNAMED \
--add-opens \
java.base/java.util=ALL-UNNAMED \
--add-opens \
java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens \
java.base/sun.security.x509=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.logger=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.api.impl=ALL-UNNAMED \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Xmx10307544672 \
-Duser.country=US \
-Duser.language=en \
-Dorg.graalvm.version=dev \
-Dorg.graalvm.config= \
-Dcom.oracle.graalvm.isaot=true \
--module-path \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\truffle\truffle-api.jar \
-javaagent:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
-Dclojure.spec.skip-macros=true \
-Dclojure.compiler.direct-linking=true \
-Xmx3g \
-cp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus \
-imagecp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\library-support.jar;C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar \
-H:Path=C:\Users\user\Desktop\babashka \
-H:Class=babashka.main \
-H:+ReportExceptionStackTraces \
-H:IncludeResources=BABASHKA_VERSION \
-H:IncludeResources=SCI_VERSION \
-H:ClassInitialization=java.lang.Math\$RandomNumberGeneratorHolder:run_time \
-H:ClassInitialization=:build_time \
-H:+ReportUnsupportedElementsAtRuntime \
-H:Log=registerResource: \
-H:+JNI \
-H:FallbackThreshold=0 \
-H:+PrintAnalysisCallTree \
-H:CLibraryPath=C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64 \
-H:ReflectionConfigurationFiles=C:\Users\user\Desktop\babashka\reflection.json \
-H:Name=bb
]
[bb:3596]    classlist:   8,464.73 ms
[bb:3596]        (cap):     663.85 ms
[bb:3596]        setup:   1,445.86 ms
Error: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system.
com.oracle.svm.core.util.UserError$UserException: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system.
        at com.oracle.svm.core.util.UserError.abort(UserError.java:75)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:93)
        at com.oracle.svm.hosted.c.CAnnotationProcessor.compileQueryCode(CAnnotationProcessor.java:131)
        at com.oracle.svm.hosted.c.CAnnotationProcessor.process(CAnnotationProcessor.java:84)
        at com.oracle.svm.hosted.c.NativeLibraries.finish(NativeLibraries.java:369)
        at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1517)
        at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:1006)
        at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:835)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:528)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: java.io.IOException: Cannot run program "CL" (in directory "C:\Users\user\AppData\Local\Temp\SVM-8487788377848132664"): CreateProcess error=2, The system cannot find the file specified
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.startCommand(CCompilerInvoker.java:146)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.startCompiler(CCompilerInvoker.java:128)
        at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:69)
        ... 14 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.base/java.lang.ProcessImpl.create(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:478)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
        ... 18 more
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
        at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482)
        at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260)
        at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222)
        at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181)
        at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1665)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

The command that remkop mentioned:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

doesn't work:

The system cannot find the path specified.

so perhaps some bits are missing.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

The choco command for the community edition does lead to being able to launch the graphical installer "Visual Studio Installer" from which one can do the following:

  • Click the "Modify" button (within the Installed section)
  • Click the "Individual components" tab
  • Scroll to the "Compilers, build tools, and runtimes" section
  • Click the checkboxen for "Visual C++ compilers and libraries for ARM64" and "Visual C++ tools for CMake" (note, this lead to at least one other checkbox being checked for me)
  • Click the "Modify" (I think it was) button at the bottom right of the window...and wait (at least a 1.4GB download)

May be there's some way to automate this?

At any rate, after the above sequence completed, the command:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

is successful!

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

Found this:

When you install Visual Studio from a command prompt, you can use a variety of command-line parameters to control or customize the installation. From the command line, you can perform the following actions:

  • Start the install with certain options preselected.
  • Automate the installation process.
  • Create a cache (layout) of the installation files for later use.

The command-line options are used in conjunction with the setup bootstrapper, which is the small (1 MB) file that initiates the download process. The bootstrapper is the first executable that is launched when you download from the Visual Studio site.

To get a bootstrapper for Visual Studio 2017, see the Visual Studio previous versions download page for details on how to do so.

more at:

https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2017

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

Successful build and run :)

.\script\compile.bat
Building bb 0.0.38-SNAPSHOT
Compiling babashka.impl.Boolean
Compiling babashka.impl.Double
Compiling babashka.impl.async
Compiling babashka.impl.clojure.core
Compiling babashka.impl.clojure.java.io
Compiling babashka.impl.clojure.main
Compiling babashka.impl.clojure.stacktrace
Compiling babashka.impl.conch
Compiling babashka.impl.csv
Compiling babashka.impl.exceptions
Compiling babashka.impl.me.raynes.conch.low-level
Compiling babashka.impl.pipe-signal-handler
Compiling babashka.impl.tools.cli
Compiling babashka.main
Compiling babashka.wait
Compiling sci.core
Compiling sci.impl.analyzer
Compiling sci.impl.destructure
Compiling sci.impl.doseq-macro
Compiling sci.impl.fns
Compiling sci.impl.for-macro
Compiling sci.impl.interop
Compiling sci.impl.interpreter
Compiling sci.impl.main
Compiling sci.impl.max-or-throw
Compiling sci.impl.namespaces
Compiling sci.impl.parser
Compiling sci.impl.readers
Compiling sci.impl.utils
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT.jar
Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar
Warning: the '=' character in program arguments is not fully supported.
Make sure that command line arguments using it are wrapped in double quotes.
Example:
"--vm.Dfoo=bar"

Executing [
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\bin\java.exe \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
-Djava.lang.invoke.stringConcat=BC_SB \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
--add-exports \
jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.debug=ALL-UNNAMED \
--add-opens \
jdk.internal.vm.compiler/org.graalvm.compiler.nodes=ALL-UNNAMED \
--add-opens \
jdk.unsupported/sun.reflect=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.module=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.io=ALL-UNNAMED \
--add-opens \
java.base/java.lang=ALL-UNNAMED \
--add-opens \
java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens \
java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens \
java.base/java.lang.ref=ALL-UNNAMED \
--add-opens \
java.base/java.net=ALL-UNNAMED \
--add-opens \
java.base/java.nio=ALL-UNNAMED \
--add-opens \
java.base/java.nio.file=ALL-UNNAMED \
--add-opens \
java.base/java.security=ALL-UNNAMED \
--add-opens \
java.base/javax.crypto=ALL-UNNAMED \
--add-opens \
java.base/java.util=ALL-UNNAMED \
--add-opens \
java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens \
java.base/sun.security.x509=ALL-UNNAMED \
--add-opens \
java.base/jdk.internal.logger=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED \
--add-opens \
org.graalvm.sdk/org.graalvm.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED \
--add-opens \
org.graalvm.truffle/com.oracle.truffle.api.impl=ALL-UNNAMED \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Xmx10307544672 \
-Duser.country=US \
-Duser.language=en \
-Dorg.graalvm.version=dev \
-Dorg.graalvm.config= \
-Dcom.oracle.graalvm.isaot=true \
--module-path \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\truffle\truffle-api.jar \
-javaagent:C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
-Dclojure.spec.skip-macros=true \
-Dclojure.compiler.direct-linking=true \
-Xmx3g \
-cp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar \
com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus \
-imagecp \
C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\builder\svm.jar;C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\library-support.jar;C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar \
-H:Path=C:\Users\user\Desktop\babashka \
-H:Class=babashka.main \
-H:+ReportExceptionStackTraces \
-H:IncludeResources=BABASHKA_VERSION \
-H:IncludeResources=SCI_VERSION \
-H:ClassInitialization=java.lang.Math\$RandomNumberGeneratorHolder:run_time \
-H:ClassInitialization=:build_time \
-H:+ReportUnsupportedElementsAtRuntime \
-H:Log=registerResource: \
-H:+JNI \
-H:FallbackThreshold=0 \
-H:CLibraryPath=C:\Users\user\Desktop\graalvm-ce-java11-19.3.0\lib\svm\clibraries\windows-amd64 \
-H:ReflectionConfigurationFiles=C:\Users\user\Desktop\babashka\reflection.json \
-H:Name=bb
]
[bb:1668]    classlist:   6,974.56 ms
[bb:1668]        (cap):   4,282.96 ms
[bb:1668]        setup:   6,997.52 ms
[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
[thread:14] scope: ForkJoinPool-4-worker-3
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ResourcesFeature: registerResource: SCI_VERSION
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ResourcesFeature: registerResource: BABASHKA_VERSION
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/java.nio.file.spi.FileSystemProvider
  [thread:14] scope: ForkJoinPool-4-worker-3.registerResource
  Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
[bb:1668]   (typeflow):  49,945.98 ms
[bb:1668]    (objects):  72,254.61 ms
[bb:1668]   (features):   1,644.64 ms
[bb:1668]     analysis: 126,720.02 ms
[bb:1668]     (clinit):     757.96 ms
[bb:1668]     universe:   5,717.02 ms
[bb:1668]      (parse):   7,311.56 ms
[bb:1668]     (inline):  10,007.61 ms
[bb:1668]    (compile):  53,771.34 ms
[bb:1668]      compile:  73,007.70 ms
[bb:1668]        image:   4,146.22 ms
[bb:1668]        write:     744.03 ms
[bb:1668]      [total]: 225,097.43 ms

C:\Users\user\Desktop\babashka>.\bb "(print \"hi\")"
hi

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

Thanks to @filipesilva's info on slack, here is a sketch of a command that might be used to automate the installation of vs 2017 and associated bits:

choco install visualstudio2017community --version 15.9.17.0 --no-progress --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.CMake.Project"

The names for what to add were obtained via:

https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2017

which in turn was found via his posted link:

https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids?view=vs-2017

May be we want the "-y" flag too.

Haven't tested it yet.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

I didn't have a clean environment to test from scratch, but I uninstalled once and then ran (in powershell):

choco install visualstudio2017community --version 15.9.17.0 --no-progress --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.CMake.Project"

Haven't tried the "-y" flag yet (appears to work), but after answering a prompt and waiting a fair bit, it seemed the installation was successful.

Then (in a command prompt):

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

Observed success.

Then, ran the build script in the same command prompt window.

Observed successful compilation.

Finally, successful trivial run of bb.exe.

@filipesilva
Copy link
Author

Github actions Windows runners already contain VS 2019 with the CMake workload, but not the ARM64 one: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners#windows-server-2019

Testing windows builds in those machines should reduce total run time by not having to download everything.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

If that works out, it would certainly be nicer :)

FWIW, IIUC, there are some opinions among the oracle/graal issues that since the devs seem to be using VS 2017, it might be less problematic to use that version.

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

As an experiment, I tried a native-image build of babashka using graal 19.3.0 Java 8 and the VS 2017 bits.

It didn't work as-is.

I'm not sure if it's supposed to work.

Full output .\script\compile.bat Building bb 0.0.38-SNAPSHOT Compiling babashka.impl.Boolean Compiling babashka.impl.Double Compiling babashka.impl.async Compiling babashka.impl.clojure.core Compiling babashka.impl.clojure.java.io Compiling babashka.impl.clojure.main Compiling babashka.impl.clojure.stacktrace Compiling babashka.impl.conch Compiling babashka.impl.csv Compiling babashka.impl.exceptions Compiling babashka.impl.me.raynes.conch.low-level Compiling babashka.impl.pipe-signal-handler Compiling babashka.impl.tools.cli Compiling babashka.main Compiling babashka.wait Compiling sci.core Compiling sci.impl.analyzer Compiling sci.impl.destructure Compiling sci.impl.doseq-macro Compiling sci.impl.fns Compiling sci.impl.for-macro Compiling sci.impl.interop Compiling sci.impl.interpreter Compiling sci.impl.main Compiling sci.impl.max-or-throw Compiling sci.impl.namespaces Compiling sci.impl.parser Compiling sci.impl.readers Compiling sci.impl.utils Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT.jar Created C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar Warning: the '=' character in program arguments is not fully supported. Make sure that command line arguments using it are wrapped in double quotes. Example: "--vm.Dfoo=bar"

Executing [
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\bin\java.exe
-XX:+UnlockExperimentalVMOptions
-XX:+EnableJVMCI
-Dtruffle.TrustAllTruffleRuntimeProviders=true
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime
-Dgraalvm.ForcePolyglotInvalid=true
-Dgraalvm.locatorDisabled=true
-d64
-XX:-UseJVMCIClassLoader
-XX:+UseJVMCINativeLibrary
-Xss10m
-Xms1g
-Xmx10307544672
-Duser.country=US
-Duser.language=en
-Dorg.graalvm.version=dev
-Dorg.graalvm.config=
-Dcom.oracle.graalvm.isaot=true
-Djvmci.class.path.append=C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\graal.jar
-javaagent:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\builder\svm.jar
-Djdk.internal.lambda.disableEagerInitialization=true
-Djdk.internal.lambda.eagerlyInitialize=false
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false
-Dclojure.spec.skip-macros=true
-Dclojure.compiler.direct-linking=true
-Xmx3g
-Xbootclasspath/a:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\boot\graal-sdk.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\boot\graaljs-scriptengine.jar
-cp
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\builder\svm.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\graal-management.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\graal.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\jvmci-api.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\jvmci-hotspot.jar
com.oracle.svm.hosted.NativeImageGeneratorRunner
-imagecp
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\boot\graal-sdk.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\boot\graaljs-scriptengine.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\builder\objectfile.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\builder\pointsto.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\builder\svm.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\graal-management.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\graal.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\jvmci-api.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\jvmci\jvmci-hotspot.jar;C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\library-support.jar;C:\Users\user\Desktop\babashka\target\babashka-0.0.38-SNAPSHOT-standalone.jar
-H:Path=C:\Users\user\Desktop\babashka
-H:Class=babashka.main
-H:+ReportExceptionStackTraces
-H:IncludeResources=BABASHKA_VERSION
-H:IncludeResources=SCI_VERSION
-H:ClassInitialization=java.lang.Math$RandomNumberGeneratorHolder:run_time
-H:ClassInitialization=:build_time
-H:+ReportUnsupportedElementsAtRuntime
-H:Log=registerResource:
-H:+JNI
-H:FallbackThreshold=0
-H:CLibraryPath=C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64
-H:ReflectionConfigurationFiles=C:\Users\user\Desktop\babashka\reflection.json
-H:Name=bb
]
[bb:1340] classlist: 8,451.97 ms
[bb:1340] (cap): 4,784.71 ms
[bb:1340] setup: 7,556.49 ms
[Use -Dgraal.LogFile= to redirect Graal log output to a file.]
[thread:13] scope: ForkJoinPool-4-worker-1
[thread:13] scope: ForkJoinPool-4-worker-1.registerResource
ResourcesFeature: registerResource: SCI_VERSION
[thread:13] scope: ForkJoinPool-4-worker-1.registerResource
ResourcesFeature: registerResource: BABASHKA_VERSION
[thread:13] scope: ForkJoinPool-4-worker-1.registerResource
ServiceLoaderFeature: registerResource: META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor
[thread:13] scope: ForkJoinPool-4-worker-1.registerResource
ServiceLoaderFeature: registerResource: META-INF/services/java.nio.file.spi.FileSystemProvider
[thread:13] scope: ForkJoinPool-4-worker-1.registerResource
Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
[bb:1340] (typeflow): 35,348.35 ms
[bb:1340] (objects): 20,517.60 ms
[bb:1340] (features): 1,035.20 ms
[bb:1340] analysis: 58,157.75 ms
[bb:1340] (clinit): 690.02 ms
[bb:1340] universe: 1,913.90 ms
[bb:1340] (parse): 5,646.41 ms
[bb:1340] (inline): 10,767.60 ms
[bb:1340] (compile): 54,440.58 ms
[bb:1340] compile: 73,169.14 ms
[bb:1340] image: 3,361.77 ms
[bb:1340] write: 646.67 ms
Fatal error: java.lang.RuntimeException: java.lang.RuntimeException: host C compiler or linker does not seem to work: java.lang.RuntimeException: returned 2

Running command: CL /MD /Zi /PDBSTRIPPED /FeC:\Users\user\Desktop\babashka\bb.exe C:\Users\user\AppData\Local\Temp\SVM-3419764194800344559\bb.obj C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib /link /INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64 advapi32.lib ws2_32.lib secur32.lib iphlpapi.lib

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27034 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/PDBSTRIPPED'
Microsoft (R) Incremental Linker Version 14.16.27034.0
Copyright (C) Microsoft Corporation. All rights reserved.

/debug
/out:C:\Users\user\Desktop\babashka\bb.exe
/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib
C:\Users\user\AppData\Local\Temp\SVM-3419764194800344559\bb.obj
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib
libchelper.lib(cpuid.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'libchelper.lib(cpuid.obj)' or at 'C:\Users\user\Desktop\babashka\vc100.pdb'; linking object as if no debug info
jvm.lib(JvmFuncs.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'jvm.lib(JvmFuncs.obj)' or at 'C:\Users\user\Desktop\babashka\vc100.pdb'; linking object as if no debug info
net.lib(Inet4AddressImpl.obj) : warning LNK4099: PDB 'inet4addressimpl.pdb' was not found with 'net.lib(Inet4AddressImpl.obj)' or at 'C:\Users\user\Desktop\babashka\inet4addressimpl.pdb'; linking object as if no debug info
net.lib(Inet4Address.obj) : warning LNK4099: PDB 'inet4address.pdb' was not found with 'net.lib(Inet4Address.obj)' or at 'C:\Users\user\Desktop\babashka\inet4address.pdb'; linking object as if no debug info
net.lib(Inet6AddressImpl.obj) : warning LNK4099: PDB 'inet6addressimpl.pdb' was not found with 'net.lib(Inet6AddressImpl.obj)' or at 'C:\Users\user\Desktop\babashka\inet6addressimpl.pdb'; linking object as if no debug info
net.lib(Inet6Address.obj) : warning LNK4099: PDB 'inet6address.pdb' was not found with 'net.lib(Inet6Address.obj)' or at 'C:\Users\user\Desktop\babashka\inet6address.pdb'; linking object as if no debug info
net.lib(InetAddressImplFactory.obj) : warning LNK4099: PDB 'inetaddressimplfactory.pdb' was not found with 'net.lib(InetAddressImplFactory.obj)' or at 'C:\Users\user\Desktop\babashka\inetaddressimplfactory.pdb'; linking object as if no debug info
net.lib(InetAddress.obj) : warning LNK4099: PDB 'inetaddress.pdb' was not found with 'net.lib(InetAddress.obj)' or at 'C:\Users\user\Desktop\babashka\inetaddress.pdb'; linking object as if no debug info
net.lib(NetworkInterface.obj) : warning LNK4099: PDB 'networkinterface.pdb' was not found with 'net.lib(NetworkInterface.obj)' or at 'C:\Users\user\Desktop\babashka\networkinterface.pdb'; linking object as if no debug info
net.lib(ResolverConfigurationImpl.obj) : warning LNK4099: PDB 'resolverconfigurationimpl.pdb' was not found with 'net.lib(ResolverConfigurationImpl.obj)' or at 'C:\Users\user\Desktop\babashka\resolverconfigurationimpl.pdb'; linking object as if no debug info
net.lib(net_util_md.obj) : warning LNK4099: PDB 'net_util_md.pdb' was not found with 'net.lib(net_util_md.obj)' or at 'C:\Users\user\Desktop\babashka\net_util_md.pdb'; linking object as if no debug info
net.lib(net_util.obj) : warning LNK4099: PDB 'net_util.pdb' was not found with 'net.lib(net_util.obj)' or at 'C:\Users\user\Desktop\babashka\net_util.pdb'; linking object as if no debug info
net.lib(NetworkInterface_winXP.obj) : warning LNK4099: PDB 'networkinterface_winxp.pdb' was not found with 'net.lib(NetworkInterface_winXP.obj)' or at 'C:\Users\user\Desktop\babashka\networkinterface_winxp.pdb'; linking object as if no debug info
java.lib(jni_util.obj) : warning LNK4099: PDB 'jni_util.pdb' was not found with 'java.lib(jni_util.obj)' or at 'C:\Users\user\Desktop\babashka\jni_util.pdb'; linking object as if no debug info
java.lib(Console_md.obj) : warning LNK4099: PDB 'console_md.pdb' was not found with 'java.lib(Console_md.obj)' or at 'C:\Users\user\Desktop\babashka\console_md.pdb'; linking object as if no debug info
java.lib(FileDescriptor_md.obj) : warning LNK4099: PDB 'filedescriptor_md.pdb' was not found with 'java.lib(FileDescriptor_md.obj)' or at 'C:\Users\user\Desktop\babashka\filedescriptor_md.pdb'; linking object as if no debug info
java.lib(FileInputStream.obj) : warning LNK4099: PDB 'fileinputstream.pdb' was not found with 'java.lib(FileInputStream.obj)' or at 'C:\Users\user\Desktop\babashka\fileinputstream.pdb'; linking object as if no debug info
java.lib(FileInputStream_md.obj) : warning LNK4099: PDB 'fileinputstream_md.pdb' was not found with 'java.lib(FileInputStream_md.obj)' or at 'C:\Users\user\Desktop\babashka\fileinputstream_md.pdb'; linking object as if no debug info
java.lib(FileOutputStream_md.obj) : warning LNK4099: PDB 'fileoutputstream_md.pdb' was not found with 'java.lib(FileOutputStream_md.obj)' or at 'C:\Users\user\Desktop\babashka\fileoutputstream_md.pdb'; linking object as if no debug info
java.lib(WinNTFileSystem_md.obj) : warning LNK4099: PDB 'winntfilesystem_md.pdb' was not found with 'java.lib(WinNTFileSystem_md.obj)' or at 'C:\Users\user\Desktop\babashka\winntfilesystem_md.pdb'; linking object as if no debug info
java.lib(ProcessEnvironment_md.obj) : warning LNK4099: PDB 'processenvironment_md.pdb' was not found with 'java.lib(ProcessEnvironment_md.obj)' or at 'C:\Users\user\Desktop\babashka\processenvironment_md.pdb'; linking object as if no debug info
java.lib(ProcessImpl_md.obj) : warning LNK4099: PDB 'processimpl_md.pdb' was not found with 'java.lib(ProcessImpl_md.obj)' or at 'C:\Users\user\Desktop\babashka\processimpl_md.pdb'; linking object as if no debug info
java.lib(Shutdown.obj) : warning LNK4099: PDB 'shutdown.pdb' was not found with 'java.lib(Shutdown.obj)' or at 'C:\Users\user\Desktop\babashka\shutdown.pdb'; linking object as if no debug info
java.lib(jio.obj) : warning LNK4099: PDB 'jio.pdb' was not found with 'java.lib(jio.obj)' or at 'C:\Users\user\Desktop\babashka\jio.pdb'; linking object as if no debug info
java.lib(canonicalize_md.obj) : warning LNK4099: PDB 'canonicalize_md.pdb' was not found with 'java.lib(canonicalize_md.obj)' or at 'C:\Users\user\Desktop\babashka\canonicalize_md.pdb'; linking object as if no debug info
java.lib(jni_util_md.obj) : warning LNK4099: PDB 'jni_util_md.pdb' was not found with 'java.lib(jni_util_md.obj)' or at 'C:\Users\user\Desktop\babashka\jni_util_md.pdb'; linking object as if no debug info
java.lib(io_util_md.obj) : warning LNK4099: PDB 'io_util_md.pdb' was not found with 'java.lib(io_util_md.obj)' or at 'C:\Users\user\Desktop\babashka\io_util_md.pdb'; linking object as if no debug info
java.lib(io_util.obj) : warning LNK4099: PDB 'io_util.pdb' was not found with 'java.lib(io_util.obj)' or at 'C:\Users\user\Desktop\babashka\io_util.pdb'; linking object as if no debug info
nio.lib(FileChannelImpl.obj) : warning LNK4099: PDB 'filechannelimpl.pdb' was not found with 'nio.lib(FileChannelImpl.obj)' or at 'C:\Users\user\Desktop\babashka\filechannelimpl.pdb'; linking object as if no debug info
nio.lib(FileDispatcherImpl.obj) : warning LNK4099: PDB 'filedispatcherimpl.pdb' was not found with 'nio.lib(FileDispatcherImpl.obj)' or at 'C:\Users\user\Desktop\babashka\filedispatcherimpl.pdb'; linking object as if no debug info
nio.lib(IOUtil.obj) : warning LNK4099: PDB 'ioutil.pdb' was not found with 'nio.lib(IOUtil.obj)' or at 'C:\Users\user\Desktop\babashka\ioutil.pdb'; linking object as if no debug info
nio.lib(RegistryFileTypeDetector.obj) : warning LNK4099: PDB 'registryfiletypedetector.pdb' was not found with 'nio.lib(RegistryFileTypeDetector.obj)' or at 'C:\Users\user\Desktop\babashka\registryfiletypedetector.pdb'; linking object as if no debug info
nio.lib(WindowsNativeDispatcher.obj) : warning LNK4099: PDB 'windowsnativedispatcher.pdb' was not found with 'nio.lib(WindowsNativeDispatcher.obj)' or at 'C:\Users\user\Desktop\babashka\windowsnativedispatcher.pdb'; linking object as if no debug info
nio.lib(SocketChannelImpl.obj) : warning LNK4099: PDB 'socketchannelimpl.pdb' was not found with 'nio.lib(SocketChannelImpl.obj)' or at 'C:\Users\user\Desktop\babashka\socketchannelimpl.pdb'; linking object as if no debug info
Creating library C:\Users\user\Desktop\babashka\bb.lib and object C:\Users\user\Desktop\babashka\bb.exp
java.lib(WinCAPISeedGenerator.obj) : warning LNK4099: PDB 'wincapiseedgenerator.pdb' was not found with 'java.lib(WinCAPISeedGenerator.obj)' or at 'C:\Users\user\Desktop\babashka\wincapiseedgenerator.pdb'; linking object as if no debug info
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_printf referenced in function JVM_FreeMemory
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp_printf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_vfprintf referenced in function jio_vfprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_vsnprintf referenced in function jio_vsnprintf
MSVCRT.lib(vsnprintf.obj) : error LNK2001: unresolved external symbol __imp_vsnprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_fprintf referenced in function JVM_GetInheritedAccessControlContext
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp_fprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___iob_func referenced in function JVM_GetInheritedAccessControlContext
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp___iob_func
net.lib(NetworkInterface.obj) : error LNK2019: unresolved external symbol __imp__snprintf_s referenced in function enumInterfaces
net.lib(ResolverConfigurationImpl.obj) : error LNK2019: unresolved external symbol __imp_sprintf referenced in function loadConfig
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp_sprintf
net.lib(NetworkInterface_winXP.obj) : error LNK2001: unresolved external symbol __imp_sprintf
java.lib(Console_md.obj) : error LNK2001: unresolved external symbol __imp_sprintf
java.lib(ProcessImpl_md.obj) : error LNK2019: unresolved external symbol __imp__vswprintf_c_l referenced in function swprintf
MSVCRT.lib(vsnprintf.obj) : error LNK2001: unresolved external symbol __imp__vsnprintf
C:\Users\user\Desktop\babashka\bb.exe : fatal error LNK1120: 9 unresolved externals

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
    at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
    at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:462)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:315)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:454)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:115)

Caused by: java.lang.RuntimeException: host C compiler or linker does not seem to work: java.lang.RuntimeException: returned 2

Running command: CL /MD /Zi /PDBSTRIPPED /FeC:\Users\user\Desktop\babashka\bb.exe C:\Users\user\AppData\Local\Temp\SVM-3419764194800344559\bb.obj C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib /link /INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib /LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64 advapi32.lib ws2_32.lib secur32.lib iphlpapi.lib

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27034 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/PDBSTRIPPED'
Microsoft (R) Incremental Linker Version 14.16.27034.0
Copyright (C) Microsoft Corporation. All rights reserved.

/debug
/out:C:\Users\user\Desktop\babashka\bb.exe
/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib
/LIBPATH:C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib
C:\Users\user\AppData\Local\Temp\SVM-3419764194800344559\bb.obj
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\ffi.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\libchelper.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\strictmath.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\svm\clibraries\windows-amd64\jvm.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\zip.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\net.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\java.lib
C:\Users\user\Desktop\graalvm-ce-java8-19.3.0\jre\lib\nio.lib
libchelper.lib(cpuid.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'libchelper.lib(cpuid.obj)' or at 'C:\Users\user\Desktop\babashka\vc100.pdb'; linking object as if no debug info
jvm.lib(JvmFuncs.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'jvm.lib(JvmFuncs.obj)' or at 'C:\Users\user\Desktop\babashka\vc100.pdb'; linking object as if no debug info
net.lib(Inet4AddressImpl.obj) : warning LNK4099: PDB 'inet4addressimpl.pdb' was not found with 'net.lib(Inet4AddressImpl.obj)' or at 'C:\Users\user\Desktop\babashka\inet4addressimpl.pdb'; linking object as if no debug info
net.lib(Inet4Address.obj) : warning LNK4099: PDB 'inet4address.pdb' was not found with 'net.lib(Inet4Address.obj)' or at 'C:\Users\user\Desktop\babashka\inet4address.pdb'; linking object as if no debug info
net.lib(Inet6AddressImpl.obj) : warning LNK4099: PDB 'inet6addressimpl.pdb' was not found with 'net.lib(Inet6AddressImpl.obj)' or at 'C:\Users\user\Desktop\babashka\inet6addressimpl.pdb'; linking object as if no debug info
net.lib(Inet6Address.obj) : warning LNK4099: PDB 'inet6address.pdb' was not found with 'net.lib(Inet6Address.obj)' or at 'C:\Users\user\Desktop\babashka\inet6address.pdb'; linking object as if no debug info
net.lib(InetAddressImplFactory.obj) : warning LNK4099: PDB 'inetaddressimplfactory.pdb' was not found with 'net.lib(InetAddressImplFactory.obj)' or at 'C:\Users\user\Desktop\babashka\inetaddressimplfactory.pdb'; linking object as if no debug info
net.lib(InetAddress.obj) : warning LNK4099: PDB 'inetaddress.pdb' was not found with 'net.lib(InetAddress.obj)' or at 'C:\Users\user\Desktop\babashka\inetaddress.pdb'; linking object as if no debug info
net.lib(NetworkInterface.obj) : warning LNK4099: PDB 'networkinterface.pdb' was not found with 'net.lib(NetworkInterface.obj)' or at 'C:\Users\user\Desktop\babashka\networkinterface.pdb'; linking object as if no debug info
net.lib(ResolverConfigurationImpl.obj) : warning LNK4099: PDB 'resolverconfigurationimpl.pdb' was not found with 'net.lib(ResolverConfigurationImpl.obj)' or at 'C:\Users\user\Desktop\babashka\resolverconfigurationimpl.pdb'; linking object as if no debug info
net.lib(net_util_md.obj) : warning LNK4099: PDB 'net_util_md.pdb' was not found with 'net.lib(net_util_md.obj)' or at 'C:\Users\user\Desktop\babashka\net_util_md.pdb'; linking object as if no debug info
net.lib(net_util.obj) : warning LNK4099: PDB 'net_util.pdb' was not found with 'net.lib(net_util.obj)' or at 'C:\Users\user\Desktop\babashka\net_util.pdb'; linking object as if no debug info
net.lib(NetworkInterface_winXP.obj) : warning LNK4099: PDB 'networkinterface_winxp.pdb' was not found with 'net.lib(NetworkInterface_winXP.obj)' or at 'C:\Users\user\Desktop\babashka\networkinterface_winxp.pdb'; linking object as if no debug info
java.lib(jni_util.obj) : warning LNK4099: PDB 'jni_util.pdb' was not found with 'java.lib(jni_util.obj)' or at 'C:\Users\user\Desktop\babashka\jni_util.pdb'; linking object as if no debug info
java.lib(Console_md.obj) : warning LNK4099: PDB 'console_md.pdb' was not found with 'java.lib(Console_md.obj)' or at 'C:\Users\user\Desktop\babashka\console_md.pdb'; linking object as if no debug info
java.lib(FileDescriptor_md.obj) : warning LNK4099: PDB 'filedescriptor_md.pdb' was not found with 'java.lib(FileDescriptor_md.obj)' or at 'C:\Users\user\Desktop\babashka\filedescriptor_md.pdb'; linking object as if no debug info
java.lib(FileInputStream.obj) : warning LNK4099: PDB 'fileinputstream.pdb' was not found with 'java.lib(FileInputStream.obj)' or at 'C:\Users\user\Desktop\babashka\fileinputstream.pdb'; linking object as if no debug info
java.lib(FileInputStream_md.obj) : warning LNK4099: PDB 'fileinputstream_md.pdb' was not found with 'java.lib(FileInputStream_md.obj)' or at 'C:\Users\user\Desktop\babashka\fileinputstream_md.pdb'; linking object as if no debug info
java.lib(FileOutputStream_md.obj) : warning LNK4099: PDB 'fileoutputstream_md.pdb' was not found with 'java.lib(FileOutputStream_md.obj)' or at 'C:\Users\user\Desktop\babashka\fileoutputstream_md.pdb'; linking object as if no debug info
java.lib(WinNTFileSystem_md.obj) : warning LNK4099: PDB 'winntfilesystem_md.pdb' was not found with 'java.lib(WinNTFileSystem_md.obj)' or at 'C:\Users\user\Desktop\babashka\winntfilesystem_md.pdb'; linking object as if no debug info
java.lib(ProcessEnvironment_md.obj) : warning LNK4099: PDB 'processenvironment_md.pdb' was not found with 'java.lib(ProcessEnvironment_md.obj)' or at 'C:\Users\user\Desktop\babashka\processenvironment_md.pdb'; linking object as if no debug info
java.lib(ProcessImpl_md.obj) : warning LNK4099: PDB 'processimpl_md.pdb' was not found with 'java.lib(ProcessImpl_md.obj)' or at 'C:\Users\user\Desktop\babashka\processimpl_md.pdb'; linking object as if no debug info
java.lib(Shutdown.obj) : warning LNK4099: PDB 'shutdown.pdb' was not found with 'java.lib(Shutdown.obj)' or at 'C:\Users\user\Desktop\babashka\shutdown.pdb'; linking object as if no debug info
java.lib(jio.obj) : warning LNK4099: PDB 'jio.pdb' was not found with 'java.lib(jio.obj)' or at 'C:\Users\user\Desktop\babashka\jio.pdb'; linking object as if no debug info
java.lib(canonicalize_md.obj) : warning LNK4099: PDB 'canonicalize_md.pdb' was not found with 'java.lib(canonicalize_md.obj)' or at 'C:\Users\user\Desktop\babashka\canonicalize_md.pdb'; linking object as if no debug info
java.lib(jni_util_md.obj) : warning LNK4099: PDB 'jni_util_md.pdb' was not found with 'java.lib(jni_util_md.obj)' or at 'C:\Users\user\Desktop\babashka\jni_util_md.pdb'; linking object as if no debug info
java.lib(io_util_md.obj) : warning LNK4099: PDB 'io_util_md.pdb' was not found with 'java.lib(io_util_md.obj)' or at 'C:\Users\user\Desktop\babashka\io_util_md.pdb'; linking object as if no debug info
java.lib(io_util.obj) : warning LNK4099: PDB 'io_util.pdb' was not found with 'java.lib(io_util.obj)' or at 'C:\Users\user\Desktop\babashka\io_util.pdb'; linking object as if no debug info
nio.lib(FileChannelImpl.obj) : warning LNK4099: PDB 'filechannelimpl.pdb' was not found with 'nio.lib(FileChannelImpl.obj)' or at 'C:\Users\user\Desktop\babashka\filechannelimpl.pdb'; linking object as if no debug info
nio.lib(FileDispatcherImpl.obj) : warning LNK4099: PDB 'filedispatcherimpl.pdb' was not found with 'nio.lib(FileDispatcherImpl.obj)' or at 'C:\Users\user\Desktop\babashka\filedispatcherimpl.pdb'; linking object as if no debug info
nio.lib(IOUtil.obj) : warning LNK4099: PDB 'ioutil.pdb' was not found with 'nio.lib(IOUtil.obj)' or at 'C:\Users\user\Desktop\babashka\ioutil.pdb'; linking object as if no debug info
nio.lib(RegistryFileTypeDetector.obj) : warning LNK4099: PDB 'registryfiletypedetector.pdb' was not found with 'nio.lib(RegistryFileTypeDetector.obj)' or at 'C:\Users\user\Desktop\babashka\registryfiletypedetector.pdb'; linking object as if no debug info
nio.lib(WindowsNativeDispatcher.obj) : warning LNK4099: PDB 'windowsnativedispatcher.pdb' was not found with 'nio.lib(WindowsNativeDispatcher.obj)' or at 'C:\Users\user\Desktop\babashka\windowsnativedispatcher.pdb'; linking object as if no debug info
nio.lib(SocketChannelImpl.obj) : warning LNK4099: PDB 'socketchannelimpl.pdb' was not found with 'nio.lib(SocketChannelImpl.obj)' or at 'C:\Users\user\Desktop\babashka\socketchannelimpl.pdb'; linking object as if no debug info
Creating library C:\Users\user\Desktop\babashka\bb.lib and object C:\Users\user\Desktop\babashka\bb.exp
java.lib(WinCAPISeedGenerator.obj) : warning LNK4099: PDB 'wincapiseedgenerator.pdb' was not found with 'java.lib(WinCAPISeedGenerator.obj)' or at 'C:\Users\user\Desktop\babashka\wincapiseedgenerator.pdb'; linking object as if no debug info
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_printf referenced in function JVM_FreeMemory
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp_printf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_vfprintf referenced in function jio_vfprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_vsnprintf referenced in function jio_vsnprintf
MSVCRT.lib(vsnprintf.obj) : error LNK2001: unresolved external symbol __imp_vsnprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp_fprintf referenced in function JVM_GetInheritedAccessControlContext
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp_fprintf
jvm.lib(JvmFuncs.obj) : error LNK2019: unresolved external symbol __imp___iob_func referenced in function JVM_GetInheritedAccessControlContext
java.lib(jni_util.obj) : error LNK2001: unresolved external symbol __imp___iob_func
net.lib(NetworkInterface.obj) : error LNK2019: unresolved external symbol __imp__snprintf_s referenced in function enumInterfaces
net.lib(ResolverConfigurationImpl.obj) : error LNK2019: unresolved external symbol __imp_sprintf referenced in function loadConfig
net.lib(net_util_md.obj) : error LNK2001: unresolved external symbol __imp_sprintf
net.lib(NetworkInterface_winXP.obj) : error LNK2001: unresolved external symbol __imp_sprintf
java.lib(Console_md.obj) : error LNK2001: unresolved external symbol __imp_sprintf
java.lib(ProcessImpl_md.obj) : error LNK2019: unresolved external symbol __imp__vswprintf_c_l referenced in function swprintf
MSVCRT.lib(vsnprintf.obj) : error LNK2001: unresolved external symbol __imp__vsnprintf
C:\Users\user\Desktop\babashka\bb.exe : fatal error LNK1120: 9 unresolved externals

    at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:382)
    at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:652)
    at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
    at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1482)
at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1260)
at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1222)
at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1181)

@sogaiu
Copy link
Contributor

sogaiu commented Dec 6, 2019

So ATM, it looks like for building:

  • Java 8 based babashka => Windows 7.1 SDK and friends
  • Java 11 based babashka => VS 2017 and friends

@borkdude
Copy link
Collaborator

@filipesilva @sogaiu

First experimental Windows build of babashka (bb.exe):

https://ci.appveyor.com/api/buildjobs/u69snl7lmta541mu/artifacts/babashka-0.0.63-SNAPSHOT-windows-amd64.zip

See appveyor.yml and script\compile.bat. It is compiled with JDK8 like the linux build. The only thing I needed to work around was oracle/graal#1784. I didn't test it extensively yet.

@filipesilva
Copy link
Author

Downloaded zip and unpacked to folder in PATH, then tried to run all samples in https://github.com/borkdude/babashka#examples.

In gitbash, all of them worked as expected except for the last one (bb -O '(repeat "dude")' | bb --stream '(str *input* "rino")' | bb -I '(take 3 *input*)'), which printed correctly but then did not exit, it just hung there.

In cmd, some stuff worked but quotes and <<< seemed to be a recurring problem.

D:\sandbox\random>dir | bb -i '*input*'
Exception in thread "main" java.io.IOException: Invalid argument
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_io_IOException_2_0002e_0003cinit_0003e_00028Ljava_lang_String_2_00029V(JNIJavaCallWrappers.java:0)
        at java.io.WinNTFileSystem.canonicalize0(WinNTFileSystem.java)
        at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428)
        at java.io.File.getCanonicalPath(File.java:618)
        at babashka.main$main.invokeStatic(main.clj:307)
        at babashka.main$main.doInvoke(main.clj:271)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.core$apply.invokeStatic(core.clj:665)
        at babashka.main$_main.invokeStatic(main.clj:421)
        at babashka.main$_main.doInvoke(main.clj:421)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at babashka.main.main(Unknown Source)

D:\sandbox\random>dir | bb -i "*input*"
(" Volume in drive D is RED-16" " Volume Serial Number is 72F8-6077" "" " Directory of D:\\sandbox\\random" "" "14/12/2019  11:11    <DIR>          ." "14/12/2019  11:11    <DIR>          .." "09/08/2019  16:01                12 .gitignore" "12/11/2019  15:32               275 input.js" "12/11/2019  15:25               180 input.ts" "14/12/2019  11:11    <DIR>          node_modules" "12/11/2019  15:32                96 output.js" "14/12/2019  11:11               228 package.json" "14/12/2019  11:11           139,759 yarn.lock" "               6 File(s)        140,550 bytes" "               3 Dir(s)  70,857,986,048 bytes free")

D:\sandbox\random>dir | bb -i "(count *input*)"
16

D:\sandbox\random>bb "(#(+ %1 %2 %3) 1 2 *input*)" <<< 3
<< was unexpected at this time.

D:\sandbox\random>dir | bb -i "(filterv #(re-find #"README" %) *input*)"
clojure.lang.ExceptionInfo: [line 1, col 29] No reader function for tag README.

D:\sandbox\random>dir | bb -i "(filterv #(re-find #'README' %) *input*)"
clojure.lang.ExceptionInfo: Could not resolve symbol: README' [at line 1, column 22]

D:\sandbox\random>bb -O "(repeat "dude")" | bb --stream "(str *input* "rino")" | bb -I "(take 3 *input*)"
clojure.lang.ExceptionInfo: Could not resolve symbol: dude [at line 1, column 9]
()

D:\sandbox\random>bb -O "(repeat 'dude')" | bb --stream "(str *input* "rino")" | bb -I "(take 3 *input*)"
clojure.lang.ExceptionInfo: Could not resolve symbol: rino [at line 1, column 14]
()
^C
D:\sandbox\random>

In powershell, I saw some problems with quotes and <<< too.

PS D:\sandbox\random> ls | bb -i '*input*'
("" "" "    Directory: D:\\sandbox\\random" "" "" "Mode                 LastWriteTime         Length Name                                                                 " "----                 -------------         ------ ----                                                                 " "d-----        14/12/2019     11:11                node_modules                                                         " "-a----        09/08/2019     17:01             12 .gitignore                                                           " "-a----        12/11/2019     15:32            275 input.js                                                             " "-a----        12/11/2019     15:25            180 input.ts                                                             " "-a----        12/11/2019     15:32             96 output.js                                                            " "-a----        14/12/2019     11:11            228 package.json                                                         " "-a----        14/12/2019     11:11         139759 yarn.lock                                                            " "" "")
PS D:\sandbox\random> ls | bb -i '(count *input*)'
16
PS D:\sandbox\random> bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]'
At line:1 char:30
+ bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]'
+                              ~
Missing file specification after redirection operator.
At line:1 char:29
+ bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]'
+                             ~
The '<' operator is reserved for future use.
At line:1 char:31
+ bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]'
+                               ~
Missing file specification after redirection operator.
At line:1 char:30
+ bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]'
+                              ~
The '<' operator is reserved for future use.
At line:1 char:31
+ bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]'
+                               ~
The '<' operator is reserved for future use.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingFileSpecification

PS D:\sandbox\random> bb '(filterv :foo *input*)' <<< '[{:foo 1} {:bar 2}]'
At line:1 char:30
+ bb '(filterv :foo *input*)' <<< '[{:foo 1} {:bar 2}]'
+                              ~
Missing file specification after redirection operator.
At line:1 char:29
+ bb '(filterv :foo *input*)' <<< '[{:foo 1} {:bar 2}]'
+                             ~
The '<' operator is reserved for future use.
At line:1 char:31
+ bb '(filterv :foo *input*)' <<< '[{:foo 1} {:bar 2}]'
+                               ~
Missing file specification after redirection operator.
At line:1 char:30
+ bb '(filterv :foo *input*)' <<< '[{:foo 1} {:bar 2}]'
+                              ~
The '<' operator is reserved for future use.
At line:1 char:31
+ bb '(filterv :foo *input*)' <<< '[{:foo 1} {:bar 2}]'
+                               ~
The '<' operator is reserved for future use.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingFileSpecification

PS D:\sandbox\random> bb '(#(+ %1 %2 %3) 1 2 *input*)' <<< 3
At line:1 char:35
+ bb '(#(+ %1 %2 %3) 1 2 *input*)' <<< 3
+                                   ~
Missing file specification after redirection operator.
At line:1 char:34
+ bb '(#(+ %1 %2 %3) 1 2 *input*)' <<< 3
+                                  ~
The '<' operator is reserved for future use.
At line:1 char:36
+ bb '(#(+ %1 %2 %3) 1 2 *input*)' <<< 3
+                                    ~
Missing file specification after redirection operator.
At line:1 char:35
+ bb '(#(+ %1 %2 %3) 1 2 *input*)' <<< 3
+                                   ~
The '<' operator is reserved for future use.
At line:1 char:36
+ bb '(#(+ %1 %2 %3) 1 2 *input*)' <<< 3
+                                    ~
The '<' operator is reserved for future use.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingFileSpecification

PS D:\sandbox\random> ls | bb -i '(filterv #(re-find #"README" %) *input*)'
clojure.lang.ExceptionInfo: [line 1, col 29] No reader function for tag README.
PS D:\sandbox\random> bb '(run! #(shell/sh "touch" (str "/tmp/test/" %)) (range 100))'
clojure.lang.ExceptionInfo: [line 1, col 39] Invalid symbol: /tmp/test/.
PS D:\sandbox\random> bb -O '(repeat "dude")' | bb --stream '(str *input* "rino")' | bb -I '(take 3 *input*)'
clojure.lang.ExceptionInfo: Could not resolve symbol: dude [at line 1, column 9]
()

In powershell, on a larger folder, I saw a crash as well:

PS C:\Users\kamik> ls | bb -i '*input*'
("" "" "    Directory: C:\\Users\\kamik" "" "" "Mode                 LastWriteTime         Length Name                                                                 " "----                 -------------         ------ ----                                                                 " "d-----        20/09/2019     11:51                .android                                                             " "d-----        24/11/2018     13:40                .bundle                                                              " "d-----        03/12/2019     11:07                .cache                                                               " "d-----        01/06/2019     23:02                .cljs                                                                " "d-----        04/06/2019     00:00                .clojure                                                             " "d-----        09/05/2019     12:01                .Codefresh                                                           " "d-----        20/02/2018     17:44                .config                                                              " "d-----        15/01/2019     15:07                .docker                                                              " "d-----        24/11/2018     13:39                .gem                                                                 " "d-----        24/11/2018     13:35                .gnupg                                                               " "d-----        08/11/2018     13:26                .gsutil                                                              " "d-----        11/04/2019     19:58                .hyper_plugins                                                       " "d-----        15/01/2019     17:03                .kube                                                                " "d-----        01/06/2019     22:15                .lein                                                                " "d-----        14/12/2019     11:29                .m2                                                                  " "d-----        03/10/2018     12:18                .ndb                                                                 " "d-----        25/06/2019     14:17                .node-gyp                                                            " "d-----        29/03/2018     17:12                .oracle_jre_usage                                                    " "d-----        09/02/2019     17:39                .Origin                                                              " "d-----        14/01/2019     23:44                .prefs                                                               " "d-----        09/02/2019     17:39                .QtWebEngineProcess                                                  " "d-----        15/12/2019     15:34                .shadow-cljs                                                         " "d-----        05/04/2018     16:40                .ssh                                                                 " "d-----        08/11/2019     21:07                .vscode                                                              " "d-----        26/06/2019     12:35                .windows-build-tools                                                 " "d-r---        11/12/2019     20:10                3D Objects                                                           " "d-----        20/02/2018     22:30                ansel                                                                " "d-r---        11/12/2019     20:10                Contacts                                                             " "d-r---        14/12/2019     20:46                Desktop                                                              " "d-r---        09/01/2020     23:46                Documents                                                            " "d-r---        13/01/2020     12:51                Downloads                                                            " "d-r---        11/12/2019     20:10                Favorites                                                            " "d-----        26/06/2019     12:54                go                                                                   " "d-r---        10/01/2020     04:06                Google Drive                                                         " "d-r---        11/12/2019     20:10                Links                                                                " "d-r---        11/12/2019     20:10                Music                                                                " "d-r---        08/12/2019     11:00                OneDrive                                                             " "d-r---        11/12/2019     20:10                Pictures                                                             " "d-----        13/02/2018     02:33                Roaming                                                              " "d-r---        11/12/2019     20:10                Saved Games                                                          " "d-r---        11/12/2019     20:10                Searches                                                             " "d-----        29/03/2018     17:37                Valley                                                               " "d-r---        11/12/2019     20:10                Videos                                                               " "d-----        02/10/2019     16:15                _bazel_kamik                                                         " "-a----        01/11/2019     17:07            113 .angular-config.json                                                 " "-a----        21/11/2019     17:41         390100 .babel.json                                                          " "-a----        08/03/2019     13:14            336 .bashrc                                                              " "-a----        13/12/2019     15:02           3293 .bash_history                                                        " "-a----        14/09/2018     14:15             99 .bash_profile                                                        " "-a----        08/11/2018     13:26          18534 .boto                                                                " "-a----        09/05/2019     12:04            218 .cfconfig                                                            " "-a----        25/10/2019     19:30            888 .gitconfig                                                           " "-a----        23/02/2019     13:36             30 .gitignore_global                                                    " "-a----        11/04/2019     20:11           5291 .hyper.js                                                            " "-a----        02/06/2019     01:03           2750 .lumo_history                                                        " "-a----        28/10/2019     21:40         130894 .node_repl_history                                                   " "-a----        12/03/2019     15:48             71 .npmrc                                                               " "-a----        06/12/2019     21:11           1811 .taiko_repl_history                                                  " "-a----        16/10/2018     15:17           4384 .v8flags.6.8.275.30-node.24.21ec8effaa2c45cd113515515504a2ad.json    " "-a----        09/08/2019     16:12           4397 .v8flags.6.8.275.32-node.52.21ec8effaa2c45cd113515515504a2ad.json    " "-a----        13/01/2020     10:54            144 .yarnrc                                                              " "-a----        27/01/2019     17:07            985 conemu-msys2-64.exe.stackdump                                        " "-a----        24/10/2019     12:27         485982 log.txt                                                              " "" "")
PS C:\Users\kamik> ls | bb -i '(count *input*)'
72

@borkdude
Copy link
Collaborator

@filipesilva In most (all?) of the above failing examples it's just due to difference in cmd.exe and bash syntax. E.g. <<< is bash syntax for reading a string literal. And single quotes don't work in cmd.exe whereas they do in bash.

@sogaiu
Copy link
Contributor

sogaiu commented Jan 13, 2020

Perhaps everyone is already familiar with the following, but for reference, I found the following helpful in providing hints for quoting differences among multiple "command prompts" / "shells":

https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows#escaping-quotes

@filipesilva
Copy link
Author

Can you give me example usage of the deps.clj script? It seems to run, but I don't know what to do with it. It downloads something and starts a clojure repl.

All scripts worked in gitbash, powershell, and cmd.

In gitbash ctrl+c didn't exit processes though, so for the deps.cljs and http_server.clj scripts I had to close the console to terminate them.

@borkdude
Copy link
Collaborator

borkdude commented Jan 13, 2020

@filipesilva

The ctrl-c behavior has to do with signal handling: oracle/graal#1784. Maybe we'll have to wait for that to be fixed before releasing an official version?

All scripts worked in gitbash, powershell, and cmd.

Thanks, that's promising!

As for deps.clj: it's basically the clojure tool rewritten in Clojure. See https://github.com/borkdude/deps.clj/.

bb deps.clj -h

should show you what you can do with it.

@filipesilva
Copy link
Author

@sogaiu I didn't know about that link but wow... everything has a different combination of quotes, double quotes, and escaped quotes....

@borkdude well the ctrl+c problem only happens on gitbash, and when you're using gitbash you already buy into a certain amount of weirdness. Plus it's only relevant for non-exiting commands. IMHO that isn't strong enough of a reason to avoid the release.

@borkdude
Copy link
Collaborator

The Windows binary has been released for some time now. I'll close this issue and I'll make a new issue for porting the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants