Skip to content

Missing _signal module on WASI #5050

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

Closed
d3lm opened this issue Aug 28, 2023 · 10 comments · Fixed by #5282
Closed

Missing _signal module on WASI #5050

d3lm opened this issue Aug 28, 2023 · 10 comments · Fixed by #5282
Labels
C-bug Something isn't working

Comments

@d3lm
Copy link
Contributor

d3lm commented Aug 28, 2023

Summary

If you try to import platform you get the following error:

>>>>> import platform
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "platform", line 119, in <module>
  File "subprocess", line 49, in <module>
  File "signal", line 1, in <module>
ModuleNotFoundError: No module named '_signal'

It seems that the _signal module is missing. Any idea what this could be or how we could resolve this?

@d3lm d3lm added the C-bug Something isn't working label Aug 28, 2023
@fanninpm
Copy link
Contributor

What is your platform? I cannot reproduce on macOS (Ventura, M1) or Linux (Arch Linux, x86_64).

Welcome to the magnificent Rust Python 0.2.0 interpreter 😱 🖖
>>>>> import platform
>>>>> exit()

@d3lm
Copy link
Contributor Author

d3lm commented Aug 29, 2023

Oh sorry, I should have said it's when you compile to WASI. I have updated the title.

@d3lm d3lm changed the title Missing _signal module Missing _signal module on WASI Aug 29, 2023
@d3lm
Copy link
Contributor Author

d3lm commented Aug 31, 2023

CC @youknowone

@youknowone
Copy link
Member

#4964 is similar issue.
I believe _signal is not mendatory for platform. Implementing _signal will be the long term correct goal, but patching python library will also make it working.

@d3lm
Copy link
Contributor Author

d3lm commented Aug 31, 2023

What do you mean by patching? Is that something we can do?

@youknowone
Copy link
Member

Oh, I was not talking about about user-side, but about updating Lib/platform.py from RustPython project to not to refer _signal.
Another point. I think WASI anyway will not support _signal, right? Then maybe a fake _signal module with empty functions like gc will be enough.

I also found platform is updated in python 3.11 not to require _signal when importing. #5060
But still there are encodings problem, so it doesn't work.

@youknowone
Copy link
Member

oh, it was my mistake. platform will be fixed by #5060

@d3lm
Copy link
Contributor Author

d3lm commented Aug 31, 2023

It depends what that signal module does but WASI has a syscall to send signals to the host process, it's proc_raise.

@d3lm
Copy link
Contributor Author

d3lm commented Aug 31, 2023

But I think as long as it's mostly empty that's fine or at least if we add what we can support.

@d3lm
Copy link
Contributor Author

d3lm commented Sep 1, 2023

Can confirm that importing platform now works 👍 Where would we go to implement things like platform.release()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants