diff --git a/pkg/front_end/presubmit_helper_spawn.dart b/pkg/front_end/presubmit_helper_spawn.dart index dd52fcce7f51..fd0b01cce6a2 100644 --- a/pkg/front_end/presubmit_helper_spawn.dart +++ b/pkg/front_end/presubmit_helper_spawn.dart @@ -37,9 +37,43 @@ Future main(List args, [SendPort? sendPort]) async { includedFiles: work.includedFiles, includedDirectoryUris: work.includedDirectoryUris, repoDir: work.repoDir)); - } catch (e) { + } catch (e, st) { // This will make it send false. compileAndLintErrorsFound = -1; + + StringBuffer sb = new StringBuffer(); + sb.writeln("void main() {"); + sb.writeln(" runCompileAndLintTest(includedFiles: {"); + String comma = ""; + for (Uri uri in work.includedFiles) { + sb.writeln(" ${comma}Uri.parse('$uri')"); + comma = ", "; + } + sb.writeln(" }, includedDirectoryUris: {"); + comma = ""; + for (Uri uri in work.includedDirectoryUris) { + sb.writeln(" ${comma}Uri.parse('$uri')"); + comma = ", "; + } + sb.writeln(" }, repoDir: Uri.parse('${work.repoDir}'));"); + sb.writeln("}"); + + print(""" +WARNING: '${work.name}' crashed: +============ +${e.toString().trim()} +============ +$st +============ + +To reproduce open up compile_and_lint_impl.dart and insert + +$sb + +Then run that file through your debugger or similar. + +"""); + print("Got error for ${work.name}: $e"); } print("Sending ok = ${compileAndLintErrorsFound == 0} " "for ${work.name} after ${stopwatch.elapsed}"); diff --git a/pkg/front_end/test/compile_and_lint_impl.dart b/pkg/front_end/test/compile_and_lint_impl.dart index cfe3f41499e1..2c4e6da3a907 100644 --- a/pkg/front_end/test/compile_and_lint_impl.dart +++ b/pkg/front_end/test/compile_and_lint_impl.dart @@ -181,6 +181,7 @@ Set _replaceParts(Uri packageConfigUri, Set files) { in Directory.fromUri(packageEntry.key.packageUriRoot) .listSync(recursive: true)) { if (f is! File) continue; + if (!f.path.endsWith(".dart")) continue; if (helpers[f.uri] == null) { FileInfoHelper fileInfo = indexUriHelper(f.uri); for (String name in fileInfo.libraryNames) {