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

Mageia 8, 9 and cauldron configuration files for aarch64 and armv7hl need to be updated #1304

Closed
katnatek opened this issue Feb 3, 2024 · 12 comments

Comments

@katnatek
Copy link

katnatek commented Feb 3, 2024

Short description of the problem

The users of mageia 9 and cauldron can't build for aarch64 and armv7hl for mageia 8,9 & cauldron with the currtent configuration in mageia-8-aarch64.cfg , mageia-8- armv7hl.cfg , mageia-9-aarch64.cfg , mageia-9- armv7hl.cfg , mageia-cauldron-aarch64.cfg & mageia-cauldron- armv7hl.cfg

Output of rpm -q mock

OUTPUT HERE
mock-5.1.1-1.mga9

Steps to reproduce issue

See https://bugs.mageia.org/show_bug.cgi?id=32620

Any additional notes

One of our packagers found the solution https://bugs.mageia.org/show_bug.cgi?id=32620#c44

The line
config_opts['bootstrap_forcearch'] = '{{ target_arch }}'

Need to be added before the line
include('templates/mageia-branched.tpl')

@filochard
Copy link

Nota Bene :
in mock-core-configs/etc/mock
for each mageia version (n = 8, or 9, or cauldron) and each arch ({arch} = aarch64 , or armv7hl) there are 3 flavours
mageia -n-{arch}.cfg
mageia -n-{arch}-nonfree.cfg
mageia -n-{arch}-tainted.cfg

That means 18 cfg files to modify ....
Thanks

@Conan-Kudo
Copy link
Member

The non-free/tainted configs are not in this repository, they are part of mock-mageia-configs that builds on top of mock-core-configs.

@filochard
Copy link

The non-free/tainted configs are not in this repository, they are part of mock-mageia-configs that builds on top of mock-core-configs.

Sorry for the mistake

@wally-mageia
Copy link
Contributor

During my local tests I didn't see any harm or drawbacks if only template files templates/mageia-*.tpl were modified with
config_opts['bootstrap_forcearch'] = '{{ target_arch }}'

In that way only a few files needs to be modified and native x86_64 builds works as well as i586/armv7hl/aarch64 builds on x86_64 host.

wally-mageia added a commit to wally-mageia/mock that referenced this issue Feb 4, 2024
Even though Mageia 7 is EOL fix:
- use bugfix release 7.1 as `$releasever`
- mirror url as Mageia 7 mirror is only available in distrib-coffee archive
- build bootstrap chroots with target arch rpm-software-management/issues/1304
wally-mageia added a commit to wally-mageia/mock that referenced this issue Feb 4, 2024
Even though Mageia 7 is EOL fix:
- use bugfix release 7.1 as `$releasever`
- mirror url as Mageia 7 mirror is only available in distrib-coffee archive
- build bootstrap chroots with target arch rpm-software-management/issues/1304
wally-mageia added a commit to wally-mageia/mock that referenced this issue Feb 4, 2024
Even though Mageia 7 is EOL fix:
- use bugfix release 7.1 as `$releasever`
- mirror url as Mageia 7 mirror is only available in distrib-coffee archive
- build bootstrap chroots with target arch (fixes rpm-software-management#1304)
@filochard
Copy link

During my local tests I didn't see any harm or drawbacks if only template files templates/mageia-*.tpl were modified with config_opts['bootstrap_forcearch'] = '{{ target_arch }}'

In that way only a few files needs to be modified and native x86_64 builds works as well as i586/armv7hl/aarch64 builds on x86_64 host.

Thanks to Wally for his work on this :
he simplified widely the correction to bring
I have tested the additionof this line :
config_opts['bootstrap_forcearch'] = '{{ target_arch }}'
in mageia-branched.tpl
and in mageia-cauldron.tpl

Mock works now for Mageia-9 and Mageia-cauldron for all the arches and for all the flavors (core, nonfree and tainted)

@praiskup
Copy link
Member

praiskup commented Feb 5, 2024

Thank you for the discussion here, folks!

We should first identify the reason why we need to override bootstrap_forcearch because it is a really weird requirement. Typically you install a native bootstrap chroot, and using the native tooling in bootstrap you install the --forcearch target chroot.

@filochard
Copy link

Thank you for the discussion here, folks!

We should first identify the reason why we need to override bootstrap_forcearch because it is a really weird requirement. Typically you install a native bootstrap chroot, and using the native tooling in bootstrap you install the --forcearch target chroot.

Hi
we have been struggling for weeks to understand why mock 5.1.1 inside a Mageia9 system couldn't build rpms for arm arches for Mageia :
It failed immediately when attempting to fulfill the bootstrap for arm arches when it worked correctly for other arches
https://bugs.mageia.org/show_bug.cgi?id=32607
https://bugs.mageia.org/show_bug.cgi?id=32620
NB Previously there were no problem with mock 3.5 inside a Mageia9 system until it was updated to 5.1.1 !

Wally finally found a simple workaround by adding one line in the 2 mageia templates :
config_opts['bootstrap_forcearch'] = '{{ target_arch }}'
Now mock works perfectly for each arm for each Mageia version and each Mageia flavor...

This modification concerns only Mageia templates and is necessary for Mageia to build rpms for arm arches ! If it is not added upstream we will need to use a patch for mageia-core-configs !

@katnatek
Copy link
Author

katnatek commented Feb 5, 2024

Thank you for the discussion here, folks!

We should first identify the reason why we need to override bootstrap_forcearch because it is a really weird requirement. Typically you install a native bootstrap chroot, and using the native tooling in bootstrap you install the --forcearch target chroot.

Maybe I need to explain better the issue, sorry bug reporting and english redaction are my kryptonite XD

In Mageia 9 we can't build for aarch64 and armv7hl from x86_64 systems since the update to mock 5.1.1, so is not native build, Jani Välimaa find why https://bugs.mageia.org/show_bug.cgi?id=32620#c33 , https://bugs.mageia.org/show_bug.cgi?id=32620#c35 , https://bugs.mageia.org/show_bug.cgi?id=32620#c44

wally-mageia added a commit to wally-mageia/mock that referenced this issue Feb 5, 2024
Even though Mageia 7 is EOL fix:
- use bugfix release 7.1 as `$releasever`
- mirror url as Mageia 7 mirror is only available in distrib-coffee archive
- build bootstrap chroots with target arch (fixes rpm-software-management#1304)
@wally-mageia
Copy link
Contributor

Thank you for the discussion here, folks!

We should first identify the reason why we need to override bootstrap_forcearch because it is a really weird requirement. Typically you install a native bootstrap chroot, and using the native tooling in bootstrap you install the --forcearch target chroot.

Can it be because we are not using bootstrap image with Mageia?

@praiskup
Copy link
Member

praiskup commented Feb 6, 2024

Can it be because we are not using bootstrap image with Mageia?

I don't think this is the reason...? bootstrap is always native, no matter if --no-bootstrap-image is used.

@praiskup
Copy link
Member

praiskup commented Feb 6, 2024

Is this because mageia-branched.tpl is using {{ target_arch }} instead of $basearch? At least that's how fedora-branched.tpl is created and it works(TM).

wally-mageia added a commit to wally-mageia/mock that referenced this issue Feb 6, 2024
Even though Mageia 7 is EOL fix:
- use bugfix release 7.1 as `$releasever`
- mirror url as Mageia 7 mirror is only available in distrib-coffee archive
- build bootstrap chroots with target arch (fixes rpm-software-management#1304)
@wally-mageia
Copy link
Contributor

Is this because mageia-branched.tpl is using {{ target_arch }} instead of $basearch? At least that's how fedora-branched.tpl is created and it works(TM).

I did some local tests and using $basearch in repo URLs seems to be working in x86_64 host with aarch64 build without overriding bootstrap_forcearch. However in i586 and armv7hl build $basearch translates to i386 and mirrors aren't found.

In aarch64 host $basearch translates in armv7hl build to armhfp, and again mirrors aren't found.

@praiskup praiskup moved this from Needs triage to Someday in future in CPT Kanban Feb 7, 2024
praiskup added a commit to praiskup/mock that referenced this issue 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
praiskup added a commit to praiskup/mock that referenced this issue 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 issue 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 issue 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 issue 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 issue 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 issue 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 issue Feb 12, 2024
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
@nikromen nikromen moved this from Someday in future to Done in CPT Kanban Feb 21, 2024
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 a pull request may close this issue.

5 participants