rpm-software-management / mock

Mock is a tool for a reproducible build of RPM packages.
GNU General Public License v2.0
381 stars 227 forks source link

Use dnf5 on Fedora 40+ #1332

Closed hroncok closed 7 months ago

hroncok commented 7 months ago

Fixes https://bugzilla.redhat.com/2264535

hroncok commented 7 months ago

Alternatively, this can be hardcoded in all the fedora-40 configs. And keep doping that with all new ones.

Or, we can let it be dnf5 and hardcode it to dnf in all the old ones.

hroncok commented 7 months ago

working on changelog entry

praiskup commented 7 months ago

Hm, actually ... have you tried it works?

hroncok commented 7 months ago

I only tried rendering such a template in Python. Will test to ensure.

hroncok commented 7 months ago

ERROR: Config error: /etc/mock/fedora-39-x86_64.cfg: invalid syntax (, line 15)

hroncok commented 7 months ago

Tested with F40 and F39 and it works as expected.

hroncok commented 7 months ago

For the record, the first attempt created an invalid config and no CI job seems to have noticed that. Perhaps a test should be added that the configs are at least parse-able?

praiskup commented 7 months ago

@hroncok I can not find the old testing-farm run now :-/ but it already appeared failed/red actually. In this case, the tests failed because we do most of the testing on Fedora 39 host against the Fedora 38 (branched) configs (current status quo).

But in general, we don't let the test for configs fail the CI. Some of the configs are known to fail; you have to take a look manually into the logs to see the failures.

praiskup commented 7 months ago

Ad tests, take a look at the failure here.

praiskup commented 7 months ago

I can see Fedora-39:x86_64:/testing-farm/plans/behave | COMPLETE | OK | PASSED now so the basic tests already passed. Merging earlier and releasing so we have it in updates-testing ASAP.

hroncok commented 5 months ago

This broke my own CI strcipt. We use config_opts[f"{config_opts.package_manager}.conf"] += ... which now fails with:

ERROR: Config error: /tmp/fedora-39-x86_64-ci.cfg: '{% if releasever|int >= 40 %}dnf5{% else %}dnf{% endif %}.conf'

Is this something we should try to fix here, or was this never actually supported?

xsuchy commented 5 months ago

This is evaluated by https://pypi.org/project/templated-dictionary/ so it should work.

Can you open a new issue and put there your whole config so we can reproduce it?

hroncok commented 5 months ago

https://github.com/rpm-software-management/mock/issues/1357

praiskup commented 5 months ago

Is this something we should try to fix here, or was this never actually supported?

We e.g. did this in Copr: https://github.com/fedora-copr/copr/pull/3152

hroncok commented 5 months ago

I did the same: https://src.fedoraproject.org/rpms/pyproject-rpm-macros/c/fa7c91c65dcee2b5cc21039533aafee4e52bde23