Skip to content

Comments

Add -Werror to package-defaults.yaml#1894

Closed
smatting wants to merge 4 commits intodevelopfrom
smatting/werror
Closed

Add -Werror to package-defaults.yaml#1894
smatting wants to merge 4 commits intodevelopfrom
smatting/werror

Conversation

@smatting
Copy link
Contributor

@smatting smatting commented Oct 29, 2021

This PR makes all local packages build with -Werror by default. The motivation for this PR is the principle that building with stack or cabal without any special flags should build in production configuration.

Another motivation is that currently we invoke stack with --pedantic in all Makefiles to achieve the same thing. Cabal doesn't have a flag like this, which requires using --ghc-options, which has its quirks, e.g. specifying --ghc-options twice doesn't work as expected.

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • If HTTP endpoint paths have been added or renamed, the endpoint / config-flag checklist (see Wire-employee only backend wiki page) has been followed.
  • If a cassandra schema migration has been added, I ran make git-add-cassandra-schema to update the cassandra schema documentation.
  • changelog.d contains the following bits of information:
    • A file with the changelog entry in one or more suitable sub-sections. The sub-sections are marked by directories inside changelog.d.
    • If new config options introduced: added usage description under docs/reference/config-options.md
    • If new config options introduced: recommended measures to be taken by on-premise instance operators.
    • If a cassandra schema migration is backwards incompatible (see also these docs), measures to be taken by on-premise instance operators are explained.
    • If a data migration (not schema migration) introduced: measures to be taken by on-premise instance operators.
    • If public end-points have been changed or added: does nginz need un upgrade?
    • If internal end-points have been added or changed: which services have to be deployed in a specific order?

Copy link
Member

@akshaymankar akshaymankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make it very hard for someone to use wire packages as libraries with newer versions of GHC, as things are likely to cause warnings in future. Isn't there something we could do with cabal.project?

@akshaymankar
Copy link
Member

This will make it very hard for someone to use wire packages as libraries with newer versions of GHC, as things are likely to cause warnings in future. Isn't there something we could do with cabal.project?

That said, only I try to fiddle with this kind of stuff when I am bored, so feel free to ignore me :)

@smatting
Copy link
Contributor Author

smatting commented Nov 4, 2021

@akshaymankar Yes, specifying

package wire-api
   ghc-options: -Werror

in cabal.project works as well. I'll add it to #1853 instead.

@smatting smatting closed this Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants