[Git][ghc/ghc][wip/haanss/depdir] sort fingerprints before combining them to make getDirHash more robust

Hassan Al-Awwadi pushed to branch wip/haanss/depdir at Glasgow Haskell Compiler / GHC Commits: 48faafcd by Hassan Al-Awwadi at 2025-07-07T11:33:23+02:00 sort fingerprints before combining them to make getDirHash more robust - - - - - 2 changed files: - compiler/GHC/Unit/Finder.hs - testsuite/tests/interface-stability/template-haskell-exports.stdout Changes: ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -71,6 +71,7 @@ import qualified Data.Map as M import GHC.Driver.Env import GHC.Driver.Config.Finder import qualified Data.Set as Set +import qualified Data.List as L(sort) import Data.List.NonEmpty ( NonEmpty (..) ) import qualified System.Directory as SD import qualified System.OsPath as OsPath @@ -161,8 +162,9 @@ getDirHash dir = do contents <- SD.listDirectory dir -- The documentation of Fingerprints describes this as an easy naive implementation -- I wonder if we should do something more sophisticated here? - let hashes = fingerprintString <$> contents - let hash = fingerprintFingerprints hashes + let hashes = fingerprintString <$> contents + let s_hashes = L.sort hashes + let hash = fingerprintFingerprints s_hashes return hash -- ----------------------------------------------------------------------------- ===================================== testsuite/tests/interface-stability/template-haskell-exports.stdout ===================================== @@ -1780,8 +1780,8 @@ module Language.Haskell.TH.Syntax where type VarStrictType :: * type VarStrictType = VarBangType addCorePlugin :: GHC.Internal.Base.String -> Q () - addDependentFile :: GHC.Internal.IO.FilePath -> Q () addDependentDirectory :: GHC.Internal.IO.FilePath -> Q () + addDependentFile :: GHC.Internal.IO.FilePath -> Q () addForeignFile :: ForeignSrcLang -> GHC.Internal.Base.String -> Q () addForeignFilePath :: ForeignSrcLang -> GHC.Internal.IO.FilePath -> Q () addForeignSource :: ForeignSrcLang -> GHC.Internal.Base.String -> Q () View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/48faafcd586daa8bcd606ea4edd4ab07... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/48faafcd586daa8bcd606ea4edd4ab07... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Hassan Al-Awwadi (@hassan.awwadi)