title: Haskell stack ignores -Wall -Werror cabal ghc-options flags when building
body: <p>I would like to always use the "-Wall -Werror" options when building with stack (executing <strong>stack build</strong>) but adding these flags to ghc-options in package.yaml does nothing. I would also like to avoid passing the --pedantic flag to stack build. Here's the config files:</p>
  
  <pre><code>package.yaml
  
  ...
  executables:
    XYZ-exe:
      main:                Main.hs
      source-dirs:         app
      ghc-options:
      - -Wall
      - -Werror
      - -threaded
      - -rtsopts
      - -with-rtsopts=-N
      dependencies:
      - XYZ
  ...
  
  XYZ.cabal
  
  ...
  executable XYZ-exe
    main-is: Main.hs
    hs-source-dirs:
        app
    ghc-options: -Wall -Werror -threaded -rtsopts -with-rtsopts=-N
  ...
  </code></pre>
  
  <p>The "-Wall -Werror" flags are specified in ghc-options but as-if ignored when building. This is the output for <strong>stack build</strong>:</p>
  
  <pre><code>stack build
  Building all executables for `XYZ' once. After a successful build of all of 
  them, only specified executables will be rebuilt.
  XYZ-0.1.0.0: configure (lib + exe)
  Configuring XYZ-0.1.0.0...
  XYZ-0.1.0.0: build (lib + exe)
  Preprocessing library for XYZ-0.1.0.0..
  Building library for XYZ-0.1.0.0..
  [  1 of 105] Compiling Data.List.Extras ( src\Data\List\Extras.hs, .stack- 
  work\dist\e626a42b\build\Data\List\Extras.o )
  ... the rest is omitted, all succeed ...
  </code></pre>
  
  <p>And here's the output for <strong>stack build --pedantic</strong></p>
  
  <pre><code>stack build --pedantic
  Building all executables for `HStat' once. After a successful build of all of them, only specified executables will be rebuilt.
  HStat-0.1.0.0: configure (lib + exe)
  Configuring HStat-0.1.0.0...
  HStat-0.1.0.0: build (lib + exe)
  Preprocessing library for HStat-0.1.0.0..
  Building library for HStat-0.1.0.0..
  [  1 of 105] Compiling Data.List.Extras ( src\Data\List\Extras.hs, .stack-work\dist\e626a42b\build\Data\List\Extras.o )
  
  src\Data\List\Extras.hs:4:1: error: [-Wunused-imports, -Werror=unused-imports]
      The import of ‘Data.Maybe’ is redundant
        except perhaps to import instances from ‘Data.Maybe’
      To import instances alone, use: import Data.Maybe()
    |
  4 | import           Data.Maybe
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  </code></pre>
  
  <p>This works as expected - src\Data\List\Extras.hs indeed does have an unused Data.Maybe import. What am I doing wrong?</p>