diff --git a/cabal-install/src/Distribution/Client/ProjectPlanning.hs b/cabal-install/src/Distribution/Client/ProjectPlanning.hs index 4bc488ba405..34af3d491a9 100644 --- a/cabal-install/src/Distribution/Client/ProjectPlanning.hs +++ b/cabal-install/src/Distribution/Client/ProjectPlanning.hs @@ -989,6 +989,9 @@ programsMonitorFiles progdb = monitorFileSearchPath (programMonitorFiles prog) (programPath prog) + ++ if programId prog == "ghc" && buildOS == Windows + then [monitorFile $ programPath prog -<.> "shim"] + else [] ] -- | Select the bits of a 'ProgramDb' to monitor for value changes. diff --git a/changelog.d/pr-10853 b/changelog.d/pr-10853 new file mode 100644 index 00000000000..4d389794198 --- /dev/null +++ b/changelog.d/pr-10853 @@ -0,0 +1,13 @@ +synopsis: Monitor `ghc.shim` on Windows +packages: cabal-install +prs: #10853 +issues: #10850 + +description: { + +- On Linux it is the `ghc` executable that changes when changing compiler + version in GHCup (the symlink points to a new location) but on Windows it is + the companion `ghc.shim` file that changes. This file is now also monitored + for changes to trigger rebuilds. + +}