Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Error message for attempting to load an unknown module #9171

Open
fendor opened this issue Aug 14, 2023 · 0 comments
Open

Improve Error message for attempting to load an unknown module #9171

fendor opened this issue Aug 14, 2023 · 0 comments
Labels
cabal-install: cmd/build re: error-message Concerning error messages delivered to the user type: enhancement

Comments

@fendor
Copy link
Collaborator

fendor commented Aug 14, 2023

Describe the bug
cabal repl and cabal build for unknown module displays confusing error message.

Error: cabal: Failed extracting script block: `{- cabal:` start marker not
found

To Reproduce

$ cabal init -n --lib
# insert the following in the cabal file
$ cat test-cabal-errors
cabal-version:      3.0
name:               test-cabal-errors
version:            0.1.0.0
build-type:         Simple

library
    exposed-modules:  MyLib
    build-depends:    base ^>=4.17.1.0
    hs-source-dirs:   src
    default-language: Haskell2010

$ touch src/Lib.hs
$ cabal repl src/Lib.hs
$ cabal build src/Lib.hs # same error message

Expected behavior
The error message should convey to the user clearly what is going wrong and why.
Ideally, include information on how to solve the issue. (E.g. "add to exposed-module of some specific component.")

System information

  • cabal: cabal-install version 3.10.1.0

Additional context

Related to haskell/haskell-language-server#3695 and haskell/haskell-language-server#3595
Tooling has to make sense of this error message to provide any sensible code actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cabal-install: cmd/build re: error-message Concerning error messages delivered to the user type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants