Ben Gamari pushed to branch ghc-9.14 at Glasgow Haskell Compiler / GHC Commits: 02150b65 by Alison at 2025-10-28T15:02:30-04:00 ghc-heap: Fix race condition with profiling builds Apply the same fix from Closures.hs (64fd0fac83) to Heap.hs by adding empty imports to make way-dependent dependencies visible to `ghc -M`. Fixes #15197, #26407 (cherry picked from commit 99b233f45064ec8a10df28cd53ed70ce62e85a1e) - - - - - 1 changed file: - libraries/ghc-heap/GHC/Exts/Heap.hs Changes: ===================================== libraries/ghc-heap/GHC/Exts/Heap.hs ===================================== @@ -67,10 +67,26 @@ import GHC.Exts.Heap.ClosureTypes import GHC.Exts.Heap.Constants import GHC.Exts.Heap.ProfInfo.Types #if defined(PROFILING) +import GHC.Exts.Heap.InfoTable () -- See Note [No way-dependent imports] import GHC.Exts.Heap.InfoTableProf #else import GHC.Exts.Heap.InfoTable +import GHC.Exts.Heap.InfoTableProf () -- See Note [No way-dependent imports] + +{- +Note [No way-dependent imports] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`ghc -M` currently assumes that the imports for a module are the same +in every way. This is arguably a bug, but breaking this assumption by +importing different things in different ways can cause trouble. For +example, this module in the profiling way imports and uses +GHC.Exts.Heap.InfoTableProf. When it was not also imported in the +vanilla way, there were intermittent build failures due to this module +being compiled in the profiling way before GHC.Exts.Heap.InfoTableProf +in the profiling way. (#15197) +-} #endif + import GHC.Exts.Heap.Utils import qualified GHC.Exts.Heap.FFIClosures as FFIClosures import qualified GHC.Exts.Heap.ProfInfo.PeekProfInfo as PPI View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/02150b65487cb675480ed8697c956f5b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/02150b65487cb675480ed8697c956f5b... You're receiving this email because of your account on gitlab.haskell.org.