Optionally add the revison number to Paths_$pkgid.version
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
It'd be nice if `cabal build` could automatically add the revision number for the appropriate SCM to the `versionTags` field of `Paths_$pkgid.version`. I envision the following usage scenario:
```
$ cabal configure --revision-number # or --build-id, or whatever
$ cabal run -- --version
1.0-0a4f3c6g
$ cabal configure
$ cabal run -- --version
1.0
```
For extracting the revision number from a working copy there is the [vcs-revision](http://hackage.haskell.org/package/vcs-revision) package on Hackage (only SVN, Git and Mercurial support ATM).
Contributor guide
Research direction
Start by tracing how cabal configure and cabal build generate Paths_$pkgid.version and populate its versionTags field. Review the vcs-revision package and its supported SCMs, then define the opt-in behavior described in the issue: include a revision in --version when requested, while the default remains 1.0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100