Skip to content

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
from norpm.overrides import override_macro_registry
from norpm.exceptions import NorpmError

DEFAULT_OVERRIDE_URL = "https://raw.githubusercontent.com/praiskup/norpm-macro-overrides/refs/heads/main/distro-arch-specific.json"

Check warning

Code scanning / vcs-diff-lint

Line too long (131/120) Warning

Line too long (131/120)
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 +109
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 3 times, most recently from 55faf27 to e5cc54e Compare January 27, 2026 23:31
@praiskup praiskup force-pushed the praiskup-exclude-exclusive-arch branch from e5cc54e to 0fe4205 Compare January 30, 2026 14:54
@praiskup praiskup force-pushed the praiskup-exclude-exclusive-arch branch 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

The `main` variant (Rawhide) uses a locally created `make dist` tarball,
to work-around the current FTBFS against the newest GCC:

https://src.fedoraproject.org/rpms/hello/c/af27df4609302190668b8db4cb85380aab4f7795?branch=rawhide

Waiting for a new GNU Hello release:

https://savannah.gnu.org/bugs/?67961
@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

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