diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-11-27 10:50:51 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-11-27 21:59:02 +0100 |
commit | 73e5e2f8bade2d8b2b1ecae958fe12d0b24591ef (patch) | |
tree | db399728d04c46d1e6d08c20863c9c2263c889a8 /compiler/ghc.mk | |
parent | 01f03cb30426fad1b848051fa142c04c8816a80c (diff) | |
download | haskell-73e5e2f8bade2d8b2b1ecae958fe12d0b24591ef.tar.gz |
Embed Git commit id into `ghc --info` output
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
Diffstat (limited to 'compiler/ghc.mk')
-rw-r--r-- | compiler/ghc.mk | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index ffa91a574a..2912aab102 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -67,6 +67,8 @@ compiler/stage%/build/Config.hs : mk/config.mk mk/project.mk | $$(dir $$@)/. @echo >> $@ @echo 'cProjectName :: String' >> $@ @echo 'cProjectName = "$(ProjectName)"' >> $@ + @echo 'cProjectGitCommitId :: String' >> $@ + @echo 'cProjectGitCommitId = "$(ProjectGitCommitId)"' >> $@ @echo 'cProjectVersion :: String' >> $@ @echo 'cProjectVersion = "$(ProjectVersion)"' >> $@ @echo 'cProjectVersionInt :: String' >> $@ |