wasmerio / py2wasm

Nuitka is a Python compiler written in Python. It's fully compatible with Python 2.6, 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, and 3.11. You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.
http://nuitka.net
Apache License 2.0
103 stars 4 forks source link

error: RuntimeError: indirect call type mismatch #7

Open agardnerIT opened 3 months ago

agardnerIT commented 3 months ago

Describe the bug

The most basic Python + requests program errors.

import requests

def send_request():
    resp = requests.get(
        url="https:/example.com"
    )
    print(resp.status_code)

if __name__ == "__main__":
    send_request()
% wasmer run app.wasm
error: RuntimeError: indirect call type mismatch
╰─▶ 1: RuntimeError: indirect call type mismatch

requirements.txt

py2wasm==2.6.3
requests==2.32.3
wasmer==1.1.0

wasmer version

% wasmer --version 
wasmer 4.3.5
maminrayej commented 3 months ago

py2wasm currently uses WASI which does not have sockets enabled and that causes requests fail. We should move py2wasm to use WASIX instead and that should solve the issue.