From e254c8cafae3fb336b4849161fb4c240bb0d3a29 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Sun, 28 Jul 2024 18:13:38 -0400 Subject: [PATCH 1/2] fix(rush): don't panic when cache beforeExecute fails --- .../src/logic/operations/CacheableOperationPlugin.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts index ae044c45bf2..a29db3d9c97 100644 --- a/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts +++ b/libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts @@ -402,13 +402,7 @@ export class CacheableOperationPlugin implements IPhasedCommandPlugin { } }; - try { - const earlyReturnStatus: OperationStatus | undefined = await runBeforeExecute(); - return earlyReturnStatus; - } catch (e) { - buildCacheContext.buildCacheProjectLogWritable?.close(); - throw e; - } + return await runBeforeExecute(); } ); From 27b634781ec797090f35a7d6948e02d8bf721493 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Sun, 28 Jul 2024 18:23:56 -0400 Subject: [PATCH 2/2] add changeset --- ...vent-errors-on-before-execute_2024-07-28-22-23.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@microsoft/rush/sennyeya-prevent-errors-on-before-execute_2024-07-28-22-23.json diff --git a/common/changes/@microsoft/rush/sennyeya-prevent-errors-on-before-execute_2024-07-28-22-23.json b/common/changes/@microsoft/rush/sennyeya-prevent-errors-on-before-execute_2024-07-28-22-23.json new file mode 100644 index 00000000000..964eeb4bf15 --- /dev/null +++ b/common/changes/@microsoft/rush/sennyeya-prevent-errors-on-before-execute_2024-07-28-22-23.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Fix a bug that caused the build cache to close its terminal writer before execution on error.", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +}