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

Something error with the standard library of package python/[email protected] #5251

Open
miraclejzd opened this issue Nov 15, 2024 · 3 comments
Assignees

Comments

@miraclejzd
Copy link

miraclejzd commented Nov 15, 2024

Describe the bug

I am trying to run a python application which uses module couchdb with the module errno as the dependency. When I try to run the package locally, it turns out the error AttributeError: module 'errno' has no attribute 'EHOSTDOWN'. Did you mean: 'ENETDOWN'?

Is there something wrong with the standard library of package python/[email protected]

$ wasmer -vV; rustc -vV

wasmer 5.0.0 (49b1fcc 2024-10-29)
binary: wasmer-cli
commit-hash: 49b1fcc98e739b4cf5b9d6200397a472d9233de9
commit-date: 2024-10-29
host: x86_64-unknown-linux-gnu
compiler: singlepass,cranelift,llvm
c_api backend: 
rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: x86_64-unknown-linux-gnu
release: 1.76.0
LLVM version: 17.0.6

Steps to reproduce

  1. run the command wasmer run python/[email protected] to enter the interactive shell.
  2. run the command import errno to import the module
  3. run the command print(errno.EHOSTDOWN) to get the error message

Expected behavior

No error.

Actual behavior

The output will be as follow:

$ wasmer run python/[email protected]
Type "help", "copyright", "credits" or "license" for more information.
>>> import errno
>>> print(errno.EHOSTDOWN)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'errno' has no attribute 'EHOSTDOWN'. Did you mean: 'ENETDOWN'?
>>> 

Additional context

None.

@miraclejzd miraclejzd changed the title something error with the standard library of package python/[email protected] Something error with the standard library of package python/[email protected] Nov 15, 2024
@maminrayej
Copy link
Contributor

maminrayej commented Nov 15, 2024

I guess CPython source code detects whether EHOSTDOWN is defined on the target system or not. Since we do not define it in the wasix-libc, it won't be included in the final compiled errno module.

@miraclejzd
Copy link
Author

That's really a bad news. So it means all the applications that use errno.EHOSTDOWN will not work?

@maminrayej
Copy link
Contributor

maminrayej commented Nov 15, 2024

Unfortunately no. The solution is simple though. We could include the definition in the libc, if it makes sense, and recompile python and re-publish the package. I'll discuss this with the team.

Thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants