anchor.diff:    }
   }
   
  -File precompileSnippetsTool() {
  +Future<File> precompileSnippetsTool(
  +  String pubExecutable,
  +  Map<String, String> pubEnvironment,
  +) async {
     final File snapshotPath = File(path.join('bin', 'cache', 'snippets.snapshot'));
     print('Precompiling snippets tool into ${snapshotPath.absolute.path}');
     if (snapshotPath.existsSync()) {
       snapshotPath.deleteSync();
     }
  +
  +  final ProcessWrapper process = ProcessWrapper(await Process.start(
  +    pubExecutable,
  +    <String>['get'],
  +    workingDirectory: kSnippetsRoot,
  +    environment: pubEnvironment,
  +  ));
  +  printStream(process.stdout, prefix: 'pub:stdout: ');
  +  printStream(process.stderr, prefix: 'pub:stderr: ');
  +  final int code = await process.done;
  +  if (code != 0)
  +    exit(code);
  +
     // In order to be able to optimize properly, we need to provide a training set
     // of arguments, and an input file to process.
     final Directory tempDir = Directory.systemTemp.createTempSync('dartdoc_snippet_');
     final File trainingFile = File(path.join(tempDir.path, 'snippet_training'));
     trainingFile.writeAsStringSync('```dart\nvoid foo(){}\n```');
  -  Process.runSync(Platform.resolvedExecutable, <String>[
  -    '--snapshot=${snapshotPath.absolute.path}',
  -    '--snapshot_kind=app-jit',
  -    path.join(
  -      'dev',
  -      'snippets',
  -      'lib',
  -      'main.dart',
  -    ),
  -    '--type=sample',
  -    '--input=${trainingFile.absolute.path}',
  -    '--output=${path.join(tempDir.absolute.path, 'training_output.txt')}',
  -  ]);
  +  try {
  +    final ProcessResult result = Process.runSync(Platform.resolvedExecutable, <String>[
  +      '--snapshot=${snapshotPath.absolute.path}',
  +      '--snapshot_kind=app-jit',
  +      path.join(
  +        'lib',
  +        'main.dart',
  +      ),
  +      '--type=sample',
  +      '--input=${trainingFile.absolute.path}',
  +      '--output=${path.join(tempDir.absolute.path, 'training_output.txt')}',
  +    ], workingDirectory: path.absolute(kSnippetsRoot));
  +    if (result.exitCode != 0) {
  +      stdout.writeln(result.stdout);
  +      stderr.writeln(result.stderr);
  +      throw Exception('Could not generate snippets snapshot: process exited with code ${result.exitCode}');
  +    }
  +  } on ProcessException catch (error) {
  +    throw Exception('Could not generate snippets snapshot:\n$error');
  +  }
     tempDir.deleteSync(recursive: true);
     return snapshotPath;
   }
  
positive.code:       RegExp(r'^ warning: .+: \(.+/\.pub-cache/hosted/pub.dartlang.org/.+\)'), // packages outside our control
      ],
    );
    final int exitCode = await process.exitCode;
  
    if (exitCode != 0)
      exit(exitCode);
  
negative.code:       'package:web_socket_channel/html.dart',
      ].join(','),
      '--favicon=favicon.ico',
      '--package-order', 'flutter,Dart,platform_integration,flutter_test,flutter_driver',
      '--auto-include-dependencies',
    ]);
  
    String quote(String arg) => arg.contains(' ') ? "'$arg'" : arg;
    print('Executing: (cd $kDocsRoot ; $pubExecutable ${dartdocArgs.map<String>(quote).join(' ')})');
  
    process = ProcessWrapper(await Process.start(
      pubExecutable,
      dartdocArgs,
      workingDirectory: kDocsRoot,
      environment: pubEnvironment,
    ));
    printStream(process.stdout, prefix: args['json'] ? '' : 'dartdoc:stdout: ',
      filter: args['verbose'] ? const <Pattern>[] : <Pattern>[
        RegExp(r'^generating docs for library '), // unnecessary verbosity
  