Repository navigation
Conversation
✅ Deploy Preview for golemcloud canceled.
|
noise64
force-pushed
the
python-runtime
branch
from
November 16, 2026 23:55
69c3e45 to
966533d
Compare
noise64
force-pushed
the
python-runtime
branch
from
November 17, 2026 01:11
966533d to
64182c6
Compare
This was referenced Nov 17, 2026
noise64
force-pushed
the
python-runtime
branch
2 times, most recently
from
November 18, 2026 23:58
1a0fc47 to
1ce8942
Compare
noise64
force-pushed
the
python-runtime
branch
from
November 20, 2026 13:38
1ce8942 to
52f5fc9
Compare
The generated binding calls golem:tool/guest.invoke with six arguments, so the five-parameter method raised TypeError instead of returning invalid-tool-name. componentize-py moves to 58d479e. Its lowering checks accept number types such as numpy.int64, build entropy also covers the app name and Python path files, prepared blobs with links are rejected, and the initialization WIT digest normalizes line endings.
The dlopen symbol-count fix is merged into the golem-2.0 branch of golemcloud/wasm-tools, and componentize-py cad25ee removed its vendored copy and pins that commit. The workspace patch now pins the same wasm-tools commit, and componentize-py moves to cad25ee. The sibling crates of wit-component still come from crates.io.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of GOL-1850. This is the first Python PR in a stack: PY-03, PY-04 and PY-05 come next.
This PR adds the Golem side of the prepared Python runtime. It uses the prepare/assemble API of the golemcloud/componentize-py fork at
cad25ee(fork PR #2, stacked on #1).sdks/python/wit/main.witdefines the guest worldgolem:python/agent-guest.sdks/python/wit/depsis one more mirror incargo make wit.sdks/python/src/golemholds the SDK bootstrap.golem._bootstrapregisters the component's exports and imports the application's entry modules. It then finalizes the agent registry. Discovery constructs no agents. This PR does not add agent declarations. Discovery returns an empty list until PY-03.golem-python-assemblerreads the prepared assets and links them with the SDK and the application. It then pre-initializes the result oncreate_wasmtime_config_without_fs_cache. The fork does not copy engine settings: Golem supplies the store, the linker and its WASI context. The crate links the fork without theembedded-runtimefeature, so the Golem build does not compile CPython or process WIT.The C stack is 96 KiB. On the shared engine's 1 MiB
max_wasm_stack, a 1 MiB C stack lets deeprepr/json/picklerecursion exhaust the engine's stack before CPython raisesRecursionError. With 96 KiB, CPython raisesRecursionErrorfirst, at a lower depth. This PR does not change the shared engine.The build captures pre-initialization stdout and stderr, at most 64 KiB each. An import error then keeps its original traceback.
The fork takes wit-component 0.258.3 from the golemcloud/wasm-tools fork at
801650b. The root[patch.crates-io]pins wit-component to the same revision, so Golem and componentize-py resolve one wit-component. A comment inCargo.tomlsays to keep the two revisions equal.cargo make python-sdk-prepareinstalls the pinned fork revision and writes the prepared assets tosdks/python/target/prepared. The tests ofgolem-python-assemblerread them. The task revision and the workspace dependency revision must be equal.Pre-initialization sees host-independent file metadata. Stat results have no timestamps, and metadata hashes (from which the guest derives inode numbers) count the files in the order the guest first sees them. CPython keeps this metadata in the memory that the component saves. Without these overrides, two builds of the same input in new directories differ in 282 bytes. A test checks that the two builds are identical.
Tools.invoketakes the six arguments ofgolem:tool/guest.invoke, includingstdoutandstderr, so a call returnsinvalid-tool-nameinstead of raisingTypeError.Limits: the world does not import
golem:api/retry-scopeand does not exportsave-snapshot/load-snapshot, which the TypeScript, Go and Scala worlds have. Snapshotting is reported as disabled.Open in this issue: builds on different file systems or hosts are not checked yet, because directory listing order and link counts still come from the host. Wasm exceptions wait for #4351.
Verification
This head, a0c4cb3, adds one commit to the previous head a50b51a. It pins componentize-py
cad25ee, which removes its vendor copy of wit-component, and pins wit-component to wasm-tools801650b.Cargo.lockchanges only by threesourcelines (componentize-py, componentize-py-test-generator and wit-component 0.258.3).cargo metadata --lockedsucceeds, and no crate name and version has two sources. The history is not rewritten. Checks on this head:cargo test -p golem-python-assembler --testsand--doc,cargo clippy -p golem-python-assembler --all-targets -- -D warningsandcargo fmt -p golem-python-assembler -- --check: pass. The assemble tests build actual components from the prepared assets and run them on the shared engine.cad25ee, built with the pinned SQLite tarball from a local cache (the same SHA-256).cargo make python-sdk-preparedid not run, because sqlite.org is not reachable from the build host. Two prepares gave the same manifest identity,a120875a…0234, and identical files.ruff check: fails with the known finding I001 in_guest.py.ruff format --checkfails, becausesdks/python/testsdoes not exist at this head.CI: pull requests run no Golem tests. A missing result is not a pass.