Plugins don't work with -fexternal-interpreter
Plugins don't work with -fexternal-interpreter.
The current plan to fix this is to enable GHC to always use the internal interpreter for plugins, even when `-fexternal-interpreter` is given. `-fexternal-interpreter` only determines which interpreter is used for running Template Haskell splices. The following tasks have been identified:
- [X] Support loading two different `UnitState` (available units): one for the target, one for plugins
- [ ] Add command-line flags (`-plugin-package-db`, etc.) to build the plugins UnitState
- [ ] Refactor many functions to explicitly pass Platform configuration (Platform, ways, etc.) as arguments. Currently we often pass `DynFlags` and callee functions implicitly use the `UnitState` of the target platform. It doesn't compose well and we want to be explicit about the platform we are using (target or host) (see also #17957).
- [x] Pretty-printing of `Unit` (via its `Outputable` instance) implicitly queries the `UnitState` of the target platform (via `sdocWithDynFlags`). We need to remove this `Outputable` instance.
issue