Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 893870 - net-p2p/transmission - disable assertions by default
Summary: net-p2p/transmission - disable assertions by default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-10 19:20 UTC by Aidan Marks
Modified: 2023-02-16 16:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aidan Marks 2023-02-10 19:20:07 UTC
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
Comment 1 Aidan Marks 2023-02-10 19:25:12 UTC
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.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-10 20:37:38 UTC
FWIW, it's more that we'd have a USE=debug for non-release.
Comment 3 Mike Gilbert gentoo-dev 2023-02-10 22:37:11 UTC
If you want to disable assertions, you can add -DNDEBUG via CFLAGS.

As far as optimizations, we also respect your CFLAGS for that.
Comment 4 Mike Gilbert gentoo-dev 2023-02-11 21:16:46 UTC
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.
Comment 5 Aidan Marks 2023-02-11 22:13:43 UTC
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
Comment 6 Mike Gilbert gentoo-dev 2023-02-11 22:32:01 UTC
> 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.
Comment 7 Aidan Marks 2023-02-16 09:49:51 UTC
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
Comment 8 Mike Gilbert gentoo-dev 2023-02-16 16:16:20 UTC
Thanks, working on it now.
Comment 9 Larry the Git Cow gentoo-dev 2023-02-16 16:21:31 UTC
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(-)