Skip to content

Bug: cabal repl file fails for executable component #6622

Closed
@fendor

Description

@fendor

To Reproduce
Steps to reproduce the behavior:
Set up an example project:

$  cabal init -p example --libandexe --tests --main-is=Main.hs --source-dir=src --application-dir=app --test-dir=test

Load library component:

$ cabal repl src/MyLib.hs
# Succeeds to load
$ cabal repl src/Lib.hs
# Fails to load as expected 
$ cabal repl app/Main.hs
# Fails to load although
cabal.exe: Unknown target './app/Main.hs'.
The package example has no file target 'app/Main.hs'.
$ cabal repl test/MyTestLib.hs
cabal.exe: Unknown target './test/MyLibTest.hs'.
The package example has no file target 'test/MyLibTest.hs'.

Expected behavior

The file targets app/Main.hs and test/MyTestLib.hs should successfully load.

System information

  • cabal: 3.0.0.0, but also HEAD.

Benefit

Directly benefits hie-bios which uses cabal repl <filename> to find compilation flags.
cc @mpickering

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions