From 9c025c41b89e744e2d1a228baf6d24a0e7defe55 Mon Sep 17 00:00:00 2001 From: Sunil Pai Date: Mon, 25 Apr 2022 00:04:34 +0100 Subject: [PATCH] fix: remove timeout on custom builds, and make sure logs are visible (#838) This removes the timeout we have for custom builds. We shouldn't be applying this timeout anyway, since it doesn't block wrangler, just the user themselves. Further, in https://github.com/cloudflare/wrangler2/pull/759, we changed the custom build's process stdout/stderr config to "pipe" to pass tests, however that meant we wouldn't see logs in the terminal anymore. This patch removes the timeout, and brings back proper logging for custom builds. --- .changeset/calm-bottles-talk.md | 7 +++++++ packages/wrangler/src/entry.ts | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .changeset/calm-bottles-talk.md diff --git a/.changeset/calm-bottles-talk.md b/.changeset/calm-bottles-talk.md new file mode 100644 index 000000000000..dd203da00a4c --- /dev/null +++ b/.changeset/calm-bottles-talk.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +fix: remove timeout on custom builds, and make sure logs are visible + +This removes the timeout we have for custom builds. We shouldn't be applying this timeout anyway, since it doesn't block wrangler, just the user themselves. Further, in https://github.com/cloudflare/wrangler2/pull/759, we changed the custom build's process stdout/stderr config to "pipe" to pass tests, however that meant we wouldn't see logs in the terminal anymore. This patch removes the timeout, and brings back proper logging for custom builds. diff --git a/packages/wrangler/src/entry.ts b/packages/wrangler/src/entry.ts index e5b279b70d0d..c9e7991d7836 100644 --- a/packages/wrangler/src/entry.ts +++ b/packages/wrangler/src/entry.ts @@ -89,9 +89,10 @@ export async function runCustomBuild( console.log("running:", build.command); await execaCommand(build.command, { shell: true, - stdout: "pipe", - stderr: "pipe", - timeout: 1000 * 30, + // we keep these two as "inherit" so that + // logs are still visible. + stdout: "inherit", + stderr: "inherit", ...(build.cwd && { cwd: build.cwd }), });