Skip to content

frontend, backend, rpmbuild: extract Exclu*Arch/BuildArch for all tar…#4135

Draft
praiskup wants to merge 2 commits intofedora-copr:mainfrom
praiskup:praiskup-exclude-exclusive-arch
Draft

frontend, backend, rpmbuild: extract Exclu*Arch/BuildArch for all tar…#4135
praiskup wants to merge 2 commits intofedora-copr:mainfrom
praiskup:praiskup-exclude-exclusive-arch

Conversation

@praiskup
Copy link
Member

@praiskup praiskup commented Jan 25, 2026

…gets

Relates: #1315
Relates: #4088

@praiskup praiskup marked this pull request as draft January 25, 2026 19:03
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +42 to +55
@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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Comment on lines +96 to +107
print("WARNING: Building for all architectures since "
f"the spec file parser: failed: {err}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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}")

@github-actions
Copy link

github-actions bot commented Jan 25, 2026

Pull Request validation

Failed

🔴 Failed or pending checks:

  • RPM package copr-rpmbuild[failure]
  • python-lint-job[failure]

🔴 Review - Missing review from a member (2 required)

@praiskup praiskup force-pushed the praiskup-exclude-exclusive-arch branch 5 times, most recently from 6697cfb to c8deb74 Compare January 30, 2026 15:37
@praiskup
Copy link
Member Author

/packit test

@praiskup praiskup force-pushed the praiskup-exclude-exclusive-arch branch from c8deb74 to 0fc414c Compare February 1, 2026 09:13
@praiskup
Copy link
Member Author

praiskup commented Feb 1, 2026

/packit test

@praiskup praiskup force-pushed the praiskup-exclude-exclusive-arch branch from 0fc414c to c68003d Compare February 1, 2026 14:17
@praiskup
Copy link
Member Author

praiskup commented Feb 1, 2026

/packit test

@praiskup praiskup force-pushed the praiskup-exclude-exclusive-arch branch from c68003d to e85a4cc Compare February 2, 2026 09:49
@praiskup
Copy link
Member Author

praiskup commented Feb 2, 2026

/packit test

2 similar comments
@praiskup
Copy link
Member Author

praiskup commented Feb 3, 2026

/packit test

@praiskup
Copy link
Member Author

praiskup commented Feb 3, 2026

/packit test

@praiskup praiskup force-pushed the praiskup-exclude-exclusive-arch branch from 5d1bf87 to 570a8e6 Compare February 5, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant