Skip to content

Extend unit test for GHC options as part of release process? #9435

Open
@philderbeast

Description

@philderbeast

At 976f86a, I'm getting -Wunused-top-binds when building cabal.project:

$ cabal build all --enable-tests --enable-benchmarks
Resolving dependencies...
Build profile: -w ghc-9.4.7 -O1
In order, the following will be built (use -v for more details):
 - Cabal-syntax-3.11.0.0 (lib) (configuration changed)
 - solver-benchmarks-3 (lib) (configuration changed)
 - hackage-security-0.6.2.3 (lib) (dependency rebuilt)
 - cabal-benchmarks-3 (test:cabal-benchmarks) (configuration changed)
 - Cabal-tests-3 (test:rpmvercmp) (configuration changed)
 - Cabal-tests-3 (test:no-thunks-test) (configuration changed)
 - Cabal-3.11.0.0 (lib) (configuration changed)
 - solver-benchmarks-3 (test:unit-tests) (configuration changed)
 - solver-benchmarks-3 (exe:hackage-benchmark) (configuration changed)
 - cabal-testsuite-3 (lib:cabal-testsuite, exe:cabal-tests, exe:setup) (configuration changed)
 - cabal-install-solver-3.11.0.0 (lib) (configuration changed)
 - Cabal-tree-diff-3.11.0.0 (lib) (configuration changed)
 - Cabal-tests-3 (test:custom-setup-tests) (configuration changed)
 - Cabal-tests-3 (test:check-tests) (configuration changed)
 - Cabal-described-3.11.0.0 (lib) (configuration changed)
 - Cabal-QuickCheck-3.11.0.0 (lib) (configuration changed)
 - cabal-install-solver-3.11.0.0 (test:unit-tests) (configuration changed)
 - cabal-install-3.11.0.0 (lib) (configuration changed)
 - Cabal-tests-3 (test:parser-tests) (configuration changed)
 - Cabal-tests-3 (test:hackage-tests) (configuration changed)
 - Cabal-tests-3 (test:unit-tests) (configuration changed)
 - cabal-install-3.11.0.0 (test:unit-tests) (configuration changed)
 - cabal-install-3.11.0.0 (test:mem-use-tests) (configuration changed)
 - cabal-install-3.11.0.0 (test:long-tests) (configuration changed)
 - cabal-install-3.11.0.0 (test:integration-tests2) (configuration changed)
 - cabal-install-3.11.0.0 (exe:cabal) (configuration changed)
Configuring library for Cabal-syntax-3.11.0.0..
...
Configuring test suite 'hackage-tests' for Cabal-tests-3..

tests/UnitTests/Distribution/Simple/Program/GHC.hs:200:1: warning: [-Wunused-top-binds]
    Defined but not used: ‘options_9_2_all’
    |
200 | options_9_2_all =
    | ^^^^^^^^^^^^^^^

tests/UnitTests/Distribution/Simple/Program/GHC.hs:212:1: warning: [-Wunused-top-binds]
    Defined but not used: ‘options_9_2_affects’
    |
212 | options_9_2_affects =
    | ^^^^^^^^^^^^^^^^^^^

There's a note about how to collect newer GHC options but could we automate this with a script and also add the task of updating this unit test as part of the cabal release process?

-- | Options added in GHC-8.8, to generate:
--
-- @
-- ghc-8.6.5 --show-options | sort > 8.6.5.txt
-- ghc-8.8.1 --show-options | sort > 8.8.1.txt
-- diff -u 8.6.5 8.8.1
-- @
--
-- - remove -W(no-)error=, -W(no-)warn flags.
-- - split into all and flags which may affect artifacts

Metadata

Metadata

Assignees

No one assigned

    Labels

    re: ghc-optionsConcerning passing options to GHCtype: testingIssues about project test suites

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions