You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is really a cabal issue or a ghci issue, so apologies if it's not a cabal issue.
Using a cabal sandbox, if ~/.ghci contains :set -fobject-code, then both cabal repl and cabal compile haskell sources into .o files located in the same place e.g. dist/build/Package/Module.o. However, despite sharing the file locations, they do not appear to link/load objects built by the other process. Instead, switching from one to the other results in recompiling all the .o files, even if the source file hasn't changed and doesn't depend on a file that has changed.
Just using cabal repl will only recompile the modules affected by changes if you do e.g. :r.
Just using cabal build will likewise only recompile as necessary.
However, switching from one to the other will recompile all modules.
I came across this issue because I was trying to use cabal repl for experimentation as I wrote my code, and cabal run (which effectively performs a cabal build) to run my application.
Disabling -fobject-code in ghci is possible as a workaround, but it's not ideal.