ext_tooling
ptwm.ext_tooling.build
ptwm ext build — detect language, run the right toolchain, place the .wasm.
ptwm.ext_tooling.build
ptwm ext build — detect language, run the right toolchain, place the .wasm.
ptwm.ext_tooling.build
python/ptwm/ext_tooling/build.py:1module ptwm.ext_tooling.buildptwm ext build — detect language, run the right toolchain, place the .wasm.
ptwm.ext_tooling.build.build_extension
python/ptwm/ext_tooling/build.py:45def build_extension(cwd: Path, release: bool = True) -> PathBuild the extension in *cwd* and return the path to the produced .wasm.
| Name | Type | Description |
|---|---|---|
| cwd | Path | Root directory of the extension project (must contain ``manifest.toml``). |
| release = True | bool | When ``True`` (default), build with optimizations enabled. |
Returns
Path — Path to the ``.wasm`` file placed next to ``manifest.toml``. Raises
BuildError— When language detection or the underlying toolchain invocation fails.
ptwm.ext_tooling.build.BuildError
python/ptwm/ext_tooling/build.py:11class BuildError(RuntimeError):Raised when an `ext build` invocation fails.
ptwm.ext_tooling.build.detect_language
python/ptwm/ext_tooling/build.py:15def detect_language(cwd: Path) -> strDetect the build language of an extension project.
| Name | Type | Description |
|---|---|---|
| cwd | Path | Root directory of the extension project. |
Returns
str — One of ``"rust"``, ``"c"``, ``"zig"``, or ``"assemblyscript"``. Raises
BuildError— When no recognised project layout is found.