Problem
mkAndroidLib compiles consumer source files without -fexternal-interpreter, which means Template Haskell splices in the consumer's own code fail with:
<no location info>: error:
Couldn't find a target code interpreter. Try with -fexternal-interpreter
TH works fine in dependency packages (built via cross-deps.nix) because those go through the full iserv-proxy setup. But the final GHC invocation in mkAndroidLib (lib.nix line ~311) doesn't include the TH flags.
Context
Discovered while migrating prrrrrrrrr from sqlite-simple to persistent + persistent-sqlite. Persistent uses TH (mkPersist, mkMigrate, persistLowerCase) to generate entity types and migrations.
Current workaround
Split TH code into a separate sub-package (prrrrrrrrr-schema) that gets built as a cross-dep, where TH works. The main consumer code then imports the TH-generated types without needing TH itself. This works but adds structural complexity.
Suggested fix
Pass -fexternal-interpreter -pgmi <iserv-wrapper-path> to the GHC invocation in mkAndroidLib, reusing the same iserv-proxy infrastructure from cross-deps.nix. Alternatively, expose an extraGhcFlags parameter so consumers can opt in.
Problem
mkAndroidLibcompiles consumer source files without-fexternal-interpreter, which means Template Haskell splices in the consumer's own code fail with:TH works fine in dependency packages (built via
cross-deps.nix) because those go through the full iserv-proxy setup. But the final GHC invocation inmkAndroidLib(lib.nix line ~311) doesn't include the TH flags.Context
Discovered while migrating prrrrrrrrr from
sqlite-simpletopersistent+persistent-sqlite. Persistent uses TH (mkPersist,mkMigrate,persistLowerCase) to generate entity types and migrations.Current workaround
Split TH code into a separate sub-package (
prrrrrrrrr-schema) that gets built as a cross-dep, where TH works. The main consumer code then imports the TH-generated types without needing TH itself. This works but adds structural complexity.Suggested fix
Pass
-fexternal-interpreter -pgmi <iserv-wrapper-path>to the GHC invocation inmkAndroidLib, reusing the same iserv-proxy infrastructure fromcross-deps.nix. Alternatively, expose anextraGhcFlagsparameter so consumers can opt in.