Describe the bug
Failed to import python library which depends on C-native extensions after CWD is removed for java posix backend
Operating system
Linux
CPU architecture
x86_64
GraalPy version
graalpy3.12-25.1.3-linux-amd64
JDK version
No response
Context configuration
No response
Steps to reproduce
way to reproduce:
- create a temp dir and set cwd to it, then remove the dir
import os
import time
def userFunction(params):
path = "/tmp/my_work_dir"
os.makedirs(path, exist_ok=True)
os.chdir(path)
os.rmdir(path)
time.sleep(5)
return {"data": "test"}
- then try to import a python library which depends on C-native extension
def userFunction(params):
from openpyxl import load_workbook
return {"data": "openpyxl import succeeded"}
- then you can get the following error
SystemError: SystemError: Failed to start patchelfto set SONAME: Cannot run program "/mindsynth/codes/graalpy/venv/bin/patchelf" (in directory "/tmp/my_work_dir"): Exec failed, error: 2 (No such file or directory) . IsolateNativeModules option needspatchelftool to copy libraries. Make sure you have it available on PATH or installed in your venv.
if I set the posix backend to "native", I cannot reproduce the above problem, I think it's better the java posix backend supports the same scenario and do not report an error.
builder.option("python.PosixModuleBackend", "native");
Expected behavior
I think it's better the java posix backend supports the same scenario and do not report an error.
Stack trace
Additional context
No response
Describe the bug
Failed to import python library which depends on C-native extensions after CWD is removed for java posix backend
Operating system
Linux
CPU architecture
x86_64
GraalPy version
graalpy3.12-25.1.3-linux-amd64
JDK version
No response
Context configuration
No response
Steps to reproduce
way to reproduce:
import os
import time
SystemError: SystemError: Failed to startpatchelfto set SONAME: Cannot run program "/mindsynth/codes/graalpy/venv/bin/patchelf" (in directory "/tmp/my_work_dir"): Exec failed, error: 2 (No such file or directory) . IsolateNativeModules option needspatchelftool to copy libraries. Make sure you have it available on PATH or installed in your venv.if I set the posix backend to "native", I cannot reproduce the above problem, I think it's better the java posix backend supports the same scenario and do not report an error.
builder.option("python.PosixModuleBackend", "native");Expected behavior
I think it's better the java posix backend supports the same scenario and do not report an error.
Stack trace
Additional context
No response