Skip to content

Enabling documentation seems to swallow ghc-options passed #10782

Open
@Swordlash

Description

Describe the bug

Pretty much what is in the title. Enabling documentation seems to swallow additional ghc-options being passed (either on command line or in cabal.project).

To Reproduce
Steps to reproduce the behavior:

cabal-test.cabal:

cabal-version:      3.0
version:            0.1.0
name:               cabal-test
build-type:         Simple

executable cabal-test
    main-is:          Main.hs
    build-depends:    base
    hs-source-dirs:   app
    default-language: Haskell2010

in the app/Main.hs:

module Main where

import Data.List -- note: redundant import
 
main :: IO ()
main = putStrLn "Hello, Haskell!"

Run

$ cabal run  --ghc-options="-Wall -Werror" --enable-documentation

Expected behavior
The build should fail with unused import. Instead, not even a warning is printed.

System information

  • Operating system: Linux Ubuntu 22.04 x86_64
  • cabal: 3.14.1.1
  • ghc: 9.6.6 (tested with 9.8.4 as well)

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions