From ee3f0ff740c38f8886b1b460a11dd44bb2d894e6 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Tue, 22 Aug 2023 10:21:28 +0200 Subject: [PATCH] Log missing compilation output (#3992) --- lib/src/dart.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/src/dart.dart b/lib/src/dart.dart index 69873d46b..4e1c4d1b7 100644 --- a/lib/src/dart.dart +++ b/lib/src/dart.dart @@ -156,6 +156,16 @@ Future precompile({ ); final result = await client.compile(); + // Sanity check. We've had reports of the compilation failing to provide a + // result, perhaps due to low-memory conditions. + // This should make this slightly easier to recognize in error reports. + if (!fileExists(temporaryIncrementalDill)) { + log.error( + 'Compilation did not produce any result. Expected file at `$temporaryIncrementalDill`', + result.dillOutput, + ); + } + final highlightedName = log.bold(name); if (result.errorCount == 0) { log.message('Built $highlightedName.');