Skip to content

Commit dcf36d2

Browse files
committed
Include the compiler ABI hash in the package hash
This complements the previous commit in order to fix #9326
1 parent a0eec76 commit dcf36d2

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
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
@@ -4310,6 +4310,7 @@ packageHashConfigInputs
43104310
packageHashConfigInputs shared@ElaboratedSharedConfig{..} pkg =
43114311
PackageHashConfigInputs
43124312
{ pkgHashCompilerId = compilerId pkgConfigCompiler
4313+
, pkgHashCompilerABI = compilerAbiTag pkgConfigCompiler
43134314
, pkgHashPlatform = pkgConfigPlatform
43144315
, pkgHashFlagAssignment = elabFlagAssignment
43154316
, pkgHashConfigureScriptArgs = elabConfigureScriptArgs

0 commit comments

Comments
 (0)