haskell / haskell/cabal

Optionally include VCS metadata when doing `cabal sdist`

Open
#8,750 3 comments 0 reactions 0 assignees View on GitHub
Cabal: cmd/sdist type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Suppose you are using the package `foo-X`, and you think you have found a bug in it. At this point you typically want to go to the source of `foo-X` and have a look. There is `cabal get` which will get you the source, but often you'd rather have the actual _repository_ at the corresponding commit. But there's no easy way to go from a cabal package to the repository+commit that it was built from. In practice the process is something like: go to Hackage, find the link to the repo, go to the repo, hope they tag their releases... which some people don't.

That seems perfectly reasonable: a cabal package is just built from a source distribution, which doesn't include that information. But we could potentially include the revision as optional metadata when we _build_ the source distribution. That would allow downstream tools to get it out if they needed to. For example, for repositories hosted on Github, Hackage could provide a link to the exact commit.

I'm not sure what the right way to do this would be, perhaps by writing an `x-git-rev` field into the cabal file when sdisting?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.