frontend, backend, rpmbuild: extract Exclu*Arch/BuildArch for all tar…#4135
frontend, backend, rpmbuild: extract Exclu*Arch/BuildArch for all tar…#4135praiskup wants to merge 2 commits intofedora-copr:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces significant improvements by enabling the extraction of architecture-specific tags (like ExclusiveArch, ExcludeArch, and BuildArch) from spec files for all target distributions. This is achieved through new functionality in rpmbuild/copr_rpmbuild/extract_specfile_tags.py and integration into rpmbuild/copr_rpmbuild/automation/srpm_results.py. The API versions between frontend and backend have been updated to support these changes, and the frontend now provides more detailed distribution information in the SRPM build record. Overall, this enhances the build process's ability to handle architecture-specific requirements more accurately.
| @property | ||
| def target_distros(self): | ||
| """ | ||
| Get the list of distributions we build this package against. | ||
| """ | ||
| # Handle distributions_in_build first to optimize a bit; the | ||
| # distributions_in_build is a subset of distributions_in_project | ||
| # and if available - we can avoid some macro expansion cycles. | ||
| for field_name in ["distributions_in_build", | ||
| "distributions_in_project"]: | ||
| if self.task[field_name]: | ||
| self.log.info("Using %s for this build.", field_name) | ||
| return self.task[field_name] | ||
| raise RuntimeError("Running against too old copr-frontend") |
There was a problem hiding this comment.
The target_distros property introduces a hard dependency on the frontend providing distributions_in_build or distributions_in_project fields. If an older frontend is used that does not supply this data, it will result in a RuntimeError and cause the build to fail. Consider implementing a more graceful fallback mechanism or a clearer version check at an earlier stage to prevent abrupt build failures for incompatible frontend versions.
| print("WARNING: Building for all architectures since " | ||
| f"the spec file parser: failed: {err}") |
There was a problem hiding this comment.
Using print for warnings or errors is not ideal for a production application, as it bypasses the standard logging infrastructure. Please replace this with a call to the logging module for consistent log handling and better integration with monitoring systems.
| print("WARNING: Building for all architectures since " | |
| f"the spec file parser: failed: {err}") | |
| logging.warning("WARNING: Building for all architectures since " | |
| f"the spec file parser: failed: {err}") |
Pull Request validationFailed🔴 Failed or pending checks:
🔴 Review - Missing review from a member (2 required) |
6697cfb to
c8deb74
Compare
|
/packit test |
c8deb74 to
0fc414c
Compare
|
/packit test |
0fc414c to
c68003d
Compare
|
/packit test |
c68003d to
e85a4cc
Compare
|
/packit test |
2 similar comments
|
/packit test |
|
/packit test |
5d1bf87 to
570a8e6
Compare
…gets
Relates: #1315
Relates: #4088