haskell / haskell/cabal

Optionally add the revison number to Paths_$pkgid.version

Open
#1,506 3 comments 0 reactions 0 assignees View on GitHub
old-milestone: cabal-install 2.0 priority: low re: installed-package-info type: enhancement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.