Skip to content
  • Herbert Valerio Riedel's avatar
    Embed Git commit id into `ghc --info` output · 73e5e2f8
    Herbert Valerio Riedel authored
    Since we switched to a Git submodule based GHC Git repo, `ghc.git`'s
    commit id uniquely identifies the state of the GHC source-tree. So
    having that information embedded into the `ghc` executable provides
    valuable information to track accurately (especially when created by
    buildbots) from which source-tree-state a given `ghc` snapshot
    (distribution) was generated.
    
    So this commit adds a new field `"Project Git commit id"` to the
    `ghc --info` meta-data containing the `./configure`-time Git commit id
    as reported by `git rev-parse HEAD`.
    
    This field can also be queried with `ghc --print-project-git-commit-id`.
    
    For source distributions, the file `GIT_COMMIT_ID` is created (with some
    sanity checking to detect stale commit ids, as that would render this
    information rather useless)
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D528
    73e5e2f8