Skip to content

Feature request: Super fast output of all warnings #1179

Open

Description

@nh2

For SublimeHaskell (and potentially all other editors and similar tools) we need to quickly be able to list all warnings of a cabal project.

cabal build does not show warnings on already compiled modules, so we currently use

cabal build --ghc-options="-fforce-recomp -Wall -fno-code"

to quickly get all warnings of the project. This is obviously slow since all code has to be re-compiled (even though code generation can be skipped).

It would be nice if cabal could use its knowledge of which code has no changes to maintain a cache of warnings and error messages that can be queried super quickly.

We could then add an option cabal build --check that only typechecks the project and prints out all errors/warnings of unchanged files from the cache, so that a no-op typecheck with warnings is instant and can give feedback very quickly or even as you type.

Activity

  1. added this to the milestone on Apr 23, 2015
  2. modified the milestones: Cabal 1.24, on Feb 21, 2016
  3. modified the milestones: Cabal 2.0, ⊥ on Sep 6, 2016
  4. ezyang commented on Sep 8, 2016

    @ezyang
    Contributor

    This is actually annoying to do in the current architecture, because ghc --make spews out all of the warnings into one stderr, so you'd have to parse and separate them out by hand.

    I actually implemented warning caching in ghc-shake https://github.com/ezyang/ghc-shake which is a drop-in replacement for ghc. Warnings are put in *.log files so if you use find dist-newstyle/build/ -name "*.log" -exec cat {} \; you'll see all the warnings. Works pretty well for me.

    This won't get fixed unless someone steps up to do it.

  5. jneira commented on Apr 28, 2022

    @jneira
    Member

    Not sure if that behaviour should be included in cabal itselfor in a external tool.

  6. added
    old-milestone: ⊥
    on Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cabal: otherold-milestone: ⊥type: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions