Skip to content

mock: simplify forcearch code#1668

Merged
praiskup merged 1 commit intorpm-software-management:mainfrom
praiskup:praiskup-force-arch-default
Dec 8, 2025
Merged

mock: simplify forcearch code#1668
praiskup merged 1 commit intorpm-software-management:mainfrom
praiskup:praiskup-force-arch-default

Conversation

@praiskup
Copy link
Member

@praiskup praiskup commented Dec 8, 2025

Mock now automatically maps the target build architecture directly to the
appropriate QEMU user-static binary variant for forcearch builds. For
example, fedora-43-riscv64 is mapped to /usr/bin/qemu-riscv64-static (see
the architecture string matches). Mock config contributors no longer need to
modify Mock code to add support for new architectures (if these architecture
specifiers match).

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 simplifies the forcearch implementation by removing the need for most explicit architecture mappings in the configuration. Instead, it dynamically constructs the QEMU binary path from the architecture name, falling back to this convention if a specific mapping isn't found. This is a solid improvement for maintainability and makes adding new architectures much easier.

My review focuses on two main points:

  1. The lack of tests for this significant logic change. I've added a comment in mock/py/mock.py about this.
  2. A minor clarification in the new release notes to avoid potential user confusion.

Overall, the change is good, but adding tests is crucial to ensure its correctness and prevent future regressions.

@praiskup praiskup force-pushed the praiskup-force-arch-default branch from 81e76f2 to 1337b5f Compare December 8, 2025 13:45
Copy link
Member

@xsuchy xsuchy left a comment

Choose a reason for hiding this comment

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

+1

@praiskup praiskup merged commit 10d6e89 into rpm-software-management:main Dec 8, 2025
32 checks passed
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.

2 participants