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

Properly Version Build Dependencies for Azlinux #337

Merged

Conversation

adamperlin
Copy link
Contributor

What this PR does / why we need it:

Fixes #309 for azlinux targets. Currently, if version constraints are specified for build dependencies in the Dalec spec the dependencies are completely ignored when actually installing the packages with tdnf. However, the constraints are still emitted as BuildRequires in the generated RPM spec for the main package. This means that currently, we could run into cases where the versions of build dependencies installed by Dalec in the worker container would be incompatible with a user's constraints, causing rpmbuild to fail with no way for a user to acceptably resolve the issue without removing their build version constraints.

How it works
A build dependency for a Dalec package is essentially just a runtime package dependency for the worker container. Thus, we can simply create a meta-package (for azlinux, azlinux-build-dependencies), which has as its runtime dependencies the build dependencies specified in the dalec spec. We then install our build dependency package in the worker container and let the package manager handle the version constraints for us.

This bug has not yet been fixed for windows as those targets use a jammy worker container and thus will likely require building a .deb for build dependencies, functionality for which is pending with jammy support.

@adamperlin adamperlin requested a review from a team as a code owner July 29, 2024 22:59
@adamperlin adamperlin changed the title Adamperlin/version build dependencies Properly Version Build Dependencies Jul 29, 2024
@adamperlin adamperlin changed the title Properly Version Build Dependencies Properly Version Build Dependencies for Azlinux Jul 29, 2024
@adamperlin adamperlin requested a review from cpuguy83 July 29, 2024 23:00
test/azlinux_test.go Outdated Show resolved Hide resolved
frontend/azlinux/azlinux3.go Outdated Show resolved Hide resolved
frontend/azlinux/common.go Outdated Show resolved Hide resolved
@adamperlin adamperlin force-pushed the adamperlin/version-build-dependencies branch from 18c27be to d893268 Compare August 6, 2024 18:36
@cpuguy83
Copy link
Member

cpuguy83 commented Aug 6, 2024

Github says there is a conflict.

@adamperlin adamperlin merged commit db9a88b into Azure:main Aug 6, 2024
9 checks passed
@adamperlin adamperlin deleted the adamperlin/version-build-dependencies branch August 6, 2024 23:03
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

Successfully merging this pull request may close these issues.

[BUG] Constraints for build dependencies are ignored in the build env
2 participants