Skip to content

Commit

Permalink
build: workaround for jsii exit code issue (#2200)
Browse files Browse the repository at this point in the history
Until aws/jsii#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).
  • Loading branch information
Elad Ben-Israel committed Apr 8, 2019
1 parent 4247966 commit cdbe7b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/cdk-build-tools/lib/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import { Timers } from "./timer";
* Run the compiler on the current package
*/
export async function compileCurrentPackage(timers: Timers, compilers: CompilerOverrides = {}): Promise<void> {
await shell(packageCompiler(compilers), timers);
const stdout = await shell(packageCompiler(compilers), timers);

// 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`);
}

// Find files in bin/ that look like they should be executable, and make them so.
const scripts = currentPackageJson().bin || {};
Expand Down

0 comments on commit cdbe7b6

Please sign in to comment.