pyodide: pyodide-build fails with KeyError: 'SIDE_MODULE_CFLAGS'

Installing pyodide-build from the docker image with python setup.py install --user and running ~/.local/bin/pyodide-build results in the following stack trace:

Traceback (most recent call last):
  File "/src/.docker_home/.local/bin/pyodide-build", line 33, in <module>
    sys.exit(load_entry_point('pyodide-build==0.18.0.dev0', 'console_scripts', 'pyodide-build')())
  File "/src/.docker_home/.local/lib/python3.9/site-packages/pyodide_build-0.18.0.dev0-py3.9.egg/pyodide_build/__main__.py", line 39, in main
    main_parser = make_parser()
  File "/src/.docker_home/.local/lib/python3.9/site-packages/pyodide_build-0.18.0.dev0-py3.9.egg/pyodide_build/__main__.py", line 33, in make_parser
    parser = module.make_parser(subparsers.add_parser(command_name))  # type: ignore
  File "/src/.docker_home/.local/lib/python3.9/site-packages/pyodide_build-0.18.0.dev0-py3.9.egg/pyodide_build/buildpkg.py", line 313, in make_parser
    default=common.get_make_flag("SIDE_MODULE_CFLAGS"),
  File "/src/.docker_home/.local/lib/python3.9/site-packages/pyodide_build-0.18.0.dev0-py3.9.egg/pyodide_build/common.py", line 44, in get_make_flag
    return get_make_environment_vars()[name]
KeyError: 'SIDE_MODULE_CFLAGS'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 21 (18 by maintainers)

Most upvoted comments

To run pyodide-build mkpkg what I have been doing is commenting out lines 20 – 23 in https://github.com/pyodide/pyodide/blob/main/pyodide-build/pyodide_build/__main__.py

Yes, this was fixed by #2351

In addition,

Is there a way to build a package without uploading it to pypi ?

If it’s a pure python package, just create a wheel put it somewhere online and install it with micropip – there is not need to create a Pyodide package.

I tried using the makefile hack to build a package and got the stack trace at https://pastebin.com/1QYtzhvY. Using PYODIDE_PACKAGES="my_package" make -C packages worked.

So running mkpkg to generate the meta.yaml file requires running the tool after commenting those lines from __main__.py and building the .data and .js files requires running the make command you described.

Not the easiest workflow in the world but at least I found a way to do it.