Skip to content

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Oct 2, 2025

librt is needed both at build and runtime. It's already part of mypy-requirements.txt.

@cdce8p cdce8p requested a review from ilevkivskyi October 2, 2025 10:53
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, forgot about that one, thanks!

@cdce8p
Copy link
Collaborator Author

cdce8p commented Oct 2, 2025

Another open issue is the WASM build. Seems it broke after #19945 was merged.
https://github.com/mypyc/mypy_mypyc-wheels/actions/runs/18124228422/job/51575645656

Should we disable it in the wheel builder, at least for now?

Copy link
Contributor

github-actions bot commented Oct 2, 2025

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi
Copy link
Member

Should we disable it in the wheel builder, at least for now?

Hm, let me check what is going on there.

@ilevkivskyi ilevkivskyi merged commit bf0a60c into python:master Oct 2, 2025
20 checks passed
@cdce8p cdce8p deleted the deps-librt branch October 2, 2025 12:36
@ilevkivskyi
Copy link
Member

OK, not 100% sure, but the problem may be that librt doesn't have a Python version, nor a WASM wheel. It looks like we will need to ask @emmatyping about what to do with those failures.

@JukkaL
Copy link
Collaborator

JukkaL commented Oct 2, 2025

I don't how have much context on WASM, but cibuildwheel supports pyiodide, which seems relevant: https://cibuildwheel.pypa.io/en/stable/options/#platform

@ilevkivskyi
Copy link
Member

I guess I can try adding that to the build matrix (but IIUC only Python 3.12 and 3.13 are supported).

@ilevkivskyi
Copy link
Member

Btw, I have another question: is sdist something valuable/meaningful for an extension module? Should I also add sdist for librt?

@JukkaL
Copy link
Collaborator

JukkaL commented Oct 2, 2025

Yeah I think sdist is something we should have, as it will allow building the module on a platform for which we don't provide a binary wheel (e.g. FreeBSD, development version of CPython or maybe even PyPy).

@ilevkivskyi
Copy link
Member

OK, it looks like we have a problem: cibuildwheel only supports pyodide on Python 3.12 and 3.13 (according to docs), but we only build WASM wheel for mypy on Python 3.10. So we will need to either:

  • Manually build a 3.10 WASM wheel for librt
  • Only build WASM wheels for mypy on Python 3.12 and/or 3.13

Which way should we go? I would say the second option looks more future-proof.

@ilevkivskyi
Copy link
Member

It looks like I can successfully build WASM wheels using cibuildwheels on Python 3.12 and 3.13, see mypyc/librt#6. There are however a huge backlog on macos GHA runners, so it will probably take hours to release new version of librt.

@ilevkivskyi
Copy link
Member

Oh god, it looks like cibuildwheels builds wheels not supported by PyPI?

WARNING  Error during upload. Retry with the --verbose option for more details. 
ERROR    HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/        
         Binary wheel 'librt-0.1.1-cp312-cp312-pyodide_2024_0_wasm32.whl' has an
         unsupported platform tag 'pyodide_2024_0_wasm32'.

why can't we have nice things?

@ilevkivskyi
Copy link
Member

Also obviously that "official" GH action creates partially broken releases, now there are only half of the artifacts present for 0.1.1 https://pypi.org/project/librt/0.1.1/#files

@ilevkivskyi
Copy link
Member

https://pyodide.org/en/0.26.3/development/building-and-testing-packages.html#notes

for now, PyPi does not support emscripten/wasm32 wheels so you will not be able to upload them there.

@ilevkivskyi
Copy link
Member

I guess for now I will continue building WASM wheels, but skip them during upload to PyPI.

@ilevkivskyi
Copy link
Member

OK, so I repaired the librt 0.1.1 release. I verified that

pip install -U librt --no-binary librt

works, i.e. all the necessary bits are present in the source archive (like headers) to build the extension locally.

@ilevkivskyi
Copy link
Member

I tried re-running failed jobs, but it looks like availability of sdist for librt on PyPI didn't help. I am going to disable the WASM build then until @emmatyping has time to fix it.

@ilevkivskyi
Copy link
Member

mypyc/mypy_mypyc-wheels#104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants