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

operating with tmp files fails in subprocess #4262

Closed
syrusakbary opened this issue Oct 18, 2023 · 0 comments · Fixed by #4735 · May be fixed by #4298
Closed

operating with tmp files fails in subprocess #4262

syrusakbary opened this issue Oct 18, 2023 · 0 comments · Fixed by #4735 · May be fixed by #4298
Labels
📦 lib-vfs About wasmer-vfs priority-high High priority issue
Milestone

Comments

@syrusakbary
Copy link
Member

syrusakbary commented Oct 18, 2023

When you run a program, and that program creates a subprocess that tries to operate with a temporal directory, it fails.

Steps to reproduce

$ wasmer run python/python

Then:

import subprocess; subprocess.run(["/bin/python"])

Then:

import tempfile; tempfile.mkdtemp(prefix=f"pip-a-")

Should succeed. Now it fails:

➜  wasmer run python
Could not find platform dependent libraries <exec_prefix>
Python 3.12.0 (heads/wasix-compatibility-dirty:186ebc7b8b, Oct  3 2023, 10:47:09) [Clang 15.0.6 ] on wasix
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.mkdtemp(prefix=f"pip-a-")
'/tmp/pip-a-kzbg1opp'
>>> import subprocess; result = subprocess.run(["/bin/python"])
Could not find platform dependent libraries <exec_prefix>
Python 3.12.0 (heads/wasix-compatibility-dirty:186ebc7b8b, Oct  3 2023, 10:47:09) [Clang 15.0.6 ] on wasix
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.mkdtemp(prefix=f"pip-a-")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/cpython/lib/python3.12/tempfile.py", line 368, in mkdtemp
    _os.mkdir(file, 0o700)
PermissionError: [Errno 2] Permission denied: '/tmp/pip-a-xycr51b9'
>>>

As we see, the initial tempfile.mkdtemp(prefix=f"pip-a-") works in the first python process, but not in the child python one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 lib-vfs About wasmer-vfs priority-high High priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants