[bazel] Fix serialization when not doing summary

Before this CL, if using the incremental compiler in bazels
kernel_worker, did not do summaries and did ask to "exclude-non-sources"
one would still get the entire thing (including loaded summaries etc)
(i.e. it would behave as if "exclude-non-sources" wasn't set).

This CL fixes it and makes it serialize as in the non-incremental case.

Change-Id: I396b53664a3d1ac32a243e903c8ff5c049fca453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113021
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
This commit is contained in:
Jens Johansen 2019-08-15 16:31:30 +00:00 committed by commit-bot@chromium.org
parent cd16fba718
commit 23a956c7a8

View file

@ -321,7 +321,11 @@ Future<ComputeKernelResult> computeKernel(List<String> args,
includeSources: false, includeOffsets: false));
}
return Future.value(fe.serializeComponent(incrementalComponent));
return Future.value(fe.serializeComponent(incrementalComponent,
filter: excludeNonSources
? (library) => sources.contains(library.importUri)
: null,
includeOffsets: true));
});
} else if (summaryOnly) {
kernel = await fe.compileSummary(state, sources, onDiagnostic,