-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[mypyc] Add support for building mypyc code on WASM #13446
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
Conversation
Blocked on python/typeshed#8572 |
Hmm I'm unsure why things disagree. It seems like |
Ah yeah I messed up my math so it was setting This should be ready review now! |
The latest commit 4ec39a8 enables outputting VT100 color codes for use in the web via things like https://www.npmjs.com/package/ansi-to-html. I guess I could directly output HTML but I figure that this is a bit more portable in case someone wants to run mypy under node or do something else. This is only enabled if you pass |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
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.
Looks good, with the big caveat that I'm not sure I understand the exact circumstances when sysconfig's sizeof_size_t differs from sys.maxsize
Co-authored-by: Shantanu <[email protected]>
|
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Oh this also needs #13445 to actually work (pyodide build uses the PEP 517 interface) |
Description
This PR tweaks two things about how mypyc generates and builds C code to better support WebAssembly. First, we search
sysconfig
for the size ofsize_t
, which works much better for cross-compiling. Second, newer versions of clang have-Wno-unused-but-set-variable
and so it is added to the default list of arguments (this should probably land regardless the decision on merging this PR).Test Plan
This PR depends on #13445. To test this PR, you can do the following:
assuming mypy checkout with both PRs applied, must be on Python 3.10(!)
Note: you will get a warning about using
--global-option
, you can ignore it for now. I'm trying to find out why--build-option
isn't working...