Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to solve Freetype and Harfbuzz circular dependencies
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
neyuru
Apprentice
Apprentice


Joined: 21 Mar 2020
Posts: 184

PostPosted: Tue Aug 24, 2021 11:24 pm    Post subject: How to solve Freetype and Harfbuzz circular dependencies Reply with quote

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:
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.

    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:
    emerge -aC media-libs/harfbuzz media-libs/freetype

    Step 3. Reinstall the same packages, this time with flag abi_x86_32 enabled:
    Code:
    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:
    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:
    (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
Back to top
View user's profile Send private message
alamahant
Veteran
Veteran


Joined: 23 Mar 2019
Posts: 1844

PostPosted: Wed Aug 25, 2021 9:23 pm    Post subject: Reply with quote

Thanks for that.
:)
Maybe you can classify it under "Tips and Tricks"
_________________
:)
Back to top
View user's profile Send private message
neyuru
Apprentice
Apprentice


Joined: 21 Mar 2020
Posts: 184

PostPosted: Sat Aug 28, 2021 7:06 am    Post subject: Reply with quote

I don't find any option to do so in the "edit" button :(
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 27288
Location: here

PostPosted: Sat Aug 28, 2021 7:39 am    Post subject: Reply with quote

Moved from Portage & Programming to Documentation, Tips & Tricks.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 17914

PostPosted: Sat Aug 28, 2021 4:09 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Panjoul
n00b
n00b


Joined: 03 Oct 2021
Posts: 7

PostPosted: Wed Oct 06, 2021 4:36 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
neyuru
Apprentice
Apprentice


Joined: 21 Mar 2020
Posts: 184

PostPosted: Sun Oct 17, 2021 8:40 pm    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum