Skip to content

new-build doesn't respect verbose: setting in ~/.cabal/config #5956

Open

Description

@phadej
% grep verbose ~/.cabal/config 
verbose: verbose +nowrap

% cabal new-build
Build profile: -w ghc-8.4.4 -O1
In order, the following will be built (use -v for more details):
 - haskell-ci-0.3.20190320 (lib:haskell-ci-internal) (first run)
 - haskell-ci-0.3.20190320 (exe:haskell-ci) (first run)
Preprocessing library 'haskell-ci-internal' for haskell-ci-0.3.20190320..
Building library 'haskell-ci-internal' for haskell-ci-0.3.20190320..
[34 of 34] Compiling HaskellCI        ( src/HaskellCI.hs, /home/ogre/Documents/shared-haskell/haskell-ci/dist-newstyle/build/x86_64-linux/ghc-8.4.4/haskell-ci-0.3.20190320/l/haskell-ci-internal/build/haskell-ci-internal/HaskellCI.o )
^C

% cabal new-build -vverbose+nowrap
this build was affected by the following (project) config files:
- /home/ogre/Documents/shared-haskell/haskell-ci/cabal.project
Build profile: -w ghc-8.4.4 -O1
In order, the following will be built:
 - haskell-ci-0.3.20190320 (lib:haskell-ci-internal) (first run)
 - haskell-ci-0.3.20190320 (exe:haskell-ci) (first run)
creating /home/ogre/Documents/shared-haskell/haskell-ci/dist-newstyle/build

Activity

  1. fgaz commented on Mar 23, 2019

    @fgaz
    Member

    Could this be related to #5942?

  2. phadej commented on Mar 24, 2019

    @phadej
    CollaboratorAuthor

    I tried to lookup where the various configurations blocks are appended; I didn't manage to figure out.

  3. hvr commented on Mar 27, 2019

    @hvr
    Member

    This bug/issue existed for a long time; I'm surprised there wasn't already a bug filed about this hidden in our issue tracker... :-)

  4. bacchanalia commented on Feb 18, 2022

    @bacchanalia
    Collaborator

    Looking into this, I'm increasingly unsure if any v2- commands respect the verbose: setting.

  5. self-assigned this
    on Feb 20, 2022
  6. bacchanalia commented on Feb 20, 2022

    @bacchanalia
    Collaborator

    The only way I see of solving this is to read the configs early to find the verbosity, but there's no good to then pass the config to commands without a large rewrite, so basically every command is going to end up reading the config twice.

    Is this functionality anyone actually wants? Maybe we're better off removing it instead of fixing it?

  7. gbaz commented on Feb 21, 2022

    @gbaz
    Collaborator

    Can you sketch out the issue in a bit more detail. Maybe with some pointers to the obstacle, someone else could find a solutkon?

  8. bacchanalia commented on Feb 21, 2022

    @bacchanalia
    Collaborator

    @gbaz I opened a draft PR

  9. added this to the 3.9 milestone on Jun 2, 2022
  10. m4dc4p commented on Jan 31, 2025

    @m4dc4p

    I love the v0 flag and having this setting work would be fantastic. Or remove it from the docs, as its just misleading.

  11. philderbeast commented on Aug 4, 2026

    @philderbeast
    Collaborator

    I tried the fix in #7999 after rebasing and updating it, and it worked. Here's an adhoc test:

    $ cabal install cabal-install:exe:cabal --overwrite-policy=always
    
    $ cabal build Cabal-described
    ...
    
    $ cabal build Cabal-described
    Up to date
    

    The build shows compilation:

    $ echo "--TOUCH" >> Cabal-described/src/Distribution/Described.hs
    $ cabal build Cabal-described
    Build profile: -w ghc-9.14.1 -O1
    In order, the following will be built (use -v for more details):
     - Cabal-described-3.19.0.0 (lib) (file src/Distribution/Described.hs changed)
    Preprocessing library for Cabal-described-3.19.0.0...
    Building library for Cabal-described-3.19.0.0...
    [3 of 3] Compiling Distribution.Described
    

    The build with --verbose=0 doesn't show compilation:

    $ echo "--TOUCH" >> Cabal-described/src/Distribution/Described.hs
    $ cabal build Cabal-described --verbose=0
    

    The build with verbose: 0 in the project doesn't show compilation:

    $ echo "--TOUCH" >> Cabal-described/src/Distribution/Described.hs
    $ echo "verbose: 0" >> cabal.project
    $ cabal build Cabal-described
    
    $ git diff
    diff --git a/Cabal-described/src/Distribution/Described.hs b/Cabal-described/src/Distribution/Described.hs
    index 0fedbf150..2cc3849ea 100644
    --- a/Cabal-described/src/Distribution/Described.hs
    +++ b/Cabal-described/src/Distribution/Described.hs
    @@ -599,3 +599,6 @@ instance Described CompatDataDir where
     
     instance Described FilePathNT where
         describe _ = describe ([] :: [Token])
    +--TOUCH
    +--TOUCH
    +--TOUCH
    diff --git a/cabal.project b/cabal.project
    index f2a31a35e..4357fad2b 100644
    --- a/cabal.project
    +++ b/cabal.project
    @@ -15,3 +15,4 @@ package Cabal
     
     package semaphore-compat
       flags: -build-testing
    +verbose: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions