anchor.diff:      // Write summary.
       assembler = new PackageBundleAssembler();
       if (_shouldOutputSummary) {
  -      if (options.buildSummaryOnlyUnlinked) {
  -        for (var src in explicitSources) {
  -          // Note: This adds the unit to the assembler if it needed to be
  -          // computed, so we don't need to explicitly do that.
  -          _unlinkedUnitForUri('${src.uri}');
  -        }
  -      } else {
  -        Set<String> unlinkedUris =
  -            explicitSources.map((Source s) => s.uri.toString()).toSet();
  +      // Prepare all unlinked units.
  +      for (var src in explicitSources) {
  +        _prepareUnlinkedUnit('${src.uri}');
  +      }
  +
  +      // Build and assemble linked libraries.
  +      if (!options.buildSummaryOnlyUnlinked) {
  +        // Prepare URIs of unlinked units that should be linked.
  +        var unlinkedUris = new Set<String>();
           for (var bundle in unlinkedBundles) {
             unlinkedUris.addAll(bundle.unlinkedUnitUris);
           }
  -
  -        _serializeAstBasedSummary(unlinkedUris);
  +        for (var src in explicitSources) {
  +          unlinkedUris.add('${src.uri}');
  +        }
  +        // Perform linking.
  +        _computeLinkedLibraries(unlinkedUris);
           assembler.recordDependencies(summaryDataStore);
         }
  +
         // Write the whole package bundle.
         PackageBundleBuilder bundle = assembler.assemble();
         if (options.buildSummaryOutput != null) {
  
positive.code: 
    PackageBundleAssembler assembler;
    final Set<Source> processedSources = new Set<Source>();
    final Map<Uri, UnlinkedUnit> uriToUnit = <Uri, UnlinkedUnit>{};
  
    BuildMode(this.resourceProvider, this.options, this.stats);
  
  
negative.code:       _printErrors(outputPath: options.buildAnalysisOutput);
        return _computeMaxSeverity();
      }
    }
  
    /**
     * Compute linked libraries for the given [libraryUris] using the linked
     * libraries of the [summaryDataStore] and unlinked units in [uriToUnit], and
     * add them to  the [assembler].
     */
    void _computeLinkedLibraries(Set<String> libraryUris) {
      LinkedLibrary getDependency(String absoluteUri) =>
          summaryDataStore.linkedMap[absoluteUri];
  
      UnlinkedUnit getUnit(String absoluteUri) =>
          summaryDataStore.unlinkedMap[absoluteUri] ?? uriToUnit[absoluteUri];
  
      Map<String, LinkedLibraryBuilder> linkResult = link(
          libraryUris,
          getDependency,
          getUnit,
          context.declaredVariables.get,
          options.strongMode);
      linkResult.forEach(assembler.addLinkedLibrary);
    }
  
    ErrorSeverity _computeMaxSeverity() {
  