Skip to content

browseros: libc のヘッダーの値が Linux になった python.wasm の ABI の版を上げる - #2

Draft
steelydylan wants to merge 7 commits into
v3.13.15+progatefrom
browseros-linux-syscall
Draft

steelydylan wants to merge 7 commits into
v3.13.15+progatefrom
browseros-linux-syscall

Conversation

@steelydylan

Copy link
Copy Markdown

概要

wheel の platform タグの ABI の版を上げる。1 本の版は wasi-progate_abi1-wasm32 を wasi-progate_abi3-wasm32 に、スレッド版は wasi-progate_abi2-wasm32 を wasi-progate_abi4-wasm32 にする。

BrowserOS の libc のヘッダーの値(errno・O_*・AT_*・ソケットの定数・POLL*・時計の番号。clockid_t は int)が Linux のものになった(Progate/libc#12、Progate/packages#839)。前の libc で組んだ拡張(numpy などの .so)を新しい python.wasm で読むと、値が食い違うか、消えた記号(_CLOCK_MONOTONIC など)で import が落ちる。ABI の版を上げておけば、pip は前の wheel を選ばず、合う wheel が無ければその場で断る。

packages の側は python#839 で scripts/forks.mjs をこのコミットにし、scripts/build-wheels.py の TAG とテストの期待値を合わせる。

🤖 Generated with Claude Code

browser-os and others added 7 commits October 16, 2026 23:43
1 本の版を abi3、スレッド版を abi4 にする。libc の errno・O_*・時計の番号などが Linux の値になり、前の libc で
組んだ拡張とは値が食い違うので、pip が前の wheel を選ばないようにする。
wasm32-unknown-linux-musl の的では __wasi__ が定義されず、call trampoline の
マクロが直接呼び出しの fallback に落ちていた。call_indirect の型照合は wasm
の仕様なので、OS 層(wasi か linux-musl か)と関係なく wasm の的すべてで有効
にする。
…wn の setsid・setpgroup で渡す

jupyter_client はカーネルを start_new_session=True で起こす(サーバーに届いた SIGINT をカーネルへ漏らさないため)。
BrowserOS の libc の posix_spawn は POSIX_SPAWN_SETSID・POSIX_SPAWN_SETPGROUP を持ち、カーネルの setsid・setpgid も
本物なので、_posixsubprocess が子で setsid() / setpgid() を呼ぶのと同じ結果を posix_spawn の属性で作る。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
browseros: subprocess の start_new_session と process_group を posix_spawn の setsid・setpgroup で渡す
3.13 の methodcaller_clear は void を返すのに Py_tp_clear(inquiry)に入っていた。
WebAssembly の call_indirect は関数の型を照らすので、methodcaller を含む循環を GC が
後始末すると "function signature mismatch" で落ちる。上流の 3.14 で直した pythongh-156762
(cb81ae4360)を写す

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gnature

browseros: operator.methodcaller の tp_clear を int を返す形にする(pythongh-156762 の backport)
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.

2 participants