temperlang / temper

3 stars 0 forks source link

`repl -b` fails on Windows #75

Closed tjpalmer closed 8 months ago

tjpalmer commented 8 months ago

Example:

projects\tutorial> temper repl -b py
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'c':
The specified module could not be found.

The specified module could not be found.

The specified module could not be found.

Native library (win32-x86-64/c.dll) not found in resource path (...very many jars...)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:307)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467)
        at com.sun.jna.Library$Handler.<init>(Library.java:192)
        at com.sun.jna.Native.loadLibrary(Native.java:672)
        at com.sun.jna.Native.loadLibrary(Native.java:656)
        at com.sun.akuma.CLibrary.<clinit>(CLibrary.java:89)
        at lang.temper.be.cli.LocalCliEnv$LocalCliTool.runAsLast(LocalCliEnv.kt:305)
        at lang.temper.be.py.RunPythonKt.runPythonInteractiveShellAndExit(RunPython.kt:365)
...
        Suppressed: java.lang.UnsatisfiedLinkError: The specified module could not be found.

                at com.sun.jna.Native.open(Native Method)
                at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:197)
                ... 27 more
...
        Suppressed: java.io.IOException: Native library (win32-x86-64/c.dll) not found in resource path (...very many jars...)
                at com.sun.jna.Native.extractFromResourcePath(Native.java:1145)
                at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:281)
                ... 27 more

A discussion on JNA in Cassandra from 2013 has this reply:

You might file an issue with them to not try loading the c library when run under windows, or at the very least try to load "msvcrt" instead (or use the Native.C_LIBRARY_NAME constant provided by JNA).

I haven't searched beyond that.

mikesamuel commented 8 months ago

I thought I had found something that was Windows compatible but https://akuma.kohsuke.org/ says

Compatibility

Because of the difficulty in Java and POSIX API to obtain the OS-level arguments of the process, not all POSIX-compliant operating systems are supported.

The supported platforms are:

  • Linux (x86,amd64)
  • Solaris (x86,amd64,sparc,sparcv9)
  • Mac OS X
tjpalmer commented 8 months ago

I thought I had found something that was Windows compatible but https://akuma.kohsuke.org/ says

Yeah, no worries. And maybe we could get this option from Microsoft to work sometime, but I didn't try working out the hoops yet, and it seems like having a pure Java fallback isn't terrible.