What I learned there is that cabal repl --ghc-options works exactly the first time after cabal build; in subsequent calls the --ghc-options of the first call are used, added or deleted options are ignored.
Needless to say, I find such behavior outright harmful. I felt positively jinxed.
I think if cabal repl does not handle --ghc-options in the expected way (but some erratic seemingly arbitrary way), it should rather error out than fool around with the user.
Totally agree. There's a larger problem though: there's next to no precedent for checking consistency of flags in cabal. We should slowly start doing this somehow from scratch...
The doc says that you should use
--repl-options
instead of--ghc-options
: https://github.com/haskell/cabal/blob/f53087850d5db27f86fe622d1ff28cd5ab082766/doc/cabal-commands.rst?plain=1#L798-L803 I found out about this by chasing erratic behavior ofcabal repl --ghc-options
for many hours, see:What I learned there is that
cabal repl --ghc-options
works exactly the first time aftercabal build
; in subsequent calls the--ghc-options
of the first call are used, added or deleted options are ignored. Needless to say, I find such behavior outright harmful. I felt positively jinxed.I think if
cabal repl
does not handle--ghc-options
in the expected way (but some erratic seemingly arbitrary way), it should rather error out than fool around with the user.What do you say?