cabal icon indicating copy to clipboard operation
cabal copied to clipboard

add compiler info to `--version`

Open geekosaur opened this issue 1 week ago • 4 comments

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.
  • [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!)

geekosaur avatar Dec 11 '25 20:12 geekosaur

This is a proposed change, and open to review and suggestions.

geekosaur avatar Dec 11 '25 21:12 geekosaur

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.

ulysses4ever avatar Dec 12 '25 12:12 ulysses4ever

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).

geekosaur avatar Dec 12 '25 15:12 geekosaur

I moved that #if to a new Distribution.Client.Compat.SysInfo module.

geekosaur avatar Dec 12 '25 23:12 geekosaur