Interface files contents depends on order of compiling modules
I noticed that the order --make
mode (hence -j) mode compiles modules affects what dependencies end up in interface files.
The issue is that mk_mod_usage
gets passed modules [Prelude, System.Directory, System.FilePath, System.FilePath.Posix]
but then it checks to see whether we have actually loaded interface files for these modules. Compiling Distribution.Compat.FilePath
doesn't actually need to load System.FilePath.Posix
so the check fails and the dependency is not added, but if another module has loaded it before and then the interface file is there and the dependency is added.
The solution is probably to be more precise about which modules we're trying to add dependencies for, and panic if the module we depend on is not loaded.