GHCi does not always detect when modules become stale during compilation
Here is a conceived example that illustrates the issue.
File `Foo.hs` is changed after it's content has been read in the Haskell pre-processor phase.
{{{
\#!/bin/bash
\#
\# file preprocess.sh
\#
cat $2 \> $3
sleep 1
touch $1
}}}
```
-- file Foo.hs
{-# OPTIONS_GHC -F -pgmF ./preprocess.sh #-}
module Foo where
```
```
$ ghci Foo.hs
*Foo> :reload
```
Expected result: Foo.hs is recompiled on :reload
Actual result: Nothing is recompiled on :reload
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | GHCi |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHCi does not always detect when modules become stale during compilation","status":"New","operating_system":"","component":"GHCi","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.4.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Here is a conceived example that illustrates the issue.\r\n\r\nFile {{{Foo.hs}}} is changed after it's content has been read in the Haskell pre-processor phase.\r\n\r\n{{{\r\n#!/bin/bash\r\n#\r\n# file preprocess.sh\r\n#\r\ncat $2 > $3\r\nsleep 1\r\ntouch $1\r\n}}}\r\n\r\n{{{\r\n-- file Foo.hs\r\n{-# OPTIONS_GHC -F -pgmF ./preprocess.sh #-}\r\nmodule Foo where\r\n}}}\r\n\r\n{{{\r\n$ ghci Foo.hs\r\n*Foo> :reload\r\n}}}\r\n\r\nExpected result: Foo.hs is recompiled on :reload\r\n\r\nActual result: Nothing is recompiled on :reload","type_of_failure":"OtherFailure","blocking":[]} -->
issue