Conversation
Maybe we can store some more information in platform string? For instance |
|
Well for example the manylinux tag started out as just manylinux then they switched to manylinux_year and then to manylinux_libc_version. I think it's fine to start with just pyodide and put in more stuff once we know we need it. |
Makes sense. Thanks! |
|
One difference is that |
Interesting... |
|
So I understand correctly, this would replace the platform tags of I understand that emscripten + version is not specific enough to indicate all the custom flags we may be using but I feel like just relying on the Python version is not sufficient, particularly if we are designing a new platform tag from scratch.
Yeah, there is that. Also,
So PyPI aside I would have expected something like Or alternatively
WDYT? |
|
scikit-build/scikit-build#977 should cover whatever is chosen here, I think. :) |
|
I like the idea of supporting both About hashing build flags, I think there might be flags that are compatible with each other, so maybe we can use some bit flags instead? For example, suppose we use 8 bytes (64-bit) flag that can be encoded by: def platform():
flag = 0
if simd: flag |= (1 << 0)
if threading: flag |= (1 << 1)
if ...
return hex(flag)
# Results in: emscripten_deadbeafdeadbeaf_wasm32So downstream package managers can parse these flags and check the flags are compatible with their distribution. |
|
There are really two different things here. For example, simd has no ABI consequences, but it will only work on the architecture wasm32 + simd. But wasm32+simd is actually a different architecture and not a different platform. Another example like this is tail calls. These can be feature detected at runtime and the appropriate one can be chosen. On the other hand, wasm bigint and wasm exception handling have ABI consequences too, so wheels that don't use these features don't get along with interpreters that do use them / vice versa. So either we use them everywhere and don't support runtimes missing these features or we use them nowhere. I'm not really sure in which category pthreads lies except that for now we can't use it at all with dynamic linking... |
What's a platform tag then? I thought it was more or less OS/runtime + arch; as in But then interestingly, whether you can use SIMD or GPU natively is not part of the platform tag. In any case, I guess there are some parallels with linux wheels here. The questions we need to have a clear answer to, is,
OK, but if say you take the artifact of emscripten-forge put it in a zip file/wheel, what would be the platform tag of that? It doesn't necessarily follow the PEP but it is certainly weird to call it a pyodide platform wheel. So I follow the logic that pyodide produces pyodide tagged wheels that are later standardized via auditwheel-emscripten to Anyway, maybe it would be good to have a draft of the PEP before doing any of the implementation changes because there are a lot of open questions :) Or maybe we could have a separate call about this. |
auditwheel-emscripten works (or at least I want to make it work) with wheels that are not built with pyodide-build. It only relies on the dynamic linking spec of Emscripten and it does not use any pyodide specific features except that it uses pyodide CLI entrypoint. So for example, it works well with wheels built with Rust toolchain. So I think audtiwheel-emscripten can do the job of auditing and relabeling any type of Emscripten wheels: pyodide wheels, emscripten-forge wheels (if they have).
Sounds good! I'm also looking forward to hearing from Hood about WASM Summit in Pycon. |
This seems a bit optimistic to me, since there are a very wide variety of different ABIs. I was thinking that we would standardize a Pyodide ABI and then put Pyodide in the platform tags. It might even be good to go the other way: by default tag the wheel with One disadvantage of the name
I guess I should try to start a draft soon. I'll make a document and share it with you all. I had in my head the following set of tasks:
|
|
I guess for auditwheel-emscripten it would be nice to be able to give it a pair a main module and a side module and validate whether they can be linked together. So the main condition is that the imports of the side module need to be a subset of the exports of the main module and the types need to match. But we presumably need additional metadata to determine if they agree about exception handling / stack unwinding ABIs, wasm bigint, etc. I think many of these ABI changes are not visible from the export/import types. We see this because an import/export type mismatch will generally fail either when the side module is loaded or inside of |
Thanks for working on those! Maybe we should be sure of the platform we would have and the interaction with |
|
I think the idea is that we update the platform with whatever changes we need now. In any case cibuildwheel will need to be updated to add new versions of Pyodide. We are pretty certain that whatever our platform is we will want people to be able to produce wheels using cibuildwheel. Maybe some minor things will need to change but I think we can update them ourselves (as we've been doing with numpy for instance). |
Work towards Pyodide wheels on pypi.
One question is what happens if we have an emergency need of an ABI break in between
major Python version updates. But we can just not do that I suppose.