Skip to content

ghc-prof-options changes not triggering rebuild #9585

Open
@tirumaraiselvan

Description

@tirumaraiselvan

Describe the bug

ghc-prof-options in <package>.cabal does not take into account newer changes. Possibly related to #3891

To Reproduce

Suppose my package file is large.cabal with ghc-prof-options: -fno-prof-count-entries :

executable large
    main-is:          Main.hs
    build-depends:    
        base ^>=4.17.2.0,
    hs-source-dirs:   app
    default-language: Haskell2010
    ghc-prof-options: -fno-prof-count-entries
  1. Run this using: cabal run --enable-profiling large -- +RTS -p
  2. Note that the large.prof file will have all entries set to 0
  3. Change ghc-prof-options above to ghc-prof-options: -fprof-count-entries to force counting entries
  4. Run again using same command. Output (notice it doesn't recompile!):
Resolving dependencies...
Build profile: -w ghc-9.4.7 -O1
In order, the following will be built (use -v for more details):
 - large-0.1.0.0 (exe:large)  --enable-profiling (configuration changed)
Configuring executable 'large' for large-0.1.0.0..
Preprocessing executable 'large' for large-0.1.0.0..
Building executable 'large' for large-0.1.0.0..
  1. Note that the large.prof file will still have all entries set to 0. Not Expected
  2. Run cabal clean
  3. Run again using same command and note non-zero entries in large.prof.

Expected behavior

Code should be recompiled with up-to-date ghc-prof-options

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions