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

Build with -Wall #567

Closed

Conversation

philderbeast
Copy link
Contributor

WIP: Please don't merge yet.

@philderbeast
Copy link
Contributor Author

philderbeast commented Apr 30, 2022

@nikivazou or @ranjitjhala I'd like to attach the "WIP: Don't merge yet" label to this but cannot do this myself. I'm putting this up here so that I could ask about which direction to take with -Wno-name-shadowing.

@philderbeast
Copy link
Contributor Author

That's funny, I leave this work sit idle for a few weeks and now I can't seem to trigger name-shadowing warnings. If that is truly the case then we can drop the [WIP: Don't Merge Yet] label and this is ready to merge as a fix for #538.

@facundominguez I haven't added stack build --pendantic to the stack CI job but when I do it locally it builds without error.

Copy link
Collaborator

@facundominguez facundominguez left a comment

Choose a reason for hiding this comment

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

Thanks @philderbeast!

We could merge this promptly by removing the commits from #565 and reverting or addressing the comments in 0628354. Merging promptly is preferable for the large PRs like this, I'd say.

If --pedantic works, it would make sense to add it in the circleci configuration to keep LF warning-free.

@facundominguez
Copy link
Collaborator

We could merge this promptly by removing the commits from #565 and reverting or addressing the comments in 0628354.

I actually went ahead and merged all the commits except 0628354 and #565. The merged commits are listed here: #570

Rebasing develop now should allow to shrink the remaining changes to review in this PR.

By the way, nice breakdown of commits. They did help the review.

@ranjitjhala
Copy link
Member

ranjitjhala commented May 21, 2022 via email

@philderbeast
Copy link
Contributor Author

If --pedantic works, it would make sense to add it in the circleci configuration to keep LF warning-free.

I found that the stack command cares about the position of --pendantic. It has got to come after test.

> stack --pedantic --no-terminal test -j2 liquid-fixpoint:test --flag liquid-fixpoint:devel
Invalid option `--pedantic'
> stack --no-terminal test --pedantic -j2 liquid-fixpoint:test --flag liquid-fixpoint:devel
...
liquid-fixpoint> Test suite test passed

The --pedantic is not doing any more than we're doing when the --flag devel is set. Not wanting to drive the same nail home with two hammers, I will leave things as they are in the CI scripts.

> stack test --help
...
Available options:
  --pedantic               Turn on -Wall and -Werror
# .cirlceci/config.yml
      - run:
          name: Test
          command: |
            stack --no-terminal test -j2 liquid-fixpoint:test --flag liquid-fixpoint:devel

@philderbeast
Copy link
Contributor Author

By the way, nice breakdown of commits. They did help the review.

Thanks @facundominguez. I was lucky to find a methodical way to work through the errors.

After doing the rebase, I remember now why I had previously stopped for -Wno-name-shadowing. I used a combination of module pragmas and renamings with primes, x -> x'. The modules with {-# OPTIONS_GHC -Wno-name-shadowing #-} had more name clashes than I felt comfortable with changing in bulk. I added this pragma to 5 modules but then found 30 other modules already had this. Are we OK with setting this warning off in so many modules?

35 results - 35 files

src/Language/Fixpoint/Defunctionalize.hs:
src/Language/Fixpoint/Minimize.hs:
src/Language/Fixpoint/Parse.hs:
src/Language/Fixpoint/Solver.hs:
src/Language/Fixpoint/SortCheck.hs:
src/Language/Fixpoint/Horn/Solve.hs:
src/Language/Fixpoint/Horn/Transformations.hs:
src/Language/Fixpoint/Horn/Types.hs:
src/Language/Fixpoint/Smt/Interface.hs:
src/Language/Fixpoint/Smt/Serialize.hs:
src/Language/Fixpoint/Smt/Theories.hs:
src/Language/Fixpoint/Smt/Types.hs:
src/Language/Fixpoint/Solver/Common.hs:
src/Language/Fixpoint/Solver/EnvironmentReduction.hs:
src/Language/Fixpoint/Solver/Extensionality.hs:
src/Language/Fixpoint/Solver/GradualSolution.hs:
src/Language/Fixpoint/Solver/Instantiate.hs:
src/Language/Fixpoint/Solver/Interpreter.hs:
src/Language/Fixpoint/Solver/PLE.hs:
src/Language/Fixpoint/Solver/Prettify.hs:
src/Language/Fixpoint/Solver/Rewrite.hs:
src/Language/Fixpoint/Solver/Sanitize.hs:
src/Language/Fixpoint/Solver/Simplify.hs:
src/Language/Fixpoint/Solver/Solution.hs:
src/Language/Fixpoint/Solver/Solve.hs:
src/Language/Fixpoint/Solver/TrivialSort.hs:
src/Language/Fixpoint/Solver/UniqifyBinds.hs:
src/Language/Fixpoint/Solver/UniqifyKVars.hs:
src/Language/Fixpoint/Types/Constraints.hs:
src/Language/Fixpoint/Types/Graduals.hs:
src/Language/Fixpoint/Types/Solutions.hs:
src/Language/Fixpoint/Types/Sorts.hs:
src/Language/Fixpoint/Types/Theories.hs:
src/Language/Fixpoint/Types/Visitor.hs:
tests/tasty/Arbitrary.hs:

@facundominguez
Copy link
Collaborator

Are we OK with setting this warning off in so many modules?

Looks like a feasible way to breakdown the work to fix the warnings. I'd like to enable the warning in all of the modules eventually.

@philderbeast
Copy link
Contributor Author

It is a shame that cabal or ghc doesn't give us a summary of warning counts by module. Would help us pick our battles.

@facundominguez
Copy link
Collaborator

I merged the newer commits here in #571
I squashed together 90a92b7 and 846d040.

This can be closed if nothing else remains besides #565.

@philderbeast
Copy link
Contributor Author

This can be closed if nothing else remains besides #565.

I rebased again and yes that seems to be the case, closing now.

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

Successfully merging this pull request may close these issues.

4 participants