Open Soupstraw opened 2 years ago
Thank you for the report. Does it ever work? I suppose ghci
works fine? Does cabal repl
do what it should in any circumstance? In older versions of cabal? With special options? Not under Nix? On Windows? With newer GHC?
I've tested (different repository which doesn't use haskell.nix) with
cabal
3.10.1.0ghc
9.4.6and it works, both ./.ghci
and ~/.ghc/ghci.conf
are loaded. I think this can be safely closed.
I can add some insight here:
For multi-package projects, cabal repl
will indeed ignore the project .ghci
file when run at the project level. My work around was to push the .ghci
file into the package directory I was working with, and then it worked.
I expect cabal repl
to check the current directory for a .ghci
because that's what the documentation says. This is a valid bug that should be reopened.
If I run bare ghci
from a project directory, it's also not read. Which makes it ghc's bug that we can't do anything about.
If I run bare
ghci
from a project directory, it's also not read. Which makes it ghc's bug that we can't do anything about.
I cannot confirm this.
My use case is that I want to run cabal repl -b foo,bar,baz
in an empty directory with just a .ghci
file to do some exercises from a book I'm reading. I don't need a project or package. The .ghci
file is ignored. ghci
does correctly read it.
There are workarounds, but it's bad UX.
Describe the bug
cabal repl
ignores the.ghci
file in the project directory. I also tried to put the.ghci
file into my home directory, passing a.ghci
file via the-ghci-script
option, but the file is never loaded no matter which method I use.To Reproduce Steps to reproduce the behavior:
.ghci
in the project directory with some content (for example:set prompt .ghci loaded
)cabal v2-repl test:cardano-ledger-alonzo-test --ghc-options="-Wwarn"
After doing the steps above, the
.ghci
file is ignored by the REPL and it runs as it would without a.ghci
file.Expected behavior The repl starts and runs all the commands in the
.ghci
file.System information
cabal
3.8.1.0ghc
8.10.7