Re: [hatari-devel] Hatari default / release build types |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Hatari default / release build types
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Thu, 21 Aug 2025 19:39:32 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=3fFaOpBMAlem9OZB16p+lHBnxkWFwbJ8X/Gz3wnjUk4=; h=From:Content-Type:Mime-Version:Subject:Date:To:Message-Id:x-icloud-hme; b=gRkhSM+EEczJVxQPcNsdO6hTleG31mdYye/EiYZEm+7OS4jsHX95S4YF/0higHJL4pRMDHNnjyQe9dT18hwEDkNRa8NbfkeXMCGKVKYC8TDh8TJNINmNInknfSJCxjIp0j33x/vrTcBVcTQc3ikqtfx/9slFODO3AHu8m1bYxVmK2wmbZ+oCY8mtAP17LbMQvu546LCCmcqn2t4+RbjlHYU1h/R9WTKDBpmkR6Sj31KSo/+XumsgZoFP4KBYtTdOpEc93kmk3rUwj6AcMvqfg48WhSC1X7O+6fpVdTFAFiQAbR/q2C2ONmfyO/1kWqikl+y8pW+VTRu+lZ2zZxChKw==
> Am 21.08.2025 um 16:07 schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
>
> Hi,
>
> On 21.8.2025 16.18, Nicolas Pomarède wrote:
>> Le 21/08/2025 à 15:04, Eero Tamminen a écrit :
>>> It may be better to default to (optimized) debug build with asserts enabled, and only do release builds with asserts disabled[2], but that's up to Nicolas.
>>>
>>> (I don't know how Nicolas does releases.)
>> For release, I use "./configure" or "./configure --cross-compile- win64_64". I must admit I rarely add "--enable-debug" flag to "./ configure" in my usual "pipeline"
>
> I had forgotten that there was a "configure" wrapper script...
>
>
>> But if we want to spot possible assert errors, maybe the automated builds on framagit could have "--enable-debug" ? This way people who download build's artefact (such as zip archive for windows) would see them.
>
> That maps to CMake "Debug" build type:
> https://github.com/hatari/hatari/blob/main/configure#L53
>
> I did not find from current CMake documentation even what the current build types (are supposed to) map to:
> https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
>
> But when testing my (older) CMake 3.25.1 version, the standard values seem to correspond to:
> - Debug: "-g" [1]
> - MinSizeRel: "-Os -DNDEBUG"
> - RelWithDebInfo: "-O2 -g -DNDEBUG"
> - Release: "-O3 -DNDEBUG"
>
> Meaning that debug builds are no good because:
> - Resulting binary is really slow
> - Compiler misses most of warnings
> (as code analysis is done by its optimization passes)
>
> And none of the others are good either. One would need to create an extra build type to CMakeLists.txt, for example:
> - RelDebug: "O3 -g"
>
> And make that default instead of "Release":
> https://github.com/hatari/hatari/blob/main/CMakeLists.txt#L6
>
>
> - Eero
>
> [1] Hatari appears to add "-O" to "Debug" type, so it's not completely awful:
> https://github.com/hatari/hatari/blob/main/CMakeLists.txt#L304
>
I prefer the default build to be in release mode as it is right now. We should not add extra complexity for users who just want to compile and run Hatari or Previous.
But probably it would be good to have some kind of guideline or checklist for coders so they don’t forget to enable debugging/assertions while coding.
Andreas