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

toolkit does not correctly handle logical BuildRequires: #7570

Open
ddstreetmicrosoft opened this issue Jan 31, 2024 · 1 comment
Open

toolkit does not correctly handle logical BuildRequires: #7570

ddstreetmicrosoft opened this issue Jan 31, 2024 · 1 comment
Labels
bug Something isn't working Tools

Comments

@ddstreetmicrosoft
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

While rpm supports robust logical statements in dependency entries, our toolkit does not correctly support any logic statements except and. As explained in the docs:
https://github.com/microsoft/CBL-Mariner/blob/3.0-dev/toolkit/docs/how_it_works/3_package_building.md#rich-dependencies

Spec files can have (a b) style requirements. Depending on the condition the following will happen:

and, or, with: the build system will record both options into the graph so that all possible requirements will be made available to pick from during package install allowing for maximum flexibility. This means that the build system requires all optional RPMs to be available to build/download even if they will not be used for a specific configuration.
if: the build will record the requirement on the left side of the clause as a dependency. That means that the build system will require the package to be available to build/download even if it will not be used for a specific configuration.
else, unless, without, or multiple clauses of any kind: unsupported, the build will fail with an error.

While this documentation states that or, with, and if are supported, they are not actually supported correctly, as the handling of or and if does not actually match their documented operation; instead both or and if are treated by the toolkit as being and. Additionally, the handling of if is also incorrect as it simply ignores the if condition check.
 
Logical dependency operators are increasingly important to rpms and the toolkit needs to correctly support them; not doing so creates significant burden to ongoing development.

@ddstreetmicrosoft ddstreetmicrosoft added the bug Something isn't working label Jan 31, 2024
@ddstreetmicrosoft
Copy link
Contributor Author

@anphel31 anphel31 added the Tools label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Tools
Projects
None yet
Development

No branches or pull requests

2 participants