From c9c62fc3f63e2db21814a4bc1bc88b70ba7eed12 Mon Sep 17 00:00:00 2001 From: Rodrigo Mesquita Date: Tue, 16 Jan 2024 15:05:09 +0000 Subject: [PATCH] Include the compiler ABI hash in the package hash This complements the previous commit in order to fix #9326 --- cabal-install/src/Distribution/Client/PackageHash.hs | 7 ++++++- cabal-install/src/Distribution/Client/ProjectPlanning.hs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cabal-install/src/Distribution/Client/PackageHash.hs b/cabal-install/src/Distribution/Client/PackageHash.hs index 18be444cde7..f5387a37bd8 100644 --- a/cabal-install/src/Distribution/Client/PackageHash.hs +++ b/cabal-install/src/Distribution/Client/PackageHash.hs @@ -10,6 +10,8 @@ -- * the package tarball -- * the ids of all the direct dependencies -- * other local configuration (flags, profiling, etc) +-- +-- See 'PackageHashInputs' for a detailed list of what determines the hash. module Distribution.Client.PackageHash ( -- * Calculating package hashes PackageHashInputs (..) @@ -38,7 +40,8 @@ import Distribution.Package , mkComponentId ) import Distribution.Simple.Compiler - ( CompilerId + ( AbiTag (..) + , CompilerId , DebugInfoLevel (..) , OptimisationLevel (..) , PackageDB @@ -191,6 +194,7 @@ type PackageSourceHash = HashValue -- package hash. data PackageHashConfigInputs = PackageHashConfigInputs { pkgHashCompilerId :: CompilerId + , pkgHashCompilerABI :: AbiTag , pkgHashPlatform :: Platform , pkgHashFlagAssignment :: FlagAssignment -- complete not partial , pkgHashConfigureScriptArgs :: [String] -- just ./configure for build-type Configure @@ -301,6 +305,7 @@ renderPackageHashInputs pkgHashDirectDeps , -- and then all the config entry "compilerid" prettyShow pkgHashCompilerId + , entry "compilerabi" prettyShow pkgHashCompilerABI , entry "platform" prettyShow pkgHashPlatform , opt "flags" mempty showFlagAssignment pkgHashFlagAssignment , opt "configure-script" [] unwords pkgHashConfigureScriptArgs diff --git a/cabal-install/src/Distribution/Client/ProjectPlanning.hs b/cabal-install/src/Distribution/Client/ProjectPlanning.hs index 8048c009c74..9fe59b5d5de 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanning.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanning.hs @@ -4303,6 +4303,7 @@ packageHashConfigInputs packageHashConfigInputs shared@ElaboratedSharedConfig{..} pkg = PackageHashConfigInputs { pkgHashCompilerId = compilerId pkgConfigCompiler + , pkgHashCompilerABI = compilerAbiTag pkgConfigCompiler , pkgHashPlatform = pkgConfigPlatform , pkgHashFlagAssignment = elabFlagAssignment , pkgHashConfigureScriptArgs = elabConfigureScriptArgs