Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgdev tatt: Automatically satisfy REQUIRED_USE when generating --use-combos #148

Open
anthonyryan1 opened this issue Jul 17, 2023 · 5 comments
Assignees

Comments

@anthonyryan1
Copy link

anthonyryan1 commented Jul 17, 2023

I'm looking to exhaustively test all possible USE flag combinations on a package that has over 100 USE flags (www-servers/nginx).

As part of my work to fix https://bugs.gentoo.org/578658 I'm in the process of updating the ebuild to properly define all of the USE inter-dependencies using REQUIRED_USE, resulting in a almost 100 USE flag combination constraints.

If I run:

pkgdev tatt --use-combos 1000 --package www-servers/nginx --job-name nginx

Almost all of the generated USE flag combinations will fail to satisfy at least one REQUIRED_USE constraint, making it impossible to use this tool for testing all of the valid combinations.

I think it would be nice to update tatt to compare generated USE flag combinations against REQUIRED_USE and automatically add or remove from the randomly generated USE set to satisfy REQUIRED_USE.

This reduces randomness but ensures all combinations are valid.

The alternative, throwing away the USE flags and generating a new set until it passes REQUIRE_USE is going to be impossibly slow. On a package with 100 use flags that can each be enabled or disabled, we've got 2^100 possible combinations. With even a handful of REQUIRED_USE constraints it's going to be statistically impossible to guess a valid combination randomly.

@anthonyryan1 anthonyryan1 changed the title pkgdev tatt: Consider REQUIRED_USE when generating --use-combos pkgdev tatt: Automatically satisfy REQUIRED_USE when generating --use-combos Jul 17, 2023
@arthurzam
Copy link
Member

Can you please give me the ebuild, since I want to verify it. I'm preety sure I convert all REQUIRED_USE flags to correct constaints, making it always give correct answer if such exists? Running this command on my PC with current nginx ebuild finishs in milliseconds, so I suspect I need your ebuild.

@arthurzam arthurzam self-assigned this Jul 23, 2023
@thesamesam
Copy link
Member

(I was going to say - I thought pkgdev did this already.)

@anthonyryan1
Copy link
Author

You can see the ebuild I intend to test and upstream here:

https://github.com/anthonyryan1/gentoo/blob/ea7ddba658a1fcf89f4126c94a648957e9ff9566/www-servers/nginx/nginx-1.25.1-r4.ebuild

The failure may have to do with the fact that I'm defining REQUIRED_USE in a loop, which is a less common pattern but significantly simplifies the ebuild code for something with so many relationships.

@anthonyryan1
Copy link
Author

Also, to clarify:

tatt does complete in a reasonable amount of time without error. It's the nginx.sh file it generates that's failing. Virtually all combinations it generates with my command above are invalid USE flags combinations that fail to satisfy REQUIRED_USE constrains.

@arthurzam
Copy link
Member

Can you try once again with master branch? I think I might have fixed it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants