From 76310b0a91f9800a8813270894be8596383c431f Mon Sep 17 00:00:00 2001 From: Yves Brissaud Date: Tue, 10 Nov 2026 08:23:46 +0100 Subject: [PATCH] fix: stage the entrypoint manifest on the builtin Dang runtime Rendering a static entrypoint loads the module source of a staged manifest. With no runtime of its own, staging added the builtin Python runtime, and the engine loads that SDK eagerly: it runs codegen generate-module and builds the Go module, for a source the build reads only the paths of. The engine refuses a manifest with neither entrypoint nor runtime, so stage it on the builtin Dang runtime, which loads with no build. The saving, 9 to 14 s on a cold engine (-8.9 s local, -14.4 s cloud), comes from trace analysis of the unmodified build. The patched build ran on a warm engine and was only checked for the absence of the python runtime spans and of the python-sdk generate-module exec. entrypoint-manifest-check passes, and so do static-scope-init-check, static-types-load-check, linked-entrypoint-config-check and generate-scope-init-check. entrypoint-client-call-check fails, and fails identically on upstream/main on engine v1.0.0-beta.25. Signed-off-by: Yves Brissaud --- mod.dang | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod.dang b/mod.dang index 19cf7a2..c7c9920 100644 --- a/mod.dang +++ b/mod.dang @@ -239,11 +239,13 @@ type Mod { let staging(target: Workspace!, outside: [String!]!): Workspace! { if (hasEntrypointManifest) { let loaded = sdkHelpers.moduleManifest(loadToml: ws.file("/" + manifestPath)).withoutEntrypoint - # A static entrypoint manifest holds no runtime to fall back on. + # A static entrypoint manifest holds no runtime, and the engine refuses a + # manifest with neither. Dang, not Python: the engine loads the added + # runtime eagerly, and only Dang's loads with no build. let runnable = if (manifestConfig.fields.contains("runtime")) { loaded } else { - loaded.withLegacyPythonRuntime + loaded.withLegacyDangRuntime } # The build that renders the types reads the path sources outside the # module directory, which the entrypoint's sources will return.