From 4e8733632a52d386ab4893af31d87e350a0c657c Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" <ezyang@cs.stanford.edu> Date: Fri, 9 Oct 2015 10:26:08 -0700 Subject: [PATCH] Make sure the hash is pre-package unique, fixes #2857. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> --- Cabal/Distribution/Simple/Configure.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index ed69d000c0..5e216d5129 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -1317,7 +1317,11 @@ computeComponentId pkg_descr cname dep_ipids flagAssignment = do -- doubly concating list, as it just flatten out the nested list, so -- different sources can produce same hash let hash = hashToBase62 $ - (show $ dep_ipids) + -- For safety, include the package + version here + -- for GHC 7.10, where just the hash is used as + -- the package key + (display (package pkg_descr)) + ++ (show $ dep_ipids) ++ show flagAssignment return . ComponentId $ display (package pkg_descr) -- GitLab