d5b01a1960
After cl/128585 landed a app-jit failure started throwing an error: >testee>err> kernel-service: Error: Unhandled exception: >testee>err> Bad state: No element >testee>err> #0 Iterable.first (dart:core/iterable.dart:520:7) >testee>err> #1 MappedIterable.first (dart:_internal/iterable.dart:374:31) >testee>err> #2 lookupOrBuildNewIncrementalCompiler (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:400:45) >testee>err> #3 _processLoadRequest (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:679:22) >testee>err> #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12) >testee>err> This is caused by the change ultimately adding scripts for the used mixed in files in "LoadedScripts". In this case "dart:collection/map.dart" (as I recall) was added to it. When reloading the source, it runs through all libraries that "isn't dart scheme", and for all of those libraries through all scripts reported by LoadedScripts for that library (now including something from the platform), and checking if it has been modified. Checking if it is modified only works for file:/// uris through, which platform files aren't, so it just reports true (i.e. the file is modified). This is then passed to the kernel service which - based on the list of one file modified - somehow concludes that it has a compiler already (which it doesn't) and then crashes. This CL fixes this specific issue by also skipping scripts that are "dart scheme". There's still an underlying issue that has nothing to do with cl/128585 though. I'll comment on that in the bug (https://github.com/dart-lang/sdk/issues/39869). Bug: 39869 Change-Id: I1a3f2de888ec53c40f4b6b46a369595abae5bb44 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130374 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>