Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

How to solve Freetype and Harfbuzz circular dependencies

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
neyuru
Apprentice
Apprentice
Posts: 191
Joined: Sat Mar 21, 2020 6:51 am

How to solve Freetype and Harfbuzz circular dependencies

  • Quote

Post by neyuru » Tue Aug 24, 2021 11:24 pm

TL:DR feel free to skip to the next section for the solution

BACKGROUD

Many of us have experienced the problem of emerging a package (most commonly Wine) only to find that two of the dependencies (namely media-libs/harfbuzz and media-libs/freetype) depend on each other breaking the emerge command.

This is a common problem. A quick search in the nets returns instances of this problem as far back as last year. In Gentoo forums, the most commented topic about this has many ideas for how to solve this but, either they are specific to the O.P. or maybe some solutions are implicit or vague or solved the problem in a specific machine for a specific installation.

I believe to have found a more general solution that is applicable to most installations. But before we start on the solution, let me repeat that many will encounter this problem when installing wine for the first time. But the problem is not actually Wine. Some users have reported that this -hard-to-solve- circular dependency problem is present on fresh installs. As I can attest for this too. When issuing a

Code: Select all

emerge -aDNuv @world
on a fresh, clean, new install directly from a Gentoo "minimal installation" media. No additional packages were even installed by me (e.g. not one package in /var/lib/portage/world). For the circular dependency problem to be present. For me, this problem arised when choosing the default/linux/amd64/17.1/desktop/systemd (stable) profile. I adapted the solution from others and hopefully, generalized and made it more clear.

A PROPOSED SOLUTION

This solution assumes that media-libs/freetype is already compiled with the USE harfbuzz (as I believe most of us have done at some point in the past on our system). Also, that all packages involved in the problem have not been already compiled with the flag abi_x86_32. My best advice is to start fresh, that is, if you have already compiled such packages but exactly know what was recompiled w/abi_x86_32 (as can be backed up either on /etc/portage/package.use/package.use or /etc/portage/package.use/zz-autounmask or equivalent), go ahead and first undo those changes. Replace any instance of abi_x86_32 in those files for the contending packages with - abi_x86_32 and issue a emerge -aDNuv @world command. In any case, I believe the solution I suggest works for most users when first encountering the problem, but in a heavily modified or tweaked system this may not work.
  1. Step 1. If in a graphical setting, do not leave your system unattended, or else, disable your screensaver.
    Step2. Uninstall media-libs/harfbuzz and media-libs/freetype:

    Code: Select all

    emerge -aC media-libs/harfbuzz media-libs/freetype 
    Step 3. Reinstall the same packages, this time with flag abi_x86_32 enabled:

    Code: Select all

    USE="-truetype -harfbuzz abi_x86_32" emerge -a media-libs/harfbuzz media-libs/freetype
    On a multilib system, with default ABI=64, this will install both packages with both ABIs. This is the most important step as the circular dependency problem not only affects 64bit builds, but also 32bit builds. This command instructs portage to not use the flags that are the culprits for these two packages to intertwine. Some packages are going to be reinstalled with abi_x86_32 (requirements for freetype and harfbuzz, on a system-by-system basis)
    Step 4. Instruct portage to re-emerge only one package, this time with all flags permitted:

    Code: Select all

    USE="abi_x86_32" emerge -a --oneshot freetype
    This is necessary, as portage will pull media-libs/harfbuzz as a requirement, and will wait until the completion of the first emerge (harfbuzz) to issue the second one (freetype).
    Step 5. The next time you emerge the original offending pakcage (e.g. Wine) you might still see some circular dependencies but this time, portage will suggest a solution, e.g.:

    Code: Select all

    (sys-libs/gpm-1.20.7-r3:0/0::gentoo, ebuild scheduled for merge) depends on
     (sys-libs/ncurses-6.2-r1:0/6::gentoo, ebuild scheduled for merge) (buildtime_slot_op)
      (sys-libs/gpm-1.20.7-r3:0/0::gentoo, ebuild scheduled for merge) (buildtime)
    
    It might be possible to break this cycle
    by applying the following change:
    - sys-libs/ncurses-6.2-r1 (Change USE: -gpm)

    So go ahead and make portage happy by updating your package.use until there are no more conflicts found.
    Step 6. After the completion of the (Wine) emerge, undo the changes to the USE flags that caused circular dependencies in the previous step.
    Step 7. The installations in steps 3 - 5 issued temporal USE flags to portage. So you may want to make those changes permanent by updating your /etc/portage/package.use/package.use accordingly.
CONCLUDING REMARKS

In my journey with Gentoo, I have learned to annotate, every USE change to the system. Also, it is a good idea to not accept any "Would you like to add these changes to your config files?" issued by portage, but only if strictly necessary. And if so, place comments and separate on package.use or zz-autounmasks all these requirements if in the future, I want to undo some changes. The default behavior of portage is to append all new requirements on these files after each package wants them, but does not place any new lines. So, if you been accepting this messages many times for many packages it would be very difficult to discern which packages required which flags. UNLESS there is a feature that I don't know of.
Last edited by neyuru on Sat Aug 28, 2021 6:53 am, edited 1 time in total.
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Wed Aug 25, 2021 9:23 pm

Thanks for that.
:)
Maybe you can classify it under "Tips and Tricks"
:)
Top
neyuru
Apprentice
Apprentice
Posts: 191
Joined: Sat Mar 21, 2020 6:51 am

  • Quote

Post by neyuru » Sat Aug 28, 2021 7:06 am

I don't find any option to do so in the "edit" button :(
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Sat Aug 28, 2021 7:39 am

Moved from Portage & Programming to Documentation, Tips & Tricks.
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sat Aug 28, 2021 4:09 pm

neyuru wrote:I don't find any option to do so in the "edit" button :(
Correct. Moves are processed by administrators or moderators. However, you can expedite the process by using the "Report this topic" link to file a report in the Feedback area, and stating that you want your thread moved and the forum to which you want it sent. That flow is not required, since some moderators at least scan most threads, so a clear enough statement of your intent in the thread will also often get it moved. Reporting it may be faster than waiting for someone to happen by.
Top
Panjoul
n00b
n00b
Posts: 7
Joined: Sun Oct 03, 2021 3:15 pm

  • Quote

Post by Panjoul » Wed Oct 06, 2021 4:36 pm

This solution helps me with my problem on wine! thank you very much!

But on the Step 7:
"p 7. The installations in steps 3 - 5 issued temporal USE flags to portage. So you may want to make those changes permanent by updating your /etc/portage/package.use/package.use accordingly."

I dont understand this part, which package should i update? media-libs/harfbuzz and media-libs/freetype package? or a package that depends on that? and which USE flag should i use for update it?
Top
neyuru
Apprentice
Apprentice
Posts: 191
Joined: Sat Mar 21, 2020 6:51 am

  • Quote

Post by neyuru » Sun Oct 17, 2021 8:40 pm

Hello, sorry for the late reply:
Panjoul wrote:This solution helps me with my problem on wine! thank you very much!

But on the Step 7:
"p 7. The installations in steps 3 - 5 issued temporal USE flags to portage. So you may want to make those changes permanent by updating your /etc/portage/package.use/package.use accordingly."

I dont understand this part, which package should i update? media-libs/harfbuzz and media-libs/freetype package? or a package that depends on that? and which USE flag should i use for update it?
It means that you should update your /etc/portage/package.use/package.use to make the USE flags permanent on the packages that where updated in the steps 3 - 5. For example, the line

Code: Select all

abc-gentoo/package-fav option
would make the USE flag option "permanent" for the package abc-gentoo/package-fav. There are other files/ways to make USE changes "permanent" but this is the way I do it.
Top
sam_
Developer
Developer
User avatar
Posts: 2816
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Wed Mar 02, 2022 3:38 am

Just to append: the wiki has a page which handles this too which may be helpful for some.

Thanks for your post.
Top
wjb
l33t
l33t
User avatar
Posts: 681
Joined: Sun Jul 10, 2005 9:40 am
Location: Fife, Scotland

  • Quote

Post by wjb » Wed Mar 02, 2022 11:27 am

Sam, the problem with that wiki page is that it's not findable in the wiki search, e.g. go to wiki main page and search for circular dependency and it's none of the hits on the first page. Ditto if looking for harfbuzz or freetype. I think I'm suggesting moving the info to a main wiki page rather than what looks like your corner (?).

Incidentally, the first search does find your Summer of Code 2022 proposal for sorting the problem, which sounds quite cool.
Top
sam_
Developer
Developer
User avatar
Posts: 2816
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Thu Mar 03, 2022 6:00 pm

wjb wrote:Sam, the problem with that wiki page is that it's not findable in the wiki search, e.g. go to wiki main page and search for circular dependency and it's none of the hits on the first page. Ditto if looking for harfbuzz or freetype. I think I'm suggesting moving the info to a main wiki page rather than what looks like your corner (?).

Incidentally, the first search does find your Summer of Code 2022 proposal for sorting the problem, which sounds quite cool.
Agreed -- I'm speaking with maffblaster to find the best place to put it in the main namespace. But you're absolutely right. I'll add a redirect once that's done.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic