From 987a1b00cddec2bc8236020535e6eba87c8dc776 Mon Sep 17 00:00:00 2001 From: Debdut Date: Thu, 16 Jul 2026 12:24:05 +0530 Subject: [PATCH 1/2] fix(apps-engine/deno): use std mkdtemp for ephemeral files --- .../apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts b/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts index 430185a94ca77..9c1a132fc2f8d 100644 --- a/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts +++ b/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts @@ -17,6 +17,10 @@ function getDenoConfigPath(): string { return require.resolve('../../../../deno-runtime/deno.jsonc'); } +function getDenoEphemeralConfigPath(): string { + return fs.mkdtempSync("deno-runtimeXXXXX"); +} + /** * Generates a runtime deno.jsonc at `/deno_runtime.jsonc` by reading * the static config and injecting the resolved absolute path for @@ -67,7 +71,7 @@ export class DenoRuntimeSubprocessController extends BaseRuntimeSubprocessContro this.denoDir = process.env.DENO_DIR ?? path.join(this.packagePath, '.deno-cache'); this.denoRuntimePath = path.join(this.tempFilePath, 'deno-runtime', 'main.ts'); - this.denoEphemeralConfigPath = this.denoConfigPath.replace('.jsonc', '.runtime.jsonc'); + this.denoEphemeralConfigPath = path.join(getDenoEphemeralConfigPath(), path.basename(this.denoConfigPath).replace('.jsonc', '.runtime.jsonc')); /** * Deno 2.x refuses to run scripts inside the node_modules, so we create a symlink to the deno runtime files in the temp directory From 6ef47e058f61dc2ec0de144c6d40030550585ee2 Mon Sep 17 00:00:00 2001 From: Debdut Date: Thu, 16 Jul 2026 12:35:18 +0530 Subject: [PATCH 2/2] fix(apps-engine/deno): use this.tempFilePath that respects TMPDIR --- .../apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts b/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts index 9c1a132fc2f8d..78fbe9beef960 100644 --- a/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts +++ b/packages/apps/src/server/runtime/deno/AppsEngineDenoRuntime.ts @@ -17,10 +17,6 @@ function getDenoConfigPath(): string { return require.resolve('../../../../deno-runtime/deno.jsonc'); } -function getDenoEphemeralConfigPath(): string { - return fs.mkdtempSync("deno-runtimeXXXXX"); -} - /** * Generates a runtime deno.jsonc at `/deno_runtime.jsonc` by reading * the static config and injecting the resolved absolute path for @@ -71,7 +67,7 @@ export class DenoRuntimeSubprocessController extends BaseRuntimeSubprocessContro this.denoDir = process.env.DENO_DIR ?? path.join(this.packagePath, '.deno-cache'); this.denoRuntimePath = path.join(this.tempFilePath, 'deno-runtime', 'main.ts'); - this.denoEphemeralConfigPath = path.join(getDenoEphemeralConfigPath(), path.basename(this.denoConfigPath).replace('.jsonc', '.runtime.jsonc')); + this.denoEphemeralConfigPath = path.join(this.tempFilePath, path.basename(this.denoConfigPath).replace('.jsonc', '.runtime.jsonc')); /** * Deno 2.x refuses to run scripts inside the node_modules, so we create a symlink to the deno runtime files in the temp directory