Skip to content

Issues running a Python based gRPC client inside wasmerΒ #6232

@silvestre-perret-bentley

Description

Hello all,

I'm struggling while trying to run a python gRPC client inside wasmer and have it call a local gRPC server.

Environment

  • Windows 11
  • Wasmer CLI 7.0.1
  • Python package: python/python from wasmer registry
  • grpcio wheel: grpcio-1.74.1-cp313-cp313-wasix_wasm32.whl from https://pythonindex.wasix.org/

Steps to Reproduce

In a blank folder, using git bash

  1. curl -L -o grpcio-1.74.1-cp313-cp313-wasix_wasm32.whl "https://pythonindex.wasix.org/packages/grpcio-1.74.1-cp313-cp313-wasix_wasm32.whl#sha256=2dbd4da51eb724898e23ec16468022b802f81f5b0fde7775497526085fd00b53"
  2. unzip grpcio-1.74.1-cp313-cp313-wasix_wasm32.whl
  3. Run a script that imports grpc: wasmer run python/python --volume .:. -- -c "import grpc"

Expected Behavior

grpc module imports successfully.

Actual Behavior

ImportError: failed to load module: Import could not be satisfied because of type mismatch: 'GOT.mem'.X509_NAME_it, expected Global(GlobalType { ty: I32, mutability: Var }), found Function(FunctionType { params: [], results: [I32] })

Additional details

I have also tried with wasmer/python instead of python/python as it's explicitly advertised as "bundled with openssl build" without success (the error is different though: ImportError: cannot import name 'cygrpc' from 'grpc._cython' which is probably caused by the discrepancy in python version 3.12 vs 3.13 expected by the grpcio wheel).

The same method worked for other packages on https://pythonindex.wasix.org/ like numpy.

The python/python/python-with-packages package doesn't include grpcio. I have checked :-(

Any help or advice would be greatly appreciated. Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions