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.
Created attachment 471128 [details] harfbuzz-1.4.5.ebuild
Created attachment 471130 [details] harfbuzz-9999.ebuild
Please attach unified diffs of the changes you did to the ebuild(s).
Created attachment 471148 [details, diff] harfbuzz-1.4.6.ebuild.patch
Created attachment 471150 [details, diff] harfbuzz-1.4.5.ebuild.patch
Created attachment 471152 [details, diff] harfbuzz-9999.ebuild.patch
(In reply to Lars Wendler (Polynomial-C) from comment #3) > Please attach unified diffs of the changes you did to the ebuild(s). Done.
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.
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".
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.
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