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
Add Emscripten support #1456
base: main
Are you sure you want to change the base?
Add Emscripten support #1456
Conversation
for more information, see https://pre-commit.ci
@henryiii could you approve the github actions workflows? |
for more information, see https://pre-commit.ci
@henryiii is the windows_x86 failure a flake?
|
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
I'm curious to see if this fails CI. I know there's a bug which I've just fixed locally but would like to see if anything in CI catches it. |
Thanks @henryiii ! |
Okay, "no space left on device" wasn't the failure I was expecting... |
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@hoodmane, do you know why tests are failing to set up a venv? FWIW, I'm testing it locally with awkward-array like this: docker run -v $PWD:/cibuildwheel -v $PWD/../../scikit-hep/awkward:/awkward -w /awkward/awkward-cpp --rm -it python:3.11 bash
pip install /cibuildwheel
cibuildwheel --platform pyodide And I'm getting:
(This works outside of cibuildwheel on awkward-array, by the way, now that 0.23.3 is out) |
Seems to be the same issue as in pyodide/pyodide#3427 (comment) |
Ahh, yes, that's there in: Not sure how I'm supposed to pass that with cibuildwheel, though. |
@hoodmane would adding an environment variable version of |
I think we could do that. |
Hmm, so the CI now fails building the |
The error was "No space left", this should now be fixed in main. |
pyodide updated its version to 0.24 on 13-September-2023... |
I merged with main to update this to the new build-frontend option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work! Thank you for starting this!
Part from the emscripten-forge team, I could really see us providing the ability for our users to use pip-installed packages into emscripten environments.
For this reason, I have a small suggestion about the name of the platform, something more generic like emscripten-32
could suit our use-case as well!
cc. @DerThorsten
@@ -45,7 +46,7 @@ def main() -> None: | |||
|
|||
parser.add_argument( | |||
"--platform", | |||
choices=["auto", "linux", "macos", "windows"], | |||
choices=["auto", "linux", "macos", "windows", "pyodide"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
choices=["auto", "linux", "macos", "windows", "pyodide"], | |
choices=["auto", "linux", "macos", "windows", "emscripten-32"], |
@martinRenou I see valid arguments in both directions for the platform name. I think calling it Pyodide is slightly better: the platform includes not just the ABI defined by the Emscripten version but also what libraries are statically linked into the main Python executable. These conventions are currently defined as "whatever Pyodide does." If other people decide to match these conventions for their own Emscripten Pythons it will work correctly. But I think calling it just "Emscripten" could mislead people? It's not completely clear. |
@DerThorsten correct me if I'm wrong but I feel like this is totally fine? This may be the right opportunity for pyodide and emscripten-forge to start to converge on a general solution for Python packaging in wasm? |
We (Pyodide) link only minimum static libraries to run Python to the main Python module, so if others do this way, too, then it is probably okay. I am not sure how other flags (e.g. |
Well we keep discussing this but it's never all that clear what this entails specifically. Perhaps it would be a good idea to meet semiregularly, though so far we have never seemed to manage that.
If you mean "write down a definition for the platform", I agree that would be a nice thing to do. This is a prerequisite to getting to PyPI uploads. Another point is that if we don't resolve https://discuss.python.org/t/im-stepping-down-as-sponsor-of-emscripten/41064 the ecosystem support for Emscripten will end up in a pretty confusing state, with support in various packaging tools but being an officially unsupported platform for the interpreter itself. |
Resolves #1454. This is on top of #1462. Also close #1002.
We have trouble with the tests because currently
python -m pytest
is required (pytest
by itself doesn't work as expected). Alsopython -m pip
does not work, have to usepip
. It's a work in progress...TODO:
Working:
NonPlatformWheelError
asyncio.run