The `--repl-no-load` option is not recognized for build-type: Custom
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
I'm not able to start `cabal repl` with the `--repl-no-load` in Haskell packages specified to have `build-type: Custom`.
**To Reproduce**
Steps to reproduce the behavior:
I've prepared a GitHub repository to demonstrate this issue. So check out: https://github.com/enobayram/cabal-repl-no-load-test
Then in that folder, the following fails, even though a simple `cabal v2-repl` works.
```
$ cabal v2-repl --repl-no-load -v
...
creating
/***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0/setup
/***/.ghcup/bin/ghc --make -fbuilding-cabal-package -odir /***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0/setup -hidir /***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0/setup -i -i/***/cabal-no-load-test/. -optP-include -optP/***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0/setup/setup_macros.h -hide-all-packages -no-user-package-db -package-db /***/store/ghc-8.10.7/package.db -package-db /***/cabal-no-load-test/dist-newstyle/packagedb/ghc-8.10.7 -package-id Cabal-3.2.1.0 -package-id base-4.14.3.0 /***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0/setup/setup.hs -o /***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0/setup/setup -threaded
/***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0/setup/setup
repl --verbose=2
--builddir=/***/cabal-no-load-test/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cabal-no-load-test-0.1.0.0
--repl-no-load exe:cabal-no-load-test
unrecognized 'repl' option `--repl-no-load'
CallStack (from HasCallStack):
withMetadata, called at src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0-inplace:Distribution.Simple.Utils
Error: cabal: repl failed for cabal-no-load-test-0.1.0.0-inplace.
```
**Expected behavior**
`cabal v2-repl --repl-no-load` should drop me down to a GHCi session that has no modules loaded.
**System information**
- Ubuntu 22.04
- `cabal --version`: 3.8.1.0
- `ghc --version`: 8.10.7
**Additional context**
Note that `cabal v2-repl --repl-no-load` works, if you change `build-type` to `Simple` in [cabal-no-load-test.cabal](https://github.com/enobayram/cabal-repl-no-load-test/blob/ed5550029f22d5e06be21ababb5063a3b73901f1/cabal-no-load-test.cabal#L42)
Contributor guide
Research direction
Start with the linked reproduction and cabal-no-load-test.cabal, comparing the working Simple build type with Custom. Trace the cabal v2-repl --repl-no-load entry point through the Custom setup path. Done means the option is accepted for Custom packages and opens GHCi with no modules loaded, while preserving the existing Simple behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100