- If the package flags haven't changed, don't do initPackages (which might take multiple seconds in extreme cases)
- Provide a way to change the log_action without invalidating the summary cache.
I don't think the extraPkgConfs test is enough. If someone applies removeGlobalPkgConf we won't notice it if we run the function on the empty list. I guess the solution here is to get an actual data type (I never liked the function anyway.)
I also combed through Packages looking for fields of DynFlags and other data that is used during initialization, and I noticed the following:
There might be more that I missed. It might be safest if we carved out the parameters used by Packages initialization into their own type. Though, I know you're just trying to get an easy optimization going, and not into the yak shaving ;)
Wow. I didn't do anything about point (1), I don't think this is the right place to take into account environment files, and I'm not sure what you mean by "obvious that we failed to pick up a package environment file because of the caching mechanism".
Well, that's the problem, I don't really know how to do that; all I know is that I change my environment file and ask GHC to "reload its configuration", it would be surprising if it didn't get picked up...
Let's call that a separate problem, I don't think I've made it worse here. Arguably I've made it better because :set won't put you in an inconsistent state after you change your environment file.