add compiler info to `--version`
I'm not sure if this counts as a significant change or not, since it's possible scripts depend on the output. (The git info change doesn't really count, since it's only operable on unreleased versions.)
hilfy «cabal+more-version-info¤@a11e10471» Z$ $(cabal list-bin cabal) --version
Warning: this is a debug build of cabal-install with assertions enabled.
cabal-install version 3.17.0.0 (commit a11e104 on more-version-info, Thu Dec 11 16:57:14 2025 +0000)
compiled using version 3.17.0.0 of the Cabal library (commit de16351, Thu Nov 27 00:06:37 2025 +0000)
with ghc 9.10.3 on linux x86_64
The information added by this change is the last line. If a development GHC version is used to build cabal, the version will include a datestamp (e.g. 9.14.0.20251128).
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
- [x] The documentation has been updated, if necessary.
- [ ] 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!)
This is a proposed change, and open to review and suggestions.
Can you show how it'll look like in the description? Also, it'd be good to add some motivation. Remember that by default we expect a ticket before a PR.
The motivation was trying to get that information from someone on Discord who was having odd problems with cabal, and IIRC it turned out they were using a cross-built cabal.
I don't consider this final by any means; some programs have a --version-full option, for example, which includes this kind of information (and the GIT_REV stuff might also move there if we add it).
I moved that #if to a new Distribution.Client.Compat.SysInfo module.