haskell / haskell/cabal

ghc-prof-options changes not triggering rebuild

Open
#9,585 0 comments 0 reactions 0 assignees View on GitHub
needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

`ghc-prof-options` in `.cabal` does not take into account newer changes. Possibly related to https://github.com/haskell/cabal/issues/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..
```

5. Note that the `large.prof` file will still have all `entries` set to 0. **Not Expected**
6. Run `cabal clean`
7. 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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.