60cf51f8a2
When bootstrapping from an existing dill file, the incremental compiler tries to create a bit-perfect output in the case where nothing has changed (even if something had been marked as changed). To do this it has to ensure that the order of the libraries doesn't change. The previous implementation of this just inserted a library with the same url as before at the exact same index as in the original dill file which works fine (and is linear time) in the case where there are no old libraries that dissappear. When for instance the first library disappear, though, things go awry. This CL introduces a test for it and fixes the issue by simply sorting the libaries based on the original placement instead. Fixes #32197. Bug: 32197 Change-Id: I57bf20d7b8ec9232844d52d9e3a28cad474a5311 Reviewed-on: https://dart-review.googlesource.com/42401 Reviewed-by: Peter von der Ahé <ahe@google.com> Commit-Queue: Jens Johansen <jensj@google.com>