GHCi ignores -fforce-recomp on first :reload when used with custom preprocessor
Steps to reproduce:
#!/bin/bash
# file preprocess.sh
echo "main = putStrLn \"`date -u`\"" > "$3"
echo "Reloaded!"
-- file Main.hs
{-# OPTIONS_GHC -fforce-recomp -F -pgmF preprocess.sh #-}
$ chmod +x preprocess.sh
$ PATH=.:$PATH ghci Main.hs -v0
Reloaded!
*Main> main
Thu Jun 15 04:15:26 UTC 2017
*Main> :reload
*Main> main
Thu Jun 15 04:15:26 UTC 2017
*Main> :reload
Reloaded!
*Main> main
Thu Jun 15 04:15:35 UTC 2017
As is evident from the output above, the first :reload
got lost; preprocessor.sh
is not executed at all. The second :reload
works as expected.