anchor.diff:      return '--source=$uri';
     }));
   }
  -
  -/// Used when iterating transitive deps.
  -class _ModuleNode {
  -  final parents = Set<AssetId>();
  -  final Module module;
  -
  -  /// Whether this module should provide itself as a source dependency instead
  -  /// of a dill dependency.
  -  bool sourceOnly;
  -
  -  AssetId get id => module.primarySource;
  -
  -  _ModuleNode(this.module, this.sourceOnly);
  -}
  
positive.code:   File packagesFile;
  
    await buildStep.trackStage('CollectDeps', () async {
      var transitiveKernelDeps = <AssetId>[];
      var transitiveSourceDeps = <AssetId>[];
  
      await _addModuleDeps(module, transitiveKernelDeps, transitiveSourceDeps,
          buildStep, outputExtension);
  
      var allAssetIds = Set<AssetId>()
        ..addAll(module.sources)
        ..addAll(transitiveKernelDeps)
        ..addAll(transitiveSourceDeps);
      await scratchSpace.ensureAssets(allAssetIds, buildStep);
  
      packagesFile = await createPackagesFile(allAssetIds);
  
      _addRequestArguments(request, module, transitiveKernelDeps, dartSdkDir,
          sdkKernelPath, outputFile, packagesFile, summaryOnly);
    });
  
    // We need to make sure and clean up the temp dir, even if we fail to compile.
  
negative.code:   }
  }
  
  /// Finds the transitive dependencies of [root] and categorizes them as
  /// [kernelDeps] or [sourceDeps].
  ///
  /// A module will have it's kernel file in [kernelDeps] if it and all of it's
  /// transitive dependencies have readable kernel files. If any module has no
  /// readable kernel file then it, and all of it's dependents will be categorized
  /// as [sourceDeps] which will have all of their [Module.sources].
  Future<void> _findModuleDeps(
      Module root,
      List<AssetId> kernelDeps,
      List<AssetId> sourceDeps,
      BuildStep buildStep,
      String outputExtension) async {
    final resolvedModules = await _resolveTransitiveModules(root, buildStep);
  
    final sourceOnly = await _parentsOfMissingKernelFiles(
        resolvedModules, buildStep, outputExtension);
  
    for (final module in resolvedModules) {
      if (sourceOnly.contains(module.primarySource)) {
        sourceDeps.addAll(module.sources);
      } else {
        kernelDeps.add(module.primarySource.changeExtension(outputExtension));
      }
    }
  }
  
  /// The transitive dependencies of [root], not including [root] itself.
  Future<List<Module>> _resolveTransitiveModules(
          Module root, BuildStep buildStep) =>
      crawlAsync<AssetId, Module>(
              [root.primarySource],
              (id) async => Module.fromJson(jsonDecode(
                      await buildStep.readAsString(
                          id.changeExtension(moduleExtension(root.platform))))
                  as Map<String, dynamic>),
              (id, module) => module.directDependencies)
          .skip(1) // Skip the root.
          .toList();
  
  /// Finds the primary source of all transitive parents of any module which does
  /// not have a readable kernel file.
  ///
  /// Inverts the direction of the graph and then crawls to all reachables nodes
  /// from the modules which do not have a readable kernel file
  Future<Set<AssetId>> _parentsOfMissingKernelFiles(
      List<Module> modules, BuildStep buildStep, String outputExtension) async {
    final sourceOnly = Set<AssetId>();
    final parents = <AssetId, Set<AssetId>>{};
    for (final module in modules) {
      for (final dep in module.directDependencies) {
        parents.putIfAbsent(dep, () => Set<AssetId>()).add(module.primarySource);
      }
      if (!await buildStep
          .canRead(module.primarySource.changeExtension(outputExtension))) {
        sourceOnly.add(module.primarySource);
      }
    }
    final toCrawl = Queue.of(sourceOnly);
    while (toCrawl.isNotEmpty) {
      final current = toCrawl.removeFirst();
      if (!parents.containsKey(current)) continue;
      for (final next in parents[current]) {
        if (!sourceOnly.add(next)) {
          toCrawl.add(next);
        }
      }
    }
    return sourceOnly;
  }
  
  /// Fills in all the required arguments for [request] in order to compile the
  