Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 616816 - media-libs/harfbuzz: add debug USE
Summary: media-libs/harfbuzz: add debug USE
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-28 09:25 UTC by rx80
Modified: 2018-10-26 09:41 UTC (History)
2 users (show)

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


Attachments
harfbuzz-1.4.6.ebuild (harfbuzz-1.4.6.ebuild,3.11 KB, text/plain)
2017-04-28 09:25 UTC, rx80
Details
harfbuzz-1.4.5.ebuild (harfbuzz-1.4.5.ebuild,3.10 KB, text/plain)
2017-04-28 09:26 UTC, rx80
Details
harfbuzz-9999.ebuild (harfbuzz-9999.ebuild,3.11 KB, text/plain)
2017-04-28 09:27 UTC, rx80
Details
harfbuzz-1.4.6.ebuild.patch (harfbuzz-1.4.6.ebuild.patch,1.29 KB, patch)
2017-04-28 16:13 UTC, rx80
Details | Diff
harfbuzz-1.4.5.ebuild.patch (harfbuzz-1.4.5.ebuild.patch,1.28 KB, patch)
2017-04-28 16:13 UTC, rx80
Details | Diff
harfbuzz-9999.ebuild.patch (harfbuzz-9999.ebuild.patch,1.29 KB, patch)
2017-04-28 16:14 UTC, rx80
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rx80 2017-04-28 09:25:55 UTC
Created attachment 471126 [details]
harfbuzz-1.4.6.ebuild

Since harfbuzz-1.2.3 -DNDEBUG and -DHB_NDEBUG can be defined:
https://github.com/behdad/harfbuzz/blob/master/NEWS#L235
"We now disable some time-consuming internal bookkeeping if built with NDEBUG
defined."

Attached ebuilds add "debug" use flag, and set cppflags accordingly.
Comment 1 rx80 2017-04-28 09:26:38 UTC
Created attachment 471128 [details]
harfbuzz-1.4.5.ebuild
Comment 2 rx80 2017-04-28 09:27:19 UTC
Created attachment 471130 [details]
harfbuzz-9999.ebuild
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2017-04-28 09:39:46 UTC
Please attach unified diffs of the changes you did to the ebuild(s).
Comment 4 rx80 2017-04-28 16:13:28 UTC
Created attachment 471148 [details, diff]
harfbuzz-1.4.6.ebuild.patch
Comment 5 rx80 2017-04-28 16:13:53 UTC
Created attachment 471150 [details, diff]
harfbuzz-1.4.5.ebuild.patch
Comment 6 rx80 2017-04-28 16:14:11 UTC
Created attachment 471152 [details, diff]
harfbuzz-9999.ebuild.patch
Comment 7 rx80 2017-04-28 16:19:43 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #3)
> Please attach unified diffs of the changes you did to the ebuild(s).

Done.
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2017-05-03 09:29:03 UTC
commit a363f5ee4c6ba40e2c0b28f62d8963d43fce6b41
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Wed May 3 11:28:11 2017

    media-libs/harfbuzz: Added "debug" USE flag (bug #616816).

    Package-Manager: Portage-2.3.5, Repoman-2.3.2

Thanks.
Comment 9 Mart Raudsepp gentoo-dev 2017-07-09 01:36:28 UTC
I'm a bit concerned about this change. NDEBUG also disables asserts, not just that bookkeeping. Additionally ChangeLog has this nugget right after that 1.2.3 release (so applies to all the next versions really):

commit 0c7fb7419c20d04b803412945565562c32b42929
Author: Behdad Esfahbod
Date:   Thu Feb 25 14:40:09 2016 +0900

    Speed up buffer variable allocation sanity check

    This makes defining HB_NDEBUG much less relevant, to the
    point of irrelevance.  Sorry about all the fuss in previous
    release!


So HB_NDEBUG disables costlier sanity checks, while NDEBUG disables asserts as well. I'm not so sure we should be disabling asserts here in a default USE case scenario. And that HB_NDEBUG is maybe not costly anymore since 1.2.4, but I don't have an issue with keeping that, if it does something.

Keep in mind that to see all the checks that are now getting disabled via NDEBUG, you need to grep for "assert", not "NDEBUG".
Comment 10 Mart Raudsepp gentoo-dev 2017-07-09 02:12:14 UTC
oh, and 1.2.4 NEWS says this as well:

- API changes:
  - Added HB_NDEBUG.  It's fine for production systems to define this to
    disable high-overhead debugging checks.  However, I also reduced the
    overhead of those checks, so it's a non-issue right now.  You can
forget it. Just not defining anything at all is fine.

To re-iterate, I'm fine with HB_NDEBUG and I'm not even sure we need a USE flag for disabling passing it. But libc asserts seem to be used in public facing API as a harfbuzz consuming higher level library/application developer safeguard, and if that's really the case (I didn't conclude something wrong from only a skimmed reading of some of the code), I really don't think we should ever be passing NDEBUG here. It makes developing harfbuzz using libraries/applications harder for negligible gain then.
Comment 11 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-10-26 09:41:10 UTC
commit 990066215cc033c6ef188676d541658aab1d9a4d
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Tue Jul 11 10:10:53 2017

    media-libs/harfbuzz: Don't mess wit NDEBUG (#616816#c10)
    
    Package-Manager: Portage-2.3.6, Repoman-2.3.2