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

New {{ repo_arch }} variable usable instead of $basearch #1317

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

praiskup
Copy link
Member

@praiskup praiskup commented Feb 8, 2024

This fixes the native bootstrap preparation for cross-arch (emulated) builds.

@Conan-Kudo
Copy link
Member

$basearch is not valid for 32-bit x86 (i386 vs i586) and 32-bit ARM (armhfp vs arm7hl)

@praiskup
Copy link
Member Author

praiskup commented Feb 9, 2024

Ok, the basearch seems to be useless indeed. I think the current version of the patch could help, so we keep using native architecture for the bootstrap chroot, and emulated for target chroot. Even though... I don't get why mageia-8-x86_64 prepares the bootstrap correctly, but not mageia-8-armv7hl:

determining the fastest mirror (1 hosts).. done.
Mageia 8 - x86_64 - Updates                                                                                                                                                                                 2.6 kB/s | 1.5 kB     00:00    
Error: 
 Problem 1: conflicting requests
  - nothing provides python3-libcomps >= 0.1.8 needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
  - nothing provides python3-libdnf >= 0.57.0 needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
  - nothing provides python3-libmodulemd >= 2.9.3 needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
  - nothing provides python3-rpm >= 4.14.0 needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
  - nothing provides deltarpm needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
  - nothing provides python3-gpg needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
  - nothing provides python(abi) = 3.8 needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
  - nothing provides python3-hawkey >= 0.57.0 needed by python3-dnf-4.6.0-1.mga8.noarch from mageia
 Problem 2: conflicting requests
  - nothing provides python3-dbus needed by python3-dnf-plugins-core-4.0.19-1.mga8.noarch from mageia
  - nothing provides python(abi) = 3.8 needed by python3-dnf-plugins-core-4.0.19-1.mga8.noarch from mageia
  - nothing provides python3-hawkey >= 0.46.1 needed by python3-dnf-plugins-core-4.0.19-1.mga8.noarch from mageia
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

The very same on-host command is used:

- /usr/bin/dnf-3 --installroot /var/lib/mock/mageia-8-armv7hl-bootstrap/root/ --releasever 8 --setopt=deltarpm=False --setopt=allow_vendor_change=yes --allowerasing --disableplugin=local --disableplugin=spacewalk --disableplugin=versionlock install python3-dnf python3-dnf-plugins-core --setopt=tsflags=nocontexts
+ /usr/bin/dnf-3 --installroot /var/lib/mock/mageia-8-x86_64-bootstrap/root/  --releasever 8 --setopt=deltarpm=False --setopt=allow_vendor_change=yes --allowerasing --disableplugin=local --disableplugin=spacewalk --disableplugin=versionlock install python3-dnf python3-dnf-plugins-core --setopt=tsflags=nocontexts

The very same configuration is used, except for user_agent:

--- /var/lib/mock/mageia-8-armv7hl-bootstrap/root/etc/dnf/dnf.conf      2024-02-09 10:22:09.426386586 +0100
+++ /var/lib/mock/mageia-8-x86_64-bootstrap/root/etc/dnf/dnf.conf       2024-02-09 10:24:02.588258507 +0100
@@ -14,7 +14,7 @@
 metadata_expire=0
 best=1
 protected_packages=
-user_agent=Mock (mageia-8-armv7hl-bootstrap; armv7hl)
+user_agent=Mock (mageia-8-x86_64-bootstrap; x86_64)
 
 # repos

@Conan-Kudo
Copy link
Member

ping @pterjan

@Conan-Kudo
Copy link
Member

Mageia 8 is EOL anyway, so I'm a bit less concerned about it, but does this problem come up in Mageia 9?

@praiskup
Copy link
Member Author

praiskup commented Feb 9, 2024

Mageia 9 behaves the same:

DEBUG: Executing command: ['/usr/bin/dnf-3', '--installroot', '/var/lib/mock/mageia-9-armv7hl-bootstrap/root/', '--releasever', '9', '--setopt=deltarpm=False', '--setopt=allow_vendor_change=yes', '--allowerasing', '--disableplugin=local', '--disableplugin=spacewalk', '--disableplugin=versionlock', 'install', 'python3-dnf', 'python3-dnf-plugins-core', '--setopt=tsflags=nocontexts'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/var/lib/mock/mageia-9-armv7hl-bootstrap/root/installation-homedir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'LC_MESSAGES': 'C.UTF-8'} and shell False
 => Personality: None
No matches found for the following disable plugin patterns: local, spacewalk, versionlock
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

determining the fastest mirror (8 hosts).. done.                                                       [===                                                                                               ] ---  B/s |   0  B     --:-- ETA
Mageia 9 - x86_64                                                                                                                                                                                           2.2 kB/s | 2.5 kB     00:01    
determining the fastest mirror (2 hosts).. done.                                                       [      ===                                                                                         ] ---  B/s |   0  B     --:-- ETA
Mageia 9 - x86_64 - Updates                                                                                                                                                                                  50 kB/s | 1.0 MB     00:20    
Error: 
 Problem 1: conflicting requests
  - nothing provides python3-libcomps >= 0.1.8 needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
  - nothing provides python3-libdnf >= 0.66.0 needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
  - nothing provides python3-libmodulemd >= 2.9.3 needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
  - nothing provides python3-rpm >= 4.14.0 needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
  - nothing provides deltarpm needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
  - nothing provides python3-gpg needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
  - nothing provides python(abi) = 3.10 needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
  - nothing provides python3-hawkey >= 0.66.0 needed by python3-dnf-4.14.0-1.mga9.noarch from mageia
 Problem 2: conflicting requests
  - nothing provides python3-dbus needed by python3-dnf-plugins-core-4.3.1-1.mga9.noarch from mageia
  - nothing provides python(abi) = 3.10 needed by python3-dnf-plugins-core-4.3.1-1.mga9.noarch from mageia
  - nothing provides python3-hawkey >= 0.64.0 needed by python3-dnf-plugins-core-4.3.1-1.mga9.noarch from mageia
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

@Conan-Kudo
Copy link
Member

Conan-Kudo commented Feb 9, 2024

Is the bootstrap chroot supposed to use the native arch? That seems broken.

@praiskup
Copy link
Member Author

praiskup commented Feb 9, 2024

That is what we do for Fedora, so yes. Is there a reason why this shouldn't work for Mageia?

@praiskup
Copy link
Member Author

praiskup commented Feb 9, 2024

Hm, I think this happens because we set PER_LINUX32 personality for the x86_64 transaction.

praiskup added a commit to praiskup/mock that referenced this pull request Feb 9, 2024
This option is used for the cases when $basearch DNF native variable
doesn't work as expected in URLs.

On top of this, Mock uses `repo_arch` for `man 2 personality` decisions
for the bootstrap chroot installation which is supposed to be native.

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
@pep8speaks
Copy link

pep8speaks commented Feb 9, 2024

Hello @praiskup! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-02-12 10:34:58 UTC

praiskup added a commit to praiskup/mock that referenced this pull request Feb 9, 2024
This option is used for the cases when $basearch DNF native variable
doesn't work as expected in URLs.

On top of this, Mock uses `repo_arch` for `man 2 personality` decisions
for the bootstrap chroot installation (supposed to be native).

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
praiskup added a commit to praiskup/mock that referenced this pull request Feb 9, 2024
This option is used for the cases when $basearch DNF-native variable
doesn't work as expected in URLs.

On top of this ^^^, Mock newly uses `repo_arch` for the
`man 2 personality` decisions during the bootstrap chroot initialization
(bootstrap is expected to be native).

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
praiskup added a commit to praiskup/mock that referenced this pull request Feb 9, 2024
This option is used for the cases when $basearch DNF-native variable
doesn't work as expected in URLs.

On top of this ^^^, Mock newly uses `repo_arch` for the
`man 2 personality` decisions during the bootstrap chroot initialization
(bootstrap is expected to be native).

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
@praiskup
Copy link
Member Author

praiskup commented Feb 9, 2024

Can anyone test/check if this change is acceptable? Unfortunately, this is not just "config-only" patch.

@praiskup praiskup changed the title Magia: use $basearch instead of {{ target_arch }} in URLs New {{ repo_arch }} variable usable instead of $basearch Feb 9, 2024
praiskup added a commit to praiskup/mock that referenced this pull request Feb 9, 2024
This option is used for the cases when $basearch DNF-native variable
doesn't work as expected in URLs.

On top of this ^^^, Mock newly uses `repo_arch` for the
`man 2 personality` decisions during the bootstrap chroot initialization
(bootstrap is expected to be native).

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
@wally-mageia
Copy link
Contributor

Can anyone test/check if this change is acceptable? Unfortunately, this is not just "config-only" patch.

I have tested the changes and everything seems to be working at least with Mageia Cauldron x86_64 host. I tried to build pkgs for armvh7l, aarch64, i586, and x86_64.

praiskup added a commit to praiskup/mock that referenced this pull request Feb 9, 2024
This option is used for the cases when $basearch DNF-native variable
doesn't work as expected in URLs.

On top of this ^^^, Mock newly uses `repo_arch` for the
`man 2 personality` decisions during the bootstrap chroot initialization
(bootstrap is expected to be native).

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
praiskup added a commit to praiskup/mock that referenced this pull request Feb 9, 2024
This option is used for the cases when $basearch DNF-native variable
doesn't work as expected in URLs.

On top of this ^^^, Mock newly uses `repo_arch` for the
`man 2 personality` decisions during the bootstrap chroot initialization
(bootstrap is expected to be native).

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
@praiskup
Copy link
Member Author

praiskup commented Feb 9, 2024

Ok, thank you for checking. The last versions got fixes for Fedora builds (bootstrap image + multilib builds).

@praiskup
Copy link
Member Author

From the tests:

PASSED: mageia-10-i586.cfg (tmpfs)
PASSED: mageia-10-i586.cfg
PASSED: mageia-10-x86_64.cfg (tmpfs)
PASSED: mageia-10-x86_64.cfg
PASSED: mageia-8-i586.cfg (tmpfs)
PASSED: mageia-8-i586.cfg
PASSED: mageia-8-x86_64.cfg (tmpfs)
PASSED: mageia-8-x86_64.cfg
PASSED: mageia-9-i586.cfg (tmpfs)
PASSED: mageia-9-i586.cfg
PASSED: mageia-9-x86_64.cfg (tmpfs)
PASSED: mageia-9-x86_64.cfg
PASSED: mageia-cauldron-i586.cfg (tmpfs)
PASSED: mageia-cauldron-i586.cfg
PASSED: mageia-cauldron-x86_64.cfg (tmpfs)
PASSED: mageia-cauldron-x86_64.cfg

But we do not test --forcearch builds. These were tested manually by @wally-mageia

This option is used for the cases when $basearch DNF-native variable
doesn't work as expected in URLs.

Mock now also uses the `repo_arch` values for the `man 2 personality`
decisions during the bootstrap chroot initialization, as bootstrap is
is almost always expected to be "host-native".

Closes: rpm-software-management#1317
Fixes: rpm-software-management#1304
@praiskup praiskup merged commit f28e3cd into rpm-software-management:main Feb 12, 2024
19 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.

None yet

4 participants