Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 808252 - media-libs/freetype: may fall back to bundled zlib (pass configure option to force system version)
Summary: media-libs/freetype: may fall back to bundled zlib (pass configure option to ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: bundled-libs
  Show dependency tree
 
Reported: 2021-08-15 01:42 UTC by Sam James
Modified: 2021-12-03 18:53 UTC (History)
3 users (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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-15 01:42:21 UTC
This is a bit of a weird one, but bear with me here.

In #gentoo, we've spent a lot of time debugging people trying to get around circular dependencies with harfbuzz and freetype. This sometimes results in incomplete dependencies (because of use of --nodeps), like sys-libs/zlib[-abi_x86_32] when trying to install media-libs/freetype[abi_x86_32].

Obviously, "supporting" --nodeps isn't really possible, but we noticed something interesting during investigating these cases: the build would fail due to a multilib header mismatch, not because of the missing dependency itself.

It appears media-libs/freetype will fallback to a bundled copy of zlib if --with-zlib=yes is not passed (https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/builds/unix/configure.raw#L346).

TL;DR: Could we explicitly add --with-zlib so that we *always* use the system copy, and bail out if it's not available?

This shouldn't make any difference to the actual installation of freetype given it's always required by the ebuild, but it makes debugging a lot easier.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-15 01:43:28 UTC
(In reply to Sam James from comment #0)
> [...]
> It appears media-libs/freetype will fallback to a bundled copy of zlib if
> --with-zlib=yes is not passed
> (https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/builds/unix/
> configure.raw#L346).
> 

(and if zlib isn't installed).

If zlib is around for one multilib variant and not the other, it'll mix-and-match, hence the confusing build failure rather than failing during configure.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-28 02:42:55 UTC
ping. This would help reduce confusion a fair bit when people are trying to get their way out of this rather common circular dependency. Any comments?
Comment 3 Larry the Git Cow gentoo-dev 2021-12-03 18:53:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e50955de6b05b0e38dfdef3b07f58aac560397ca

commit e50955de6b05b0e38dfdef3b07f58aac560397ca
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-03 18:52:49 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-03 18:52:49 +0000

    media-libs/freetype: forbid use of internal/bundled zlib
    
    This makes error messages far more explicit if people
    are trying to circumvent the common circular
    dependency b/t harfbuzz + freetype but don't
    have zlib installed (possibly just missing for one
    ABI: abi_x86_32).
    
    No functional change for when zlib is installed
    as per the ebuild's dependencies.
    
    Closes: https://bugs.gentoo.org/808252
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/freetype/freetype-2.11.1.ebuild | 1 +
 media-libs/freetype/freetype-9999.ebuild   | 1 +
 2 files changed, 2 insertions(+)