Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USE dependencies
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
wanne32
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2023
Posts: 81

PostPosted: Fri Jan 10, 2025 8:35 am    Post subject: USE dependencies Reply with quote

Every time i update @wolrd I spent half a day manually playing SAT solver for USE-dependencies on USE-Flags creating an larger and larger /etc/portage/package.use/zzz file preventing me using more and more binary packages.
Especially since emerge dosn't understand the difference between USE-Flags I put there because I need it and USE-Flags that are mere dependencies and should be removed with depclean when they are no longer needed.
I don't care if dev-qt/qtbase is build with gles2-only or -gles2-only. But emerge suggesting putting an infinit amount of lines that contradict the one before is less than helpful.
Is there any proper dependency solver or at least a proper machine readable output for all dependencies so that i can write my own one?
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1842
Location: Germany

PostPosted: Fri Jan 10, 2025 8:43 am    Post subject: Reply with quote

This sounds to me you are doing indivdual settings, which lead into doing more individual stuff.

So maybe you can provide an example with output which tells us what are your problems/wishes
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
wanne32
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2023
Posts: 81

PostPosted: Fri Jan 10, 2025 9:12 am    Post subject: Reply with quote

I think the problem is not to complicated to understand. And of course the problem is now solved again manually and I am not that eager recompiling hundreds of packages to reproduce it.
There are a few different packages. A few require (over 5 edges) dev-qt/qtbase with gles2-only the others without.
I the end the solution was to compile media-video/pipewire and media-video/ffmpeg without v4l since I do not need that. But of course
emerge --update --deep --with-bdeps=y --ask @world
was never suggesting that instead first suggesting to add
>=dev-qt/qtbase-5.15.16 gles2-only to
/etc/portage/package.use/zzz
When I add that it will suggest to add
>=dev-qt/qtbase-5.15.16 -gles2-only
/etc/portage/package.use/zzz
and so on
What question do you have?
Back to top
View user's profile Send private message
nicop
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2014
Posts: 105

PostPosted: Fri Jan 10, 2025 2:07 pm    Post subject: Reply with quote

Although I wonder why I am responding to this thread, here is what others could read :

Some packages from dev-qt have "hard-links" for useflags (eg. opengl,gles2-only) and sometimes backtrack fails :
dev-qt/multimedia have dev-qt/qtgui:6[gles2-only=,png=,X?]
dev-qt/qtopengl have dev-qt/qtgui:6[gles2-only=] and dev-qt/qtwidgets:6[gles2-only=]
and so on for dev-qt/qtbase

My personal (and possibly ugly) solution is to apply useflags to the entire category :
dev-qt/* -gles2-only

For your example, media-libs/libv4l have this dep with qt6 enabled : dev-qt/qtbase:6[gui,opengl,widgets,-gles2-only]
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2624

PostPosted: Fri Jan 10, 2025 2:39 pm    Post subject: Reply with quote

I suggest moving zzz out of package.use/accept_keywords and starting over. Post problematic output, point out what's problematic and we will take over from there.

Your explanation is very unclear, but it sounds like you are getting repeated contradicting outputs from emerge for one and the same package, one time enable this, one time disable this. That suggests you may have something you should not have in world or package.mask/accept_keywords/use.

You don't need to recompile hundreds of packages to diagnose this issue, just replace --ask with --pretend and post wgetpastes.

I understand your frustration but if you don't want to do that to diagnose your issue, posts like that are completely unnecessary.

Best Regards,
Georgi
Back to top
View user's profile Send private message
wanne32
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2023
Posts: 81

PostPosted: Thu Jan 16, 2025 1:58 am    Post subject: Reply with quote

Sorry for not answering so long.
But again: Yes of course deleting zzz and searching manually for a solution that solves the problem.
I know exactly where this discussion is going if I post this output: Suggestions how to add use flags to satisfy all dependencies.
As I said I already found one without conflicting USE-Flags.
I do not want a solution for that particular problem. I want a general way to find solutions that satisfy all dependencies depending on my USE-Flag preference.


Quote:
My personal (and possibly ugly) solution is to apply useflags to the entire category :

The general scenario is that I have a few programs that still need X11, 32Bit and vaapi.
So I could in theory just add X, abi_x86_32 vaapi and opengl to everything and be fine.
But I do like that I most Programms are running without since this enables the possibility to copy them to my multimedia PC without recompiling that does not support either of these. (And I don't intend to change that. I like it minimalistic 64Bit/OpenGL ES/Vulkan/wayland only how it ist ;-).) Also compile time would go up significantly.
So I have to manually add the matching flags to a few programs but then I have to meet the dependencies, since emerge doesn't solves use-Flag dependencies automatically. Just suggests a solution to the immediate problem without checking if it leads to other conflicts.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20580

PostPosted: Thu Jan 16, 2025 4:26 am    Post subject: Reply with quote

wanne32 wrote:
I do not want a solution for that particular problem. I want a general way to find solutions
The general solution is to understand the output and come to the solution. If you don't understand the output of x, y, z, then it is difficult to explain what the solution is without that output.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2624

PostPosted: Thu Jan 16, 2025 8:05 am    Post subject: Reply with quote

pjp wrote:
wanne32 wrote:
I do not want a solution for that particular problem. I want a general way to find solutions
The general solution is to understand the output...


Rather the reasons behind that output.

wanne32 wrote:

I do not want a solution for that particular problem. I want a general way to find solutions that satisfy all dependencies depending on my USE-Flag preference.


If you won't play along, it's useless to start threads. In fact I hesitated to replay to you because you're one of those users that eventually will annoy me enough to make me start maintaining a list of users for whom I won't waste my time.

Now if you will, please give me something to work on or get at the top of that list.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9625
Location: beyond the rim

PostPosted: Thu Jan 16, 2025 10:55 am    Post subject: Reply with quote

wanne32 wrote:
I do not want a solution for that particular problem. I want a general way to find solutions that satisfy all dependencies depending on my USE-Flag preference.

There is no such thing as portage is not a mind-reading tool.


Quote:
So I have to manually add the matching flags to a few programs but then I have to meet the dependencies, since emerge doesn't solves use-Flag dependencies automatically. Just suggests a solution to the immediate problem without checking if it leads to other conflicts.

There are always at least two ways to solve a specific single USE-flag conflict (remove flag A or add flag B). Portage cannot assume which option you'd prefer. Therefore it provides you with the information to decide for yourself. If you don't like making decisions then maybe Gentoo is the wrong distribution for you.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2624

PostPosted: Thu Jan 16, 2025 12:52 pm    Post subject: Reply with quote

Genone wrote:
wanne32 wrote:
I do not want a solution for that particular problem. I want a general way to find solutions that satisfy all dependencies depending on my USE-Flag preference.

There is no such thing as portage is not a mind-reading tool.


Quote:
So I have to manually add the matching flags to a few programs but then I have to meet the dependencies, since emerge doesn't solves use-Flag dependencies automatically.


To add to Genone's response, emerge does, but you don't know how to talk its language.

Best Regards,
Georgi
Back to top
View user's profile Send private message
wanne32
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2023
Posts: 81

PostPosted: Fri Jan 17, 2025 3:21 pm    Post subject: Reply with quote

> There is no such thing as portage is not a mind-reading tool.
SAT-Solving is hard. Even NP hard. But not as hard as mind reading. :wink:
> To add to Genone's response, emerge does, but you don't know how to talk its language.
This is the reason why I am asking here.

Again this is a very very easy question: I give emerge a set of USE-flags for a few packages. I want a set of USE-flags back so that there are no conflicting USE-flag requirements. Preferably a set as small set as possible.

If it's so easy why can no one answer the question how to do it?! Instead of talking around about things that are totally irrelevant to that problem?


By default emerge already does something like that: It recognizes conflicts and proposes one solution to that problem. So most of the time you can just play outer loop and call emerge often enough an do what it suggests but neither is that satisfying to call emerge over and over again and copy and paste what it suggests nor will it always find a solution, since you have to do backtracking if you choose the wring of multiple solutions.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54733
Location: 56N 3W

PostPosted: Fri Jan 17, 2025 3:26 pm    Post subject: Reply with quote

wanne32,

It can't be done as portage cannot make choices for you.
As the system architect, that's your job.

Gentoo gives you the tools to configure and install your very own Linux distro.
It expects you to use them to express your choices/decisions.
Portage can give you hints, which can be wrong.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2624

PostPosted: Fri Jan 17, 2025 4:07 pm    Post subject: Reply with quote

wanne32 wrote:

If it's so easy why can no one answer the question how to do it?! Instead of talking around about things that are totally irrelevant to that problem?


If you're so aware of what's relevant, why haven't you found the solution yet?

Do you really think that no one would have already given you the solution you're looking for if it existed?

wanne32 wrote:

By default emerge already does something like that: It recognizes conflicts and proposes one solution to that problem. So most of the time you can just play outer loop and call emerge often enough an do what it suggests but neither is that satisfying to call emerge over and over again and copy and paste what it suggests nor will it always find a solution, since you have to do backtracking if you choose the wring of multiple solutions.


That's absolutely the wrong path to follow.

You have one last chance to allow me to find out what the real problem is. For that, next time you hit the issue, I need the output I asked for above with --pretend option mandatory, so nothing changes while I investigate.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9625
Location: beyond the rim

PostPosted: Fri Jan 17, 2025 5:42 pm    Post subject: Reply with quote

wanne32 wrote:
> There is no such thing as portage is not a mind-reading tool.
SAT-Solving is hard. Even NP hard. But not as hard as mind reading. :wink:

The mind-reading part is to figure out how to weight each USE flag. If you specify USE="A B C" and flag C then requires also "X Y Z" which in turn pull in dependencies with multi-hour build times or which are otherwise problematic, in many cases people will opt to remove flag C instead. But that is a decision the user has to make, not one that can be made by tools. Not for technical reasons but for semantics.
Back to top
View user's profile Send private message
wanne32
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2023
Posts: 81

PostPosted: Sat Jan 18, 2025 11:16 am    Post subject: Reply with quote

Quote:
in many cases people will opt to remove flag C instead. But that is a decision the user has to make
No the user dosn't has to. It is a nice thing to be able to. But of course a tool can make a decision. – Or even suggest multiple. For dpkg apt-get does the first one aptitude the later. But there things are much easier because you have much less dependencies and almost no or-dependencies. So it is almost always uninstall one package or install all dependencies. But for bigger updates there are quite a lot of options. If you have already a lot of qt stuff, you likely want pinentry-qt. If you are running gnome... But you can do it the other way around or use the curses one. Also emerge does this for "normal" dependencies it just installs all the required dependencies without --ask even without asking. But not for dependencies of specific USE flags.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54733
Location: 56N 3W

PostPosted: Sat Jan 18, 2025 11:32 am    Post subject: Reply with quote

wanne32,

Now you want portage to work like a chess engine.
'Guess' at a solution to the first problem and proceed on that basis ... and so on recursively.
How long do you want to wait for a solution that you don't like?

Dependency resolution is already over an hour on low end hardware, without any 'guesses'.

The problems arise for users setting per package USE flags without understanding that USE flags cannot be set on a per package basis in isolation.
Portages --autounmask feature should never be used without understanding the deeper effects of what it will do.
That means in most cases, don't use it. It can dig a bigger hole than you are already in.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
wanne32
Tux's lil' helper
Tux's lil' helper


Joined: 11 Nov 2023
Posts: 81

PostPosted: Sat Jan 18, 2025 11:45 am    Post subject: Reply with quote

NeddySeagoon wrote:
How long do you want to wait for a solution that you don't like?
Since I can do it in a few minutes/hours a computer should do be able to do it in a fraction of a second. As a proper chess engine can beat me in a few seconds.
Quote:
Dependency resolution is already over an hour on low end hardware, without any 'guesses'.
Not here.
Quote:
The problems arise for users setting per package USE flags without understanding that USE flags cannot be set on a per package basis in isolation.
And how do you suggest running 32Bit programs? Compile everything for 32Bit? Ok. I know: Don't run them. But you can not fix the whole world.
Quote:
Portages --autounmask feature should never be used without understanding the deeper effects of what it will do.
That seems quite the thing that I was searching for. What do you mean with it can cause bigger problems?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54733
Location: 56N 3W

PostPosted: Sat Jan 18, 2025 12:53 pm    Post subject: Reply with quote

wanne32,

Low end hardware means an AMD E350 ... it takes over an hour to work out what to do.
Raspberry Pis can take a lot longer.
My AMD 5950X is a lot faster.

Quote:
And how do you suggest running 32Bit programs?

Understand what you do when you set per package ABI.
Don't let portage 'guess'. Use --autounmask --pretend if you want some hints, but never just do it.

NeddySeagoon wrote:
Portages --autounmask feature should never be used without understanding the deeper effects of what it will do.
"wanne32 wrote:
That seems quite the thing that I was searching for. What do you mean with it can cause bigger problems?

Isn't that what this topic is all about, the bigger problems?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5323
Location: Bavaria

PostPosted: Sat Jan 18, 2025 1:11 pm    Post subject: Reply with quote

wanne32 wrote:
Quote:
in many cases people will opt to remove flag C instead. But that is a decision the user has to make
No the user dosn't has to. It is a nice thing to be able to. But of course a tool can make a decision. [...]

We have such a tool ... it is called "profile" ;-) ... you select a profile and get a precisely tailored system ... just like the car you order. But if you install a different engine in your car, you need to know for yourself whether your brakes and tires are still sufficient for this more powerful engine. But you can also ask an expert. But your car can't tell you.

I can only recommend one thing: Make as few changes as possible. And always weigh up whether you want to change something globally or only for a specific package. Two examples:

1) I don't have Bluetooth and therefore I CAN switch it off GLOBALLY:
Code:
USE="-bluetooth ...”

2) I need a static busybox and I have added in my package.use:
Code:
sys-apps/busybox -pam static

These two use-flags global would destroy the system.

What else I recommend: BEFORE you activate (or deactivate) a use-flag globally you should check what it changes, e.g.
Code:
USE="-pam" emerge -uUDvp @world

This will immediately show you that you should/can never do this.

... and yes, I am also not a fan of "autunmask" ... and I never used it 8)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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