Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal check complains about -Werror in cabal.project #8490

Closed
nomeata opened this issue Sep 22, 2022 · 6 comments
Closed

cabal check complains about -Werror in cabal.project #8490

nomeata opened this issue Sep 22, 2022 · 6 comments

Comments

@nomeata
Copy link
Contributor

nomeata commented Sep 22, 2022

Describe the bug

cabal check complains about -Werror even if it is set in the cabal.project file

Expected behavior

Given that -Werror is only bad if it is part of the .cabal file uploaded to Hackage, setting it in the cabal.project file should not trigger the bug.

System information

This is cabal-3.6.2.0 from ghcup via haskell-ci.

Additional context

In my case the cabal.project is created by haskell-ci when using

haskell-ci regenerate  --local-ghc-options -Werror

which I tought might be a good way to get -Werror active on CI without affecting the Hackage releases.

(This is a minor thing of course, but still worth noting down.)

nomeata added a commit to nomeata/haskell-rec-def that referenced this issue Sep 22, 2022
@ulysses4ever
Copy link
Collaborator

Thanks for the report! We have a full-fledged rewrite of cabal check under way: #8427. It'd be nice if someone could try that branch and see if it's affected. /cc @ffaf1

@ffaf1
Copy link
Collaborator

ffaf1 commented Sep 22, 2022

I am trying to reproduce this on my machine but cannot, the way to trigget is is with:

packages: prova2
package prova2
    ghc-options: -Wall -Werror

in cabal.project, right? My version: 3.8.1.0

edit: fixed cabal.project

@nomeata
Copy link
Contributor Author

nomeata commented Sep 22, 2022

See https://github.com/nomeata/haskell-rec-def/actions/runs/3105946791/jobs/5032197241#step:21:29 for a failing run. It uses

package rec-def
  ghc-options: -Werror

so yes, that should be it. (The -Wall is part of the cabal file, if that makes a difference)

@ffaf1
Copy link
Collaborator

ffaf1 commented Sep 22, 2022

prova.zip

Can you try to unpack and then cd prova2/ && cabal check? I get No errors or warnings could be found in the package. with 3.8.1.0.

edit: wait, I see an “unguarded” (not under flag) -Wall -Werror in the cabal file:

https://github.com/nomeata/haskell-rec-def/blob/3365379b6c29aa32a5170b8d0336c73413ca7434/rec-def.cabal#L72

Did CI fail with that?

@nomeata
Copy link
Contributor Author

nomeata commented Sep 22, 2022

🤦🏻

Sorry! My brain was thinking “I should add -Werror wait I should only add it to CI” and my fingers must have added it to the .cabal file before I noticed.

@nomeata nomeata closed this as completed Sep 22, 2022
@ffaf1
Copy link
Collaborator

ffaf1 commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants