clj-python / libpython-clj

Python bindings for Clojure
Eclipse Public License 2.0
1.06k stars 69 forks source link

JDK 16 does not like the sys module #162

Closed wbridewell closed 3 years ago

wbridewell commented 3 years ago

Python's sys module gives the same error as numpy on 2.0.0-beta-15 and JDK 16.

user=> (require '(libpython-clj2 [require :refer [require-python]]))
...
user=> (require-python 'sys)
Execution error (IllegalArgumentException) at jdk.internal.foreign.MemoryAddressImpl/asSegmentRestricted (MemoryAddressImpl.java:99).
Invalid size : 0
user=> (require-python 'numpy))
Execution error (IllegalArgumentException) at jdk.internal.foreign.MemoryAddressImpl/asSegmentRestricted (MemoryAddressImpl.java:99).
Invalid size : 0
cnuernber commented 3 years ago

That is fixable :-). Thanks for the issue.

cnuernber commented 3 years ago

Fixed - I tested against JDK-16 and the unit tests now pass. I forgot the JNA pathway is the default now which makes this work once I fixed the above issue.

cnuernber commented 3 years ago

Example jvm-opts I had to use is in deps.edn.