Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 830966 - media-libs/harfbuzz-3.1.1[truetype] fails to find media-libs/freetype-2.11.0-r1 with binpkgs
Summary: media-libs/harfbuzz-3.1.1[truetype] fails to find media-libs/freetype-2.11.0-...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-10 22:05 UTC by Sebastian Pipping
Modified: 2023-01-21 15:34 UTC (History)
4 users (show)

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


Attachments
Build log (harfbuzz-3.1.1:20220110-211209.log,4.74 KB, text/x-log)
2022-01-10 22:05 UTC, Sebastian Pipping
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Pipping gentoo-dev 2022-01-10 22:05:37 UTC
Created attachment 761830 [details]
Build log

Hi!

The fail part of the build log is this:

  Run-time dependency freetype2 found: NO (tried pkgconfig and cmake)                                                                                                                          
  Run-time dependency freetype2 found: NO (tried pkgconfig and cmake)                                                                                                                          
  Looking for a fallback subproject for the dependency freetype2                                                                                                                               

  ../harfbuzz-3.1.1/meson.build:89:4: ERROR: Automatic wrap-based subproject downloading is disabled

Any idea what may be causing this?

The emerge output --tree output contained this:

  [ebuild  N     ]  media-libs/harfbuzz-3.1.1:0/3.0.0::gentoo  USE="cairo glib graphite icu introspection truetype -debug -doc -experimental -test" ABI_X86="32 (64) (-x32)" 0 KiB             
  [binary   R    ]   media-libs/freetype-2.11.0-r1-1:2::gentoo  USE="X adobe-cff bzip2 cleartype-hinting harfbuzz* png static-libs -brotli -debug -doc -fontforge (-infinality) -utils" ABI_X86="32 (64) (-x32)" 0 KiB

Best, Sebastian
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-10 22:12:38 UTC
Could you include:
A full log can be found at /var/tmp/portage/media-libs/harfbuzz-3.1.1/work/harfbuzz-3.1.1-abi_x86_32.x86/meson-logs/meson-log.txt?
Comment 2 Sebastian Pipping gentoo-dev 2022-01-10 23:16:51 UTC
Hi Sam, I no longer have the original build file and after deleting the involved binary package in the mean time, the error no longer occurs in that setup, not sure why.  Should we close the ticket?
Comment 3 Tom Gillespie 2022-01-26 06:46:53 UTC
I'm seeing a similar error when trying to build harfbuzz-3.1.2 with freetype-2.11.0-r1 installed on musl. Updating to freetype-2.11.1 fixes the issue. The circular deps here mean that if it were possible to force harfbuzz to be keyworded to match freetype keywording we could protect users from this issue.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-26 06:54:19 UTC
(In reply to Sebastian Pipping from comment #2)
> Hi Sam, I no longer have the original build file and after deleting the
> involved binary package in the mean time, the error no longer occurs in that
> setup, not sure why.  Should we close the ticket?

No worries!

(In reply to Tom Gillespie from comment #3)
> I'm seeing a similar error when trying to build harfbuzz-3.1.2 with
> freetype-2.11.0-r1 installed on musl. Updating to freetype-2.11.1 fixes the
> issue. The circular deps here mean that if it were possible to force
> harfbuzz to be keyworded to match freetype keywording we could protect users
> from this issue.

It's not clear to me why that's needed though. I can't reproduce the issue if I downgrade and I don't see anything obvious in the commits.

Obviously we could change the minimum version in the dependencies but I can't see any justification for doing that right now.

Are you able to reproduce & grab the meson log?
Comment 5 Tom Gillespie 2022-02-14 02:35:18 UTC
tl;dr: harfbuzz meson assumes that harfbuzz.pc is already present if
freetype +harfbuzz is installed. This is assumption is violated by
binpkg installs.

It is possible to install freetype with harfbuzz support enabled and
package it. Once installed from a package harfbuzz will try to build
with truetype support enabled, however meson assumes that
/usr/lib/pkgconfig/harfbuzz.pc is already present on the system (how
else would you have built freetype? who packages things?), however
when installing freetype with harfbuzz support from a binpkg harfbuzz
itself does not need to be present on the system.

The solution is to install BOTH freetype -harfbuzz AND harfbuzz -truetype
on the system. That way when rebuilding harfbuzz +truetype pkg-config
called by meson can find harfbuzz.pc.

For binpkg installs it is possible to install freetype +harfbuzz and
then sequentially install harfbuzz -freetype followed immediately by
harfbuzz +freetype.

It might be possible to bypass this issue by somehow pointing
pkg-config to the copy of harfbuzz.pc in the built tree?
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-19 01:42:15 UTC
Wonder if by chance https://github.com/harfbuzz/harfbuzz/commit/53a194aa3f5f7de0b40e879e41fcbe0de6e9fefe helps at all.
Comment 7 Larry the Git Cow gentoo-dev 2022-11-10 05:14:18 UTC
The bug has been referenced in the following commit(s):

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

commit 9e5d8576d295164bc6dc9873e68ed94fd46968cf
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-10 05:13:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-10 05:14:03 +0000

    media-libs/harfbuzz: backport fix for icu/freetype detection
    
    Bug: https://bugs.gentoo.org/830966
    Closes: https://bugs.gentoo.org/880405
    Closes: https://bugs.gentoo.org/880479
    Thanks-to: Eli Schwartz <eschwartz93@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/harfbuzz-5.3.1-meson-freetype-icu.patch  | 120 +++++++++++++++++++++
 media-libs/harfbuzz/harfbuzz-5.3.1-r1.ebuild       | 104 ++++++++++++++++++
 2 files changed, 224 insertions(+)
Comment 8 Willard Dawson 2023-01-21 15:34:52 UTC
Thank you, Tom Gillespie, for your comment #5 on this topic. That has helped me tremendously. Unfortunately, this is a recurring problem. Every time either freetype or harfbuzz is updated, I have to follow that sequence of re-emerging to get past the blocking. It would be truly great if this problem were resolved either upstream or with creative ideation on the Gentoo level to avoid having to resort to these tricks.