Skip to content

Implement support for PIP-style compat VCS URIs #5522

Open
@hvr

Description

@hvr

This ticket quickly summarises a feature enhancement @typedrat and I discussed for the current GSOC

Currently the VCS syntax in cabal.project files is rather clunky; but fortunately there's prior art we can steal from other ecosystems, specifically from Python's PIP VCS Support

The goal is to have the more compact syntax (which must be valid RFC 3986) as shown below in the non-exhaustive example

packages:
   git+https://github.com/well-typed/cborg@3d274c14ca3077c3a081ba7ad57c5182da65c8c1#subdir=cborg
   git+https://github.com/serokell/time-units.git@6c3747c1ac794f952de996dd7ba8a2f6d63bf132

be syntax sugar for the more verbose source-repository-package based specification

source-repository-package
    type: git
    location: https://github.com/well-typed/cborg
    tag: 3d274c14ca3077c3a081ba7ad57c5182da65c8c1
    subdir: cborg

source-repository-package
    type: git
    location: https://github.com/serokell/time-units.git
    tag: 6c3747c1ac794f952de996dd7ba8a2f6d63bf132

NB: entries in packages: must be able to disambiguate the following 4 categories

  • filepaths pointing to local package folders or .cabal files (e.g. ./mypkg/ or /foo/bar/doo.cabal or ./deps/*)
  • filepaths pointing to local package source-tarballs (e.g. ./deps/foo-1.2.3.tar.gz or deps/*.tar.gz)
  • remote HTTP(s) locations pointing to package source tarballs (e.g. https://hackage.haskell.org/package/stm-2.5.0.0/candidate/stm-2.5.0.0.tar.gz)
  • URIs denoting remote VCS locations (i.e. this ticket's scope; this is easy to disambiguate because we require valid RFC3986 syntax; and the uri scheme always contains a token to indicate the VCS-type, e.g. git)

(fwiw, should the need arise that the local-filepath interpretation may not be properly detected, one could use explicit file:/// uris to explicitly disambiguate and force interpretation as a local filepath)

This is a preliminary vague specifications; more details TBD

Follow-up stretch-goal: have new-install support vcs uris as well (TBD in separate ticket)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions