Transmission by default builds in debug mode (assertions on, no optimisations etc) but it also has a build type of "release mode". Transmission devs suggest when the daemon crashes from an assertion, that you should just compile in release mode (-DCMAKE_BUILD_TYPE=Release) and move on. Please add support for a use flag to build in release mode. Reproducible: Always
Request is for version 3. Not sure if it is the same build parameter for the version 4 rewrite but would be good to have it in version 4 also.
FWIW, it's more that we'd have a USE=debug for non-release.
If you want to disable assertions, you can add -DNDEBUG via CFLAGS. As far as optimizations, we also respect your CFLAGS for that.
Sorry if it seems I dismissed this request quickly. I just don't think it makes sense to add debug/release USE flags to control the cmake build type when other solutions already exist. If you really want to set the build type to Release, you could set CMAKE_BUILD_TYPE using package.env. However, I don't think that would really do what you want, since cmake.eclass overrides flags regardless of what we set the build type to.
Hi Mike Obviously differring points of view, but I tend to agree with Sam. Can't we just build non-debug by default? I went down a bit of a rabbit hole looking to get a non-debug build. Found the CMAKE_BUILD_TYPE and tried it but didn't work as you have since confirmed. I used the per package cflags to get a release version built, that worked thanks. If you are strongly opposed to use flags for this, perhaps can we just change the default to release, and then if assertions are needed, use package cflags for that? My preference is of course to just have a use flag for debug to make it obvious to users. thanks
> Can't we just build non-debug by default? We already do not build in debug mode by default. For net-p2p/transmission-3.00-r1 (EAPI 7), cmake.eclass uses build type "Gentoo" by default. For >=net-p2p/transmission-4.0.0-r1 (EAPI 8), cmake.eclass uses build type "RelWithDebInfo". Due to the way cmake.eclass works, changing the build type to "Release" will not do anything useful for you. Specifically, it would not disable assertions, and it will not enable optimizations. If you can show me evidence that the transmission developers actually recommend building with assertions disabled by default, I might consider disabling assertions by appending "-DNDEBUG" to CFLAGS and CXXFLAGS in the ebuild.
Hi Mike Refer to dev comment by ckerr here saying assertions should be disabled by default except in test builds: https://github.com/transmission/transmission/issues/4878#issuecomment-1430754614
Thanks, working on it now.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1a8e999e6dc14014054a72e2ebe3e9372624a22 commit b1a8e999e6dc14014054a72e2ebe3e9372624a22 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-02-16 16:16:43 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-02-16 16:16:43 +0000 net-p2p/transmission: disable assertions by default Upstream thinks assertions are only meant for "test builds". Closes: https://bugs.gentoo.org/893870 Signed-off-by: Mike Gilbert <floppym@gentoo.org> net-p2p/transmission/metadata.xml | 1 + .../{transmission-3.00-r5.ebuild => transmission-3.00-r6.ebuild} | 9 ++++++--- ...transmission-4.0.0-r3.ebuild => transmission-4.0.0-r4.ebuild} | 7 +++++-- net-p2p/transmission/transmission-9999.ebuild | 7 +++++-- 4 files changed, 17 insertions(+), 7 deletions(-)