You are not logged in.

#1 2024-03-06 16:17:22

josephg
Member
From: Brazil
Registered: 2009-09-28
Posts: 106

Should I set debug build type for PKGBUILD hosted in AUR?

I've always had my AUR package ddnet set with CMAKE_BUILD_TYPE as "Release" as it basically a package that provides stable-release tarballs. So the resulting binary is optimized, no debug symbols, etc. But then I noticed that many local package builds started to generated *-debug package, and that's because /etc/makepkg.conf defaults to options=(debug) as of commit 90bf367e6 from pacman's package. But this didn't apply to ddnet because of the CMAKE_BUILD_TYPE I set.

Quoting this stackoverflow answer on the CMAKE_BUILD_TYPE values and their differences:

1. Release: high optimization level, no debug info, code or asserts.
2. Debug: No optimization, asserts enabled, [custom debug (output) code enabled],
   debug info included in executable (so you can step through the code with a
   debugger and have address to source-file:line-number translation).
3. RelWithDebInfo: optimized, *with* debug info, but no debug (output) code or asserts.
4. MinSizeRel: same as Release but optimizing for size rather than speed.

My questions are:

1. Should I set (and publish) CMAKE_BUILD_TYPE = "Debug", in order to generated a -debug package and to have debug symbols available?
2. Alternatively, "RelWithDebugInfo" doesn't generate debug, would it a good option?

Offline

#2 2024-03-06 16:20:30

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,539

Re: Should I set debug build type for PKGBUILD hosted in AUR?

Offline

Board footer

Powered by FluxBB