Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,392
    • Issues 4,392
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 374
    • Merge Requests 374
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15278

Closed
Open
Opened Jun 17, 2018 by Vladislav Zavialov@int-indexDeveloper

Add -Werror=compat, enable it in the testsuite

Proposed change

Add a flag -Werror=compat to GHC which would have the effect of -Werror=x -Werror=y ... where x, y, ... are warnings from minusWcompatOpts. Enable -Werror=compat in the testsuite.

Motivation

  1. -Werror=compat would be a convenient shorthand to ensure forwards-compatibility of code. I can imagine Haskell libs enabling it on their CI.
  2. Enabling -Werror=compat in the testsuite would allow us to easily see the impact that a new warning has on code. It also means that in the period between adding the warning and making the actual breaking change, all new test cases that are being added to the testsuite will be forwards-compatible. This is good because it will make the actual breaking change contain less irrelevant testsuite updates.

The idea came up during my work on D4834 which defines a new warning and adds it to -Wcompat. Ryan Scott raised the following concern:

There are likely many tests in the testsuite that will now fail due to this change—I'm unclear if you're intending to fix them by explicitly quantifying their kind variables, or leaving the new error message as-is.

My intention was to update the test cases, but it turned out that I couldn't even locate these test cases without make EXTRA_HC_OPTS="-Werror=implicit-kind-vars". And even if I updated the testsuite, nothing would prevent new test cases that are not forwards-compatible, because the warning isn't enabled by default (and without -Werror=compat, enabling -Wcompat would not cause test failures in all circumstances).

Implementation plan

  1. Add new flags: -Werror=compat, -Wno-error=compat, -Wwarn=compat. Document these flags in the User's Guide.
  2. Enable -Werror=compat in the testsuite by default and fix all tests that break.
Edited Mar 10, 2019 by Vladislav Zavialov
Assignee
Assign to
8.8.1
Milestone
8.8.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#15278