Open tim77 opened 4 months ago
This issue is not with AL2023 itself. The repo you try to add, incorrectly requires EPEL9 as a dependency.
The proper fix is the amazonlinux-release
needs to ship a /usr/share/dnf/plugins/copr.vendor.conf
file that forces the plugin to select Amazon Linux 2023.
@tim77 You are correct. I was able to replicate it with another copr repo. It would appear that the dnf copr plugin is being used without considering that it is not on a Fedora/RHEL host.
@tim77 what the error tells is that there's no epel-2023-x86_64
chroot in that repository. The copr
plugin it trying to find the appropriate one for the current system and fails. If you look at copr.py
beginning line number 438 you'll understand what's going on:
def _guess_chroot(self):
""" Guess which chroot is equivalent to this machine """
# FIXME Copr should generate non-specific arch repo
dist = self.chroot_config
if dist is None or (dist[0] is False) or (dist[1] is False):
dist = linux_distribution()
# Get distribution architecture
distarch = self.base.conf.substitutions['basearch']
if any([name in dist for name in ["Fedora", "Fedora Linux"]]):
if "Rawhide" in dist:
chroot = ("fedora-rawhide-" + distarch)
# workaround for enabling repos in Rawhide when VERSION in os-release
# contains a name other than Rawhide
elif "rawhide" in os_release_attr("redhat_support_product_version"):
chroot = ("fedora-rawhide-" + distarch)
else:
chroot = ("fedora-{0}-{1}".format(dist[1], distarch))
elif "Mageia" in dist:
# Get distribution architecture (Mageia does not use $basearch)
distarch = rpm.expandMacro("%{distro_arch}")
# Set the chroot
if "Cauldron" in dist:
chroot = ("mageia-cauldron-{}".format(distarch))
else:
chroot = ("mageia-{0}-{1}".format(dist[1], distarch))
elif "openSUSE" in dist:
# Get distribution architecture (openSUSE does not use $basearch)
distarch = rpm.expandMacro("%{_target_cpu}")
# Set the chroot
if "Tumbleweed" in dist:
chroot = ("opensuse-tumbleweed-{}".format(distarch))
else:
chroot = ("opensuse-leap-{0}-{1}".format(dist[1], distarch))
elif "CentOS Stream" in dist:
chroot = ("centos-stream-{0}-{1}".format(dist[1], distarch))
else:
chroot = ("epel-%s-x86_64" % dist[1].split(".", 1)[0])
return chroot
guess_chroot()
starts with a list name dist
and it populates it with ['amazonlinux', '2023']
. The list is used to assemble a copr chroot for the running system. Since nothing matches it returns epel-2023-x86_64
causing the issue.
If another option is added before exiting the if
statement then it works:
elif "amazonlinux" in dist:
chroot = ("{0}-{1}-{2}".format(dist[0], dist[1], distarch))
and dnf copr enable
output:
Do you really want to enable copr.fedorainfracloud.org/atim/shadowsocks-rust? [y/N]: y
Repository successfully enabled.
Another test was setting a copr.vendor.conf
with content:
[main]
distribution = amazonlinux
releasever = 2023
but it didn't work.
Describe the bug Current Copr (Fedora) default configuration broken.
To Reproduce Steps to reproduce the behavior:
sudo dnf copr enable atim/shadowsocks-rust
Expected behavior Copr repo should successfully added without any additional tweaks.
Additional context Current configuration point to
epel-2023-x86_64
but the correct one isamazonlinux-2023-x86_64
.