There are two sorts of auto-generated files

Stefan Klinger cabal at stefan-klinger.de
Sun Jul 18 14:46:56 UTC 2021


Hi,

I, too, ran into the requirement to have a compiled Haskell binary
print the Git hash it was derived from.  There's a package for that
(gitrev), which does not work to my satisfaction.

Investigation led me to a wider concept.  I now think that Cabal
should discern two sorts of generated files:

 1. Early generated files, that are not stored in the source
    repository but have to be present in a source distribution created
    by `cabal sdist`.

 2. Late generated files, that are also not in the source distribution
    but are created during compilation.

If that was possible, then the git hash problem would reduce to a
special case of the first sort.  (if it already is, where would I find
it documented?)

I've elaborated on this a bit, and provide my current attempt to
include a git hash into a binary at

    https://github.com/s5k6/versionInfo

which demonstrates the current issues when trying so implement such an
approach using current Cabal.  It also demonstrates the issue of the
current auto-generated `Paths_…` module depending on the `base`
package.

What do you think?

Cheers
Stefan


--
Stefan Klinger, Ph.D. -- computer scientist              o/X
http://stefan-klinger.de                                 /\/
https://github.com/s5k6                                    \
I prefer receiving plain text messages, not exceeding 32kB.


More information about the cabal-devel mailing list