--enable-executable-profiling seems non-functional
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
--enable-executable-profiling seems to have no effect.
**To Reproduce**
Steps to reproduce the behavior:
```
$ cabal init -m -n --exe no-profiling-huh
$ cd no-profiling-huh
$ cabal build --enable-executable-profiling
Resolving dependencies...
Build profile: -w ghc-9.4.8 -O1
In order, the following will be built (use -v for more details):
- no-profiling-huh-0.1.0.0 (exe:no-profiling-huh) (first run)
Configuring executable 'no-profiling-huh' for no-profiling-huh-0.1.0.0..
Preprocessing executable 'no-profiling-huh' for no-profiling-huh-0.1.0.0..
Building executable 'no-profiling-huh' for no-profiling-huh-0.1.0.0..
[1 of 1] Compiling Main ( app/Main.hs, /home/b/tmp/no-profiling-huh/dist-newstyle/build/x86_64-linux/ghc-9.4.8/no-profiling-huh-0.1.0.0/x/no-profiling-huh/build/no-profiling-huh/no-profiling-huh-tmp/Main.o )
[2 of 2] Linking /home/b/tmp/no-profiling-huh/dist-newstyle/build/x86_64-linux/ghc-9.4.8/no-profiling-huh-0.1.0.0/x/no-profiling-huh/build/no-profiling-huh/no-profiling-huh
$ ./dist-newstyle/build/x86_64-linux/ghc-9.4.8/no-profiling-huh-0.1.0.0/x/no-profiling-huh/build/no-profiling-huh/no-profiling-huh +RTS -p |& head
no-profiling-huh: the flag -p requires the program to be built with -prof
```
**Expected behavior**
I expected --enable-executable-profiling to build the executable with -prof.
**System information**
- NixOS 23.11
- cabal-install version 3.10.2.1
- compiled using version 3.10.2.1 of the Cabal library
- The Glorious Glasgow Haskell Compilation System, version 9.4.8
**Additional context**
I'm in favor of deprecating this argument and using --enable-profiling instead. It already seems to work:
```
[b@kuusi:~/tmp/no-profiling-huh]$ cabal build --enable-profiling
Build profile: -w ghc-9.4.8 -O1
In order, the following will be built (use -v for more details):
- no-profiling-huh-0.1.0.0 (exe:no-profiling-huh) --enable-profiling (configuration changed)
Configuring executable 'no-profiling-huh' for no-profiling-huh-0.1.0.0..
Preprocessing executable 'no-profiling-huh' for no-profiling-huh-0.1.0.0..
Building executable 'no-profiling-huh' for no-profiling-huh-0.1.0.0..
[1 of 1] Compiling Main ( app/Main.hs, /home/b/tmp/no-profiling-huh/dist-newstyle/build/x86_64-linux/ghc-9.4.8/no-profiling-huh-0.1.0.0/x/no-profiling-huh/build/no-profiling-huh/no-profiling-huh-tmp/Main.p_o )
[2 of 2] Linking /home/b/tmp/no-profiling-huh/dist-newstyle/build/x86_64-linux/ghc-9.4.8/no-profiling-huh-0.1.0.0/x/no-profiling-huh/build/no-profiling-huh/no-profiling-huh [Objects changed]
[b@kuusi:~/tmp/no-profiling-huh]$ ./dist-newstyle/build/x86_64-linux/ghc-9.4.8/no-profiling-huh-0.1.0.0/x/no-profiling-huh/build/no-profiling-huh/no-profiling-huh +RTS -p |& head
Hello, Haskell!
```
Contributor guide
Assessment
This issue has not been assessed yet.