Please implement enforcing of REQUIRED_USE as a new FEATURES value, e.g.:
Having it would be really useful to do some live testing of the idea before it is included in a future EAPI. The implementation should be based on points 3.1&3.2 of GLEP 73 . The additional repoman checks are not strictly needed at the moment since they are implemented in pkgcheck already, and are part of the CI .
I've tried to do something myself but the dependency resolver code is horrible with all the autounmasking hacks. The algorithms themselves are already implemented stand-alone in . If necessary, I can reimplement them to fit Portage structures if you provide the necessary call sites.
FWICS, we need to start with the depgraph bit that verifies REQUIRED_USE, and add the conditional solving magic there, getting the relevant USE flag change in some additional variable (that is not stored permanently like autounmask changes). We should also be able to clearly distinguish those changes in the depgraph output (i.e. colorful with some magical symbols on the flags that changed).
I've started working on this. Seems like it shouldn't be too much work. Hopefully I can finish it by the end of next weekend.
(In reply to Michał Górny from comment #0)
> FWICS, we need to start with the depgraph bit that verifies REQUIRED_USE,
> and add the conditional solving magic there, getting the relevant USE flag
> change in some additional variable (that is not stored permanently like
> autounmask changes). We should also be able to clearly distinguish those
> changes in the depgraph output (i.e. colorful with some magical symbols on
> the flags that changed).
This can be handled similarly to how Package.use.mask/force are propagated to the depgraph output. It's just another thing for the config.setcpv() method to calculate that will get passed on to the Package instance. For any autounmask USE changes, the REQUIRED_USE solving algorithm will have to be re-applied in cases where it matters.
My work in progress is in this branch:
The tree structure returned from portage's check_required_use function has an ast property that yields an ast of the type used by the reference implementation.
I have started playing with the solver, and it appears to work nicely. Now I need to refactor it some. After that, I can make config.setcpv and depgraph._pkg_use_enabled methods use it. After that, I can update the merge list display to render the flag modifications somehow.