Skip to content

gh-95174: Add pthread stubs for WASI (GH-95234) #95234

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

Merged
merged 6 commits into from
Jul 27, 2022

Conversation

tiran
Copy link
Member

@tiran tiran commented Jul 25, 2022

Neither WASI nor default builds with Emscripten have support for
threading. While Emscripten comes with pthread stubs, WASI-SDK 16 and
earlier are lacking stubs.

Python initially used WASIX stubs to provide pthread stubs. This
changeset introduces stubs modelled after Emscripten's stubs.

Emscripten without pthread emulation now has sys.thread_info.name
pthread-stubs, too.

@tiran
Copy link
Member Author

tiran commented Jul 25, 2022

PR depends on GH-95179 and GH-95229.

@tiran tiran requested a review from brettcannon July 25, 2022 13:40
@tiran tiran force-pushed the gh-95174-pthread-stubs branch from bfbe629 to 6d44757 Compare July 25, 2022 13:44
@tiran tiran marked this pull request as ready for review July 25, 2022 13:55
@tiran tiran force-pushed the gh-95174-pthread-stubs branch from 9418dce to 83cdef3 Compare July 27, 2022 06:28
@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @tiran for commit 45c87f0d043fbfd14b09140e070bfc3aa8724f27 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2022
@tiran
Copy link
Member Author

tiran commented Jul 27, 2022

The changeset breaks wasm32-wasi buildbot because our current buildbot configurations hard-codes WASIX. PRs #95320 and python/buildmaster-config#337 will change set. I will continue with this PR after GH-95320 has been backported to 3.11 and the buildbots are running with new configuration.

tiran and others added 5 commits July 27, 2022 15:49
Neither WASI nor default builds with Emscripten have support for
threading. While Emscripten comes with pthread stubs, WASI-SDK 16 and
earlier are lacking stubs.

Python initially used WASIX stubs to provide pthread stubs. This
changeset introduces stubs modelled after Emscripten's stubs.

Emscripten without pthread emulation now has ``sys.thread_info.name``
``pthread-stubs``, too.
@tiran tiran force-pushed the gh-95174-pthread-stubs branch from 45c87f0 to 503ef05 Compare July 27, 2022 13:51
@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @tiran for commit 503ef05 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 27, 2022
@tiran tiran changed the title gh-95174: Add pthread stubs for WASI gh-95174: Add pthread stubs for WASI (GH-95234) Jul 27, 2022
@tiran tiran merged commit 0fe645d into python:main Jul 27, 2022
@miss-islington
Copy link
Contributor

Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @tiran, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae 3.11

@tiran tiran deleted the gh-95174-pthread-stubs branch July 27, 2022 18:28
@tiran
Copy link
Member Author

tiran commented Jul 27, 2022

Backport to 3.11 depends on GH-95272 and GH-95308

@tiran tiran added needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes labels Jul 31, 2022
@miss-islington
Copy link
Contributor

Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @tiran, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae 3.11

tiran added a commit to tiran/cpython that referenced this pull request Jul 31, 2022
Co-authored-by: Brett Cannon <[email protected]>.
(cherry picked from commit 0fe645d)

Co-authored-by: Christian Heimes <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 31, 2022
@bedevere-bot
Copy link

GH-95503 is a backport of this pull request to the 3.11 branch.

pablogsal pushed a commit that referenced this pull request Aug 1, 2022
Co-authored-by: Brett Cannon <[email protected]>.
(cherry picked from commit 0fe645d)

Co-authored-by: Christian Heimes <[email protected]>
@kanavin
Copy link
Contributor

kanavin commented Aug 19, 2022

This PR introduces an incorrect condition, please see my comment in the code.

@tiran
Copy link
Member Author

tiran commented Aug 19, 2022

Could you please open a new ticket? Issues are easier to track than comments on closed PRs.

@kanavin
Copy link
Contributor

kanavin commented Aug 19, 2022

Could you please open a new ticket? Issues are easier to track than comments on closed PRs.

#96125

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.

5 participants