anchor.diff:      }
     }
   
  -  compiler ??= new FrontendCompiler(
  -    output,
  -    printerFactory: binaryPrinterFactory,
  -  );
  +  compiler ??= new FrontendCompiler(output,
  +      printerFactory: binaryPrinterFactory,
  +      unsafePackageSerialization: options["unsafe-package-serialization"]);
   
     if (options.rest.isNotEmpty) {
       return await compiler.compile(options.rest[0], options,
  
positive.code: 
  class FrontendCompiler implements CompilerInterface {
    FrontendCompiler(this._outputStream,
        {this.printerFactory, this.transformer}) {
      _outputStream ??= stdout;
      printerFactory ??= new BinaryPrinterFactory();
    }
  
    StringSink _outputStream;
    BinaryPrinterFactory printerFactory;
  
    CompilerOptions _compilerOptions;
    Uri _mainSource;
  
negative.code:     _outputStream.writeln(boundaryKey);
    }
  
    /// Map of already serialized dill data. All uris in a serialized component
    /// maps to the same blob of data. Used by
    /// [writePackagesToSinkAndTrimComponent].
    Map<Uri, List<int>> cachedPackageLibraries = new Map<Uri, List<int>>();
  
    writePackagesToSinkAndTrimComponent(
        Component deltaProgram, Sink<List<int>> ioSink) {
      if (deltaProgram == null) return;
  
      List<Library> packageLibraries = new List<Library>();
      List<Library> libraries = new List<Library>();
      deltaProgram.computeCanonicalNames();
  
      for (var lib in deltaProgram.libraries) {
        Uri uri = lib.importUri;
        if (uri.scheme == "package") {
          packageLibraries.add(lib);
        } else {
          libraries.add(lib);
        }
      }
      deltaProgram.libraries
        ..clear()
        ..addAll(libraries);
  
      Map<String, List<Library>> newPackages = new Map<String, List<Library>>();
      Set<List<int>> alreadyAdded = new Set<List<int>>();
      for (Library lib in packageLibraries) {
        List<int> data = cachedPackageLibraries[lib.fileUri];
        if (data != null) {
          if (alreadyAdded.add(data)) {
            ioSink.add(data);
          }
        } else {
          String package = lib.importUri.pathSegments.first;
          newPackages[package] ??= <Library>[];
          newPackages[package].add(lib);
        }
      }
  
      for (String package in newPackages.keys) {
        List<Library> libraries = newPackages[package];
        Component singleLibrary = new Component(
            libraries: libraries,
            uriToSource: deltaProgram.uriToSource,
            nameRoot: deltaProgram.root);
        ByteSink byteSink = new ByteSink();
        final BinaryPrinter printer = printerFactory.newBinaryPrinter(byteSink);
        printer.writeComponentFile(singleLibrary);
        List<int> data = byteSink.builder.takeBytes();
        for (Library lib in libraries) {
          cachedPackageLibraries[lib.fileUri] = data;
        }
        ioSink.add(data);
      }
    }
  
    @override
    void acceptLastDelta() {
      _generator.accept();
  