• Edsko de Vries's avatar
    Introduce RepoContext · ba5c55c4
    Edsko de Vries authored
    The RepoContext encapsulates the list of repositories, as well as some
    associated state. In particular, it also encapsulates the HttpTransport, which
    will be initialized on demand and cached thereafter.  This is important for two
    reasons:
    
    * For the hackage-security integration: in order to be able to use cabal's own
      HttpTransport API for the secure repo, we need to have access to that
      transport when we initialize the repo, but as things stood that was not
      possible (cabal was initializing repos ahead of time but the transport on
      demand).
    
    * For the integration with the nix-local-branch it is important that the Repo
      type remains Serializable. By passing RepoContext rather than a list of
      Repos, we can leave RepoSecure serializable and separately maintain a mapping
      from cabal's Repo type to hackage-security's (stateful) Repository type.
    ba5c55c4