Suppose we had configured with library-profiling: true and executable-profiling: false, and had built executables without --executable-profiling option.
Then, if we wanted to take an executable profiling and passed --executable-profiling option to stack, then it unregisters all the library consisting stack-project (not all the dependencies) and rebuild them from scratch, due to the change of compiler flags.
I think this behaviour is not optimal; we have built libraries with profiling features (and have p_o files already) and only we had to rebuild is executables.
For example, suppose we have the following stack.yaml:
packages:
- core-libs-and-exe # package with library and executables
- util-lib -and-exe # another one
- super-lib-and-exe # yet another
extra-deps:
- extra-dependent-package-0.1.0.0
build:
library-profiling: true
executable-profiling: false
If we have once successfully executed stack build, p_o objects are built.
But if we enter stack build --executable-profiling again, Stack will rebuild all libraries and executables of core-libs-and-exe, util-lib -and-exe and super-lib-and-exe, although extra-dependent-package will not be rebuilt since they have profiling object files.
My propose is just to avoid rebuild libraries if the library profiling had been already enabled but executable was not.
Suppose we had configured with
library-profiling: trueandexecutable-profiling: false, and had built executables without--executable-profilingoption.Then, if we wanted to take an executable profiling and passed
--executable-profilingoption tostack, then it unregisters all the library consisting stack-project (not all the dependencies) and rebuild them from scratch, due to the change of compiler flags.I think this behaviour is not optimal; we have built libraries with profiling features (and have
p_ofiles already) and only we had to rebuild is executables.For example, suppose we have the following
stack.yaml:If we have once successfully executed
stack build,p_oobjects are built.But if we enter
stack build --executable-profilingagain, Stack will rebuild all libraries and executables ofcore-libs-and-exe,util-lib -and-exeandsuper-lib-and-exe, althoughextra-dependent-packagewill not be rebuilt since they have profiling object files.My propose is just to avoid rebuild libraries if the library profiling had been already enabled but executable was not.