Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore support for -package-db flags
'unsafeRunInterpreterWithArgs' is often used to specify the path to a non-default package database, using the @-package-db@ flag. Unfortunately, a previous refactoring accidentally broke this workflow. The refactoring seems innocent on the surface, so it's worth explaining how that refactoring managed to break anything. The refactoring defined a 'modifyLogger' shim corresponding to the ghc-9.2 function of the same name. In older versions of ghc, 'modifyLogger' is implemented using 'setSessionDynFlags'. As a result, it now matters whether the logger is configured before other calls to 'setSessionDynFlags'. In particular, the logger was configured too early, before the @-package-db@ flags were given to ghc using a second call to 'setSessionDynFlags'. As a result, the first call to 'setSessionDynFlags', the one hidden inside 'modifyLogger', was reading the default package databases and setting internal flag indicating that the package databases have been read. Then, the second call to 'setSessionDynFlags' which specifies non-default package databases with @-package-db@ flags, saw this internal flag and decided not to read the package databases a second time. fixes #142
- Loading branch information