Skip to content
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

MNT Use c11 rather than c17 in meson.build to work-around Pyodide issue #29015

Merged
merged 2 commits into from
May 14, 2024

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented May 14, 2024

Fix #29013

Copy link

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: dc169e2. Link to the linter CI: here

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM for the time being assuming this is good enough for building scikit-learn against the free-threading version of CPython 3.13b1.

@ngoldbaum
Copy link
Contributor

Yes, C11 is fine, scikit-learn builds successfully under the free-threaded build with this PR checked out.

To be clear, the specific issue we're working around is there's a static_assert in an internal CPython header that cython includes to get at the internals of the python frame object in a build configuration that is triggered in the free-threaded build. static_assert was introduced in C11, so compiling in C99 mode leads to an error for cython code that triggers including the internal header. In principle, CPython could switch the static_assert to Py_BUILD_ASSERT, which does compile under C99. It's all kind of murky though because cython is using an internal header but they are only doing that because there's no public way to get at the relevant information they need.

That said, all the compilers Python supports should also build with the C11 standard, so it should be safe to update this as long as pyiodide is OK with it.

@jeremiedbb jeremiedbb merged commit 00db4df into scikit-learn:main May 14, 2024
34 checks passed
@lesteve lesteve deleted the meson-c11 branch May 14, 2024 18:53
@ogrisel
Copy link
Member

ogrisel commented May 16, 2024

Thanks very much for taking the time to write this explanation @ngoldbaum.

@ogrisel ogrisel added the free-threading PRs and issues related to support for free-threaded CPython (a.k.a. nogil or no-GIL, PEP 703) label May 20, 2024
jeremiedbb pushed a commit to jeremiedbb/scikit-learn that referenced this pull request May 20, 2024
@jeremiedbb jeremiedbb mentioned this pull request May 20, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
free-threading PRs and issues related to support for free-threaded CPython (a.k.a. nogil or no-GIL, PEP 703)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pyodide build broken by updating meson.build to C17
4 participants