You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.
In haskell-ide-engine, and HaRe, we make use of runGmltWith.
The usage requires a GHC hscFrontendHook to store the GHC ASTs as the targets are loaded.
Since this usage is driven by IDE usage, we have no control of when a file will be loaded. As the GHC session is cached in ghc-mod, this means that calling runGmltWith with a specific target file name will call GHC loadTargets for it, but this may not result in actual compilation as the GHC session already has it, and the GHC recompilation checker will not allow re-loading.
So, we need to be able to adjust the DynFlags for the listed target modules to have
Set Opt_ForceRecomp to force a recompile despite the source not being newer
Set the hscFrontendHook
In the GHC API compilation process, this can be done after GHC.depanal which returns the ModuleGraph, where each component ModSummary has the DynFlags that will be used to load the module, but before calling GHC.load
After GHC.load the Opt_ForceRecomp should be unset, lest it results in unneeded recompilation in other loads.
From an API perspective, the question is how this requirement should be specified.
There are currently two alternatives
Pass an additional parameter of the form Maybe (GHC.hook -> GHC.hook), which if set signals that the ModSummarys should be adjusted as above. This is currently implemented in the tweak-mod-summary branch.
As proposed by @DanielG, amend the target list parameter, currently [Either FilePath ModuleName] to include a pair of functions for updating the DynFlags and the Hooks, so that future ModSummary and Hook requirements can also be met.
Note: in the current https://github.com/alanz/ghc-mod/tree/target-tweak-modsummary branch, implementing option 1 of the alternatives, there is an issue wrt to setting Interactive mode, in which case the individual modsummary tweaks do not seem to take effect. This would have to be sorted out to make option 2 viable.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In
haskell-ide-engine
, andHaRe
, we make use of runGmltWith.The usage requires a GHC
hscFrontendHook
to store the GHC ASTs as the targets are loaded.Since this usage is driven by IDE usage, we have no control of when a file will be loaded. As the GHC session is cached in ghc-mod, this means that calling
runGmltWith
with a specific target file name will call GHCloadTargets
for it, but this may not result in actual compilation as the GHC session already has it, and the GHC recompilation checker will not allow re-loading.So, we need to be able to adjust the
DynFlags
for the listed target modules to haveOpt_ForceRecomp
to force a recompile despite the source not being newerhscFrontendHook
In the GHC API compilation process, this can be done after
GHC.depanal
which returns theModuleGraph
, where each componentModSummary
has theDynFlags
that will be used to load the module, but before callingGHC.load
After
GHC.load
theOpt_ForceRecomp
should be unset, lest it results in unneeded recompilation in other loads.From an API perspective, the question is how this requirement should be specified.
There are currently two alternatives
Pass an additional parameter of the form
Maybe (GHC.hook -> GHC.hook)
, which if set signals that theModSummary
s should be adjusted as above. This is currently implemented in the tweak-mod-summary branch.As proposed by @DanielG, amend the target list parameter, currently
[Either FilePath ModuleName]
to include a pair of functions for updating theDynFlags
and theHooks
, so that futureModSummary
andHook
requirements can also be met.Note: in the current https://github.com/alanz/ghc-mod/tree/target-tweak-modsummary branch, implementing option 1 of the alternatives, there is an issue wrt to setting Interactive mode, in which case the individual modsummary tweaks do not seem to take effect. This would have to be sorted out to make option 2 viable.
The text was updated successfully, but these errors were encountered: