From 62ee6a3243340ad35fd901983d32dc6c819f92cb Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 9 Apr 2019 01:09:57 +0300 Subject: [PATCH 1/2] build: workaround for jsii exit code issue Until https://github.com/awslabs/jsii/pull/442 is released we must fail builds on compilation errors. This is a temporary workaround for this issue (if there is something in stdout we consider that a compilation error). --- tools/cdk-build-tools/lib/compile.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/cdk-build-tools/lib/compile.ts b/tools/cdk-build-tools/lib/compile.ts index c58e7e75c579d..ca8736e2b7cbd 100644 --- a/tools/cdk-build-tools/lib/compile.ts +++ b/tools/cdk-build-tools/lib/compile.ts @@ -7,7 +7,13 @@ import { Timers } from "./timer"; * Run the compiler on the current package */ export async function compileCurrentPackage(timers: Timers, compilers: CompilerOverrides = {}): Promise { - await shell(packageCompiler(compilers), timers); + const stdout = await shell(packageCompiler(compilers), timers); + + // WORKAROUND: jsii 0.8.2 does not exist with non-zero on compilation errors + // this is a workaround until this is released (https://github.com/awslabs/jsii/pull/442) + if (stdout.trim()) { + throw new Error(`Compilation failed`); + } // Find files in bin/ that look like they should be executable, and make them so. const scripts = currentPackageJson().bin || {}; From 93b1f7cbe4401151e17691276023f025be3edb3b Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 9 Apr 2019 01:13:30 +0300 Subject: [PATCH 2/2] update comment --- tools/cdk-build-tools/lib/compile.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cdk-build-tools/lib/compile.ts b/tools/cdk-build-tools/lib/compile.ts index ca8736e2b7cbd..ef8a1bbed0ab6 100644 --- a/tools/cdk-build-tools/lib/compile.ts +++ b/tools/cdk-build-tools/lib/compile.ts @@ -9,8 +9,8 @@ import { Timers } from "./timer"; export async function compileCurrentPackage(timers: Timers, compilers: CompilerOverrides = {}): Promise { const stdout = await shell(packageCompiler(compilers), timers); - // WORKAROUND: jsii 0.8.2 does not exist with non-zero on compilation errors - // this is a workaround until this is released (https://github.com/awslabs/jsii/pull/442) + // WORKAROUND: jsii 0.8.2 does not exit with non-zero on compilation errors + // until this is released: https://github.com/awslabs/jsii/pull/442 if (stdout.trim()) { throw new Error(`Compilation failed`); }