Skip to content

Commit 2fab932

Browse files
alt-romeserikd
authored andcommitted
Include the compiler ABI hash in the package hash
This complements the previous commit in order to fix haskell#9326
1 parent 21a850b commit 2fab932

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

Cabal/src/Distribution/Simple/GHC.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module Distribution.Simple.GHC
8282
import Distribution.Compat.Prelude
8383
import Prelude ()
8484

85-
import Control.Monad (forM_, msum)
85+
import Control.Monad (forM_)
8686
import Data.List (stripPrefix)
8787
import qualified Data.Map as Map
8888
import Distribution.CabalSpecVersion

cabal-install/src/Distribution/Client/PackageHash.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
-- * the package tarball
1111
-- * the ids of all the direct dependencies
1212
-- * other local configuration (flags, profiling, etc)
13+
--
14+
-- See 'PackageHashInputs' for a detailed list of what determines the hash.
1315
module Distribution.Client.PackageHash
1416
( -- * Calculating package hashes
1517
PackageHashInputs (..)
@@ -38,7 +40,8 @@ import Distribution.Package
3840
, mkComponentId
3941
)
4042
import Distribution.Simple.Compiler
41-
( CompilerId
43+
( AbiTag (..)
44+
, CompilerId
4245
, DebugInfoLevel (..)
4346
, OptimisationLevel (..)
4447
, PackageDB
@@ -191,6 +194,7 @@ type PackageSourceHash = HashValue
191194
-- package hash.
192195
data PackageHashConfigInputs = PackageHashConfigInputs
193196
{ pkgHashCompilerId :: CompilerId
197+
, pkgHashCompilerABI :: AbiTag
194198
, pkgHashPlatform :: Platform
195199
, pkgHashFlagAssignment :: FlagAssignment -- complete not partial
196200
, pkgHashConfigureScriptArgs :: [String] -- just ./configure for build-type Configure
@@ -301,6 +305,7 @@ renderPackageHashInputs
301305
pkgHashDirectDeps
302306
, -- and then all the config
303307
entry "compilerid" prettyShow pkgHashCompilerId
308+
, entry "compilerabi" prettyShow pkgHashCompilerABI
304309
, entry "platform" prettyShow pkgHashPlatform
305310
, opt "flags" mempty showFlagAssignment pkgHashFlagAssignment
306311
, opt "configure-script" [] unwords pkgHashConfigureScriptArgs

cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ import Distribution.Simple.BuildPaths (haddockDirName)
7171
import Distribution.Simple.Command (CommandUI)
7272
import Distribution.Simple.Compiler
7373
( PackageDBStack
74-
, compilerId
7574
)
7675
import qualified Distribution.Simple.InstallDirs as InstallDirs
7776
import Distribution.Simple.LocalBuildInfo

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4303,6 +4303,7 @@ packageHashConfigInputs
43034303
packageHashConfigInputs shared@ElaboratedSharedConfig{..} pkg =
43044304
PackageHashConfigInputs
43054305
{ pkgHashCompilerId = compilerId pkgConfigCompiler
4306+
, pkgHashCompilerABI = compilerAbiTag pkgConfigCompiler
43064307
, pkgHashPlatform = pkgConfigPlatform
43074308
, pkgHashFlagAssignment = elabFlagAssignment
43084309
, pkgHashConfigureScriptArgs = elabConfigureScriptArgs

cabal-testsuite/src/Test/Cabal/Monad.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import Test.Cabal.TestCode
6363
import Distribution.Pretty (prettyShow)
6464
import Distribution.Simple.Compiler
6565
( PackageDBStack, PackageDB(..), compilerFlavor
66-
, Compiler, compilerVersion, showCompilerId )
66+
, Compiler, compilerVersion, showCompilerIdWithAbi )
6767
import Distribution.System
6868
import Distribution.Simple.Program.Db
6969
import Distribution.Simple.Program
@@ -582,7 +582,7 @@ testLibInstallDir env = libDir </> compilerDir
582582
libDir = case os of
583583
Windows -> testPrefixDir env
584584
_ -> testPrefixDir env </> "lib"
585-
compilerDir = prettyShow platform ++ "-" ++ showCompilerId (testCompiler env)
585+
compilerDir = prettyShow platform ++ "-" ++ showCompilerIdWithAbi (testCompiler env)
586586

587587
-- | The absolute path to the build directory that should be used
588588
-- for the current package in a test.

cabal-testsuite/src/Test/Cabal/OutputNormalizer.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ normalizeOutput nenv =
5858
. (if normalizerGhcVersion nenv /= nullVersion
5959
then resub (posixRegexEscape (display (normalizerGhcVersion nenv))
6060
-- Also glob the date, for nightly GHC builds
61-
++ "(\\.[0-9]+)?")
61+
++ "(\\.[0-9]+)?"
62+
-- Also glob the ABI hash, for GHCs which support it
63+
++ "(-[a-z0-9]+)?")
6264
"<GHCVER>"
6365
else id)
6466
-- hackage-security locks occur non-deterministically

0 commit comments

Comments
 (0)