I try to build the jep package, which is a a bridge library between java and python. The goal is in the end to try to make a polynote (notebook framework written in scala) service for NixOS. It has jep as a dependency:
java.lang.UnsatisfiedLinkError: /nix/store/s78py3n2pzhiyi8qy9hwjngkv89n88qj-python3.9-jep-3.9.1/lib/python3.9/site-packages/jep/libjep.so: /nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib/libc.so.6: version `GLIBC_2.32' not found (required by /nix/store/0ipynhzs670xbc9hixy05wgfd2xad2v2-python3-3.9.0/lib/libpython3.9.so.1.0)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2452)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2508)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2704)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2669)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:807)
at java.base/java.lang.System.loadLibrary(System.java:1907)
at jep.MainInterpreter.initialize(MainInterpreter.java:128)
at jep.MainInterpreter.getMainInterpreter(MainInterpreter.java:101)
at jep.Jep.<init>(Jep.java:256)
at jep.SharedInterpreter.<init>(SharedInterpreter.java:56)
at jep.Run.run(Run.java:49)
at jep.Run.main(Run.java:146)
I have tried with python 3.6 and python 3.7 using both openjdk 8 and openjdk 11, but none of these have matching glibc versions. This is a bit surprising to me. Is there a way to override the glibc version?
I also wonder how I actually set that only python3 should be used. I didn’t find any other way than using python3.pkgs.buildPythonPackage, that doesn’t feel correct.
EDIT:
namely, you should not have python3 as an import, you should be importing the python packages individually. using the python3 package will fix the python interpreter to python3.8, which is likely why you’re hitting these issues.
I think I might mixed up pasting output from trying with python 3.9, whereas the sources are showing python 3.8. I think both python 3.8, and 3.9 required glibc 1.32, while openjdk uses 1.31 it seems.
I will read through the docs again and try more tomorrow
Where does the java you’re executing the jar with come from? If it’s from your system and you’re e.g. on 20.09 you’ll have an openjdk here with glibc-2.31 (or in other words: you don’t have the one from your buildInputs).
To confirm my hypothesis can you please open a nix-shell with an openjdk from your branch (nix-shell -I nixpkgs=$(pwd) -p openjdk) and run the java -D... command from that shell?
Yes @Ma27, you where right. I did use openjdk from my channel, and not from the branch I was in. Thank you for the tip of using nixpkgs=$(pwd) that solved the issue! Hehe, I should have thought about that, my nix skills are probably a bit rusty!
I encountered another issue now with java, but I think that is solvable.