1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Merge pull request #2215 from github/avoid-recompiling-git

Prevent unnecessary recompilation of Semantic.Version in dev mode.
This commit is contained in:
Patrick Thomson 2018-10-19 17:05:22 -04:00 committed by GitHub
commit 3ae2ddf7be
2 changed files with 12 additions and 2 deletions

View File

@ -293,7 +293,7 @@ library
, StrictData
, TypeApplications
if flag(release)
ghc-options: -Wall -Werror -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -O1 -j
ghc-options: -Wall -Werror -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -O1 -j -DCOMPUTE_GIT_SHA
else
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -O0 -j +RTS -A128m -n2m -RTS
ghc-prof-options: -fprof-auto
@ -302,7 +302,7 @@ executable semantic
hs-source-dirs: app
main-is: Main.hs
if flag(release)
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O1 -j
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O1 -j -DCOMPUTE_GIT_SHA
else
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -A4m -n2m" -static -j -O0 -j
cc-options: -DU_STATIC_IMPLEMENTATION=1

View File

@ -1,17 +1,27 @@
{-# LANGUAGE CPP #-}
#ifdef COMPUTE_GIT_SHA
{-# OPTIONS_GHC -fforce-recomp #-} -- So that gitHash is correct.
{-# LANGUAGE TemplateHaskell #-}
#endif
module Semantic.Version
( buildSHA
, buildVersion
) where
import Data.Version (showVersion)
#ifdef COMPUTE_GIT_SHA
import Development.GitRev
#endif
import Paths_semantic (version)
-- The SHA1 hash of this build of semantic.
-- If compiled as a development build, this will be @<development>@.
buildSHA :: String
#ifdef COMPUTE_GIT_SHA
buildSHA = $(gitHash)
#else
buildSHA = "<development>"
#endif
-- The version string of this build of semantic.
buildVersion :: String