anchor.diff:  
         runHook postPatch
       '';
  +
  +    # Compute any cycles. Remove 'self' from the dependency closure.
  +    circularDepClosure = removeAttrs (cycles {} self) [self.name];
  +
  +    # Turn the closure into a list of all circular dependencies.
  +    circulars = attrValues circularDepClosure;
  +
  +    # All of the transitive dependencies (non-circular) of the
  +    # circular packages.
  +    transCircularDeps =
  +      foldl (a: b: a // b) {} (map (p: p.runtimeDependencies) circulars);
   
       configurePhase =
       let
  
positive.code:           ${concatMapStrings link (attrValues dep.peerDependencies)}
          '')) ++
        ["runHook postConfigure"] ++
        (optional (depClosure != {}) ''
          echo Circular dependencies:
          echo ${concatStringsSep " " (map (p: p.fullName) (attrValues depClosure))}
          exit 1
        '')
      );
  
      buildPhase = ''
        runHook preBuild
        (
          # NPM reads the `HOME` environment variable and fails if it doesn't
          # exist, so set it here.
  
negative.code:           fi
          fi
        '';
      in concatStringsSep "\n" (
        ["runHook preConfigure"] ++
        (flip map (attrValues requiredDependencies) (dep:
  