[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding] Add reason for the special branch in `rankedHomeUnitDeps`
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding at Glasgow Haskell Compiler / GHC Commits: e2ffbc50 by Wolfgang Jeltsch at 2026-05-12T16:27:24+03:00 Add reason for the special branch in `rankedHomeUnitDeps` - - - - - 1 changed file: - compiler/GHC/Unit/Finder.hs Changes: ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -296,7 +296,18 @@ rankedHomeUnitDeps _ _ home_unit_deps | Set.null home_unit_deps = [] -- The special handling of the situation where the dependency set is empty does -- not change the result, but it avoids triggering evaluation of the module --- graph. +-- graph. This is particularly important in one-shot mode, where the module +-- graph is not needed. Computing it nevertheless would result in a, possibly +-- dramatic, increase of memory usage. Worse, GHC would erroneously look for the +-- sources of modules, which would, for example, cause test `boot1` to fail with +-- the following error message: +-- +-- B.hs:3:1: error: [GHC-87110] +-- Could not find module ‘A’. +-- Use -v to see a list of the files searched for. +-- | +-- 3 | import {-# source #-} A +-- | ^^^^^^^^^^^^^^^^^^^^^^^ rankedHomeUnitDeps home_module_name_providers_map mod_name home_unit_deps = Set.toList cached_deps ++ Set.toList uncached_deps where View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e2ffbc507f54a1fd64139e82d8d24ee5... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e2ffbc507f54a1fd64139e82d8d24ee5... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)