fix some backward compatibility bugs in `GIT_REV`
It was incorrectly displaying (in-tree) when there was no git information. Also, the spacing was slightly incompatible with older versions.
This should restore 100% compatibility with older versions of cabal-install, for scripts that parse cabal --version output.
Template Ξ: This PR modifies behaviour or interface
Include the following checklist in your PR:
- [x] Patches conform to the coding conventions.
- [ ] Any changes that could be relevant to users have been recorded in the changelog.
- [ ] Is the change significant? If so, remember to add
significance: significantin the changelog file.
- [ ] Is the change significant? If so, remember to add
- [ ] The documentation has been updated, if necessary.
- [x] Manual QA notes have been included.
- [ ] Tests have been added. (Ask for help if you donβt know how to write them! Ask for an exemption if tests are too complex for too little coverage!)
QA notes:
Build cabal for release (cabal --project-file=cabal.release.project build cabal).
Run the following: (assumes you have cabal-3.14.2.0 and cabal-3.16.0.0 installed via e.g. ghcup)
hilfy Z$ cabal-3.14.2.0 --version | sed 's/$/~/'
cabal-install version 3.14.2.0~
compiled using version 3.14.2.0 of the Cabal library ~
hilfy Z$ cabal-3.16.0.0 --version | sed 's/$/~/'
cabal-install version 3.16.0.0 ~
compiled using version 3.16.0.0 of the Cabal library (in-tree)~
hilfy Z$ $(cabal list-bin cabal) --version | sed 's/$/~/'
cabal-install version 3.17.0.0~
compiled using version 3.17.0.0 of the Cabal library ~
3.14.2.0 is the original output. (I assume the extra space crept in when the Cabal library version was added.)
3.16.0.0 is the buggy output.
The final one is the fixed output; it should match 3.14.2.0 aside from the reported versions, in particular in the final spaces. Note that 3.16.0.0 has both (in-tree) and an extra space at the end of the first line.
Merge Queue Status
β The pull request has been merged at 519432fcab8c0892f80efa46160114129c49eadd
This pull request spent 2 hours 16 minutes 30 seconds in the queue, including 2 hours 5 minutes 58 seconds running CI. The checks were run on draft #11359.
Required conditions to merge
#approved-reviews-by >= 2[π‘ GitHub branch protection]- [X] #11342
#changes-requested-reviews-by = 0[π‘ GitHub branch protection]- [X] #11342
#review-threads-unresolved = 0[π‘ GitHub branch protection]- [X] #11342
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = Doctest Cabal - [ ]
check-neutral = Doctest Cabal - [ ]
check-skipped = Doctest Cabal
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = Meta checks - [ ]
check-neutral = Meta checks - [ ]
check-skipped = Meta checks
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = docs/readthedocs.org:cabal - [ ]
check-neutral = docs/readthedocs.org:cabal - [ ]
check-skipped = docs/readthedocs.org:cabal
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = Validate post job - [ ]
check-neutral = Validate post job - [ ]
check-skipped = Validate post job
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = fourmolu - [ ]
check-neutral = fourmolu - [ ]
check-skipped = fourmolu
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = hlint - [ ]
check-neutral = hlint - [ ]
check-skipped = hlint
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = Bootstrap post job - [ ]
check-neutral = Bootstrap post job - [ ]
check-skipped = Bootstrap post job
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = whitespace - [ ]
check-neutral = whitespace - [ ]
check-skipped = whitespace
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = Check sdist post job - [ ]
check-neutral = Check sdist post job - [ ]
check-skipped = Check sdist post job
- [X]
- [X] any of [π‘ GitHub branch protection]:
- [X]
check-success = Changelogs - [ ]
check-neutral = Changelogs - [ ]
check-skipped = Changelogs
- [X]
A bit belatedly, this is WRT https://github.com/haskell/cabal/issues/11340#issuecomment-3647017147.