No recompilation when using addDependentFile
or -fforce-recomp
in a build dependent package (stanza)
#9745
Labels
addDependentFile
or -fforce-recomp
in a build dependent package (stanza)
#9745
Describe the bug
Importing a library that is in the package's build-depends doesn't recompile when it should.
The following are the cases when recompilation should happen in a dependent package but it doesn't happen:
addDependentFile
and the file changes{-# OPTIONS_GHC -fforce-recomp #-}
The only workaround I have is either to do
cabal clean
and then compile again from scratch....Or modify one of the library source files.
To Reproduce
Steps to reproduce the behavior:
Create a new cabal project with 2 stanzas
Like the following:
The contents of the
Foo.hs
are the following:And the contents of the
Spec.hs
are the following:Now when I run
cabal test my-tests
for the first time everything necessary normally compiles along with the Foo.hs.And now when I run
cabal test my-tests
the second time, I expect theFoo.hs
to compile again, but it doesn't compile again even though it uses the-fforce-recomp
option.The similar example would be using the
addDependentFile
and the dependent file changes, it doesn't compile either.Expected behavior
When there's
{-# OPTIONS_GHC -fforce-recomp #-}
used in any of the dependent library source files, it should compile again every single time.Also, when there's
addDependentFile
used in the dependent library, it should also recompile when the dependent file changes.System information
OS:
x86-darwin
Cabal and GHC:
cabal-install version 3.6.2.0
The Glorious Glasgow Haskell Compilation System, version 8.10.7
Additional context
I believe this is a related issue - #4746
The text was updated successfully, but these errors were encountered: