Inconsistent CMAKE_BUILD_TYPE
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 616
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 10
Description
Currently, CMakeLists.txt unconditionally adds -g to the compiler flags, resulting in all builds containing debug symbols:
I find this surprising as this makes the existence of the two CMAKE_BUILD_TYPES of Release and RelWithDebInfo a bit pointless.
Relevant commits/issues from the past touching this (unfortunately with little reasoning why they did it this way):
- https://github.com/Icinga/icinga2/commit/e5fba1d881c7de0b16ddf8fd662edb9699cc8b44 + https://github.com/Icinga/icinga2/issues/958
- https://github.com/Icinga/icinga2/commit/b6220c6ecfd3a64bf73ae5de8ed62f257867b5c0 + https://github.com/Icinga/icinga2/issues/998
Tasks
- Figure out if using
RelWithDebInfoinstead ofReleasemakes more difference than passing-gadditionally. - Prepare PR that does not unconditionally add
-gto compiler flags. - Test that debug symbol packages are still built properly.
- Make sure docker builds use the
Releasetype and don't strip the binaries themselves (as introduced by https://github.com/Icinga/docker-icinga2/pull/85)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CMakeLists.txt around lines 251-265 and compare the Release and RelWithDebInfo configurations. Check the resulting compiler flags, debug symbol packages, and the docker build behavior referenced in the issue. Done means -g is not added unconditionally, symbol packages still build correctly, and docker builds use Release without stripping binaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, docker
- Domain
- build-system, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100