Skip to content

Fix change detection with '-fobject-code' - #425

Open
alexfmpe wants to merge 1 commit into
ndmitchell:masterfrom
alexfmpe:fix-with-object-code
Open

alexfmpe wants to merge 1 commit into
ndmitchell:masterfrom
alexfmpe:fix-with-object-code

Conversation

@alexfmpe

Copy link
Copy Markdown
Contributor

When '-fobject-code' is enabled, ghci will cache compilation across runs so we only see "[X of Y] Compiling ..." messages for modules that were modified (or had their deps be) since the last run. When all (or none) modules are cached, ghcid works as usual, but when only some are, only the modules triggering messages are watched. Once one of those is modified, then 'sessionReload' kicks in and all ':show modules' are watched again, so we adopt that source of file paths in 'sessionStart'.

When '-fobject-code' is enabled, ghci will cache compilation across runs
so we only see "[X of Y] Compiling ..." messages for modules that were
modified (or had their deps be) since the last run.
When all (or none) modules are cached, ghcid works as usual, but when only
some are, only the modules triggering messages are watched. Once one of
those is modified, then 'sessionReload' kicks in and all ':show modules'
are watched again, so we adopt that source of file paths in 'sessionStart'.
Comment thread app/Session.hs
loaded <- do
Just ghci <- readIORef ghci
shownModules <- showModules ghci
pure $ nubOrd $ loadedModules dir messages <> map ((dir </>) . snd) shownModules

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally simply replaced loadedModules with shownModules as the source but that broke the Cd basic test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant