haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 691 forks source link

Should `cabal repl` error out on `--ghc-options`? #8638

Open andreasabel opened 1 year ago

andreasabel commented 1 year ago

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 of cabal repl --ghc-options for many hours, see:

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.

What do you say?

ulysses4ever commented 1 year ago

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...