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

multiple archs: ignorearch option not picked up? #114

Open
rb2k opened this issue Aug 4, 2021 · 2 comments
Open

multiple archs: ignorearch option not picked up? #114

rb2k opened this issue Aug 4, 2021 · 2 comments

Comments

@rb2k
Copy link

rb2k commented Aug 4, 2021

Update

It seems like ignorearch is not picked up from the dnf.conf

PREVIOUS CONTEXT

We are running rpm and microdnf on our mac fleet.

I am experimenting with Apple's new M1 CPUs, so I'd like to be able to install x86 and aarch64 RPMs on the M1 machines since they can run both (one natively, one via rosetta 2).
To make things a bit simpler, I tried to start with the easy use-case: allow installation of aarch64 architecture RPMs ona an x86 machine.

For RPM, all I needed to do was add aarch64 as a compatible option for x86_64:

arch_compat: x86_64: amd64 em64t athlon noarch aarch64

And I was able to install the RPM with rpm directly:

[root@mactest ~]# rpm -i hello-2.10-ambfjrcjdl77xgb7qvbfp5k89i8rivl6-1-0.aarch64.rpm
warning: hello-2.10-ambfjrcjdl77xgb7qvbfp5k89i8rivl6-1-0.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 14e56dc8: NOKEY
[root@mactest ~]# rpm -qa | grep hello
hello-ambfjrcjdl77xgb7qvbfp5k89i8rivl6-1-0.aarch64

However, if try to install the same RPM from the repo using microDNF:

[root@mactest ~]# microdnf install hello-2.10-ambfjrcjdl77xgb7qvbfp5k89i8rivl6
error: Could not depsolve transaction; 1 problem detected:
 Problem: conflicting requests
  - package hello-2.10-ambfjrcjdl77xgb7qvbfp5k89i8rivl6-1-0.aarch64 does not have a compatible architecture
[root@mactest ~]# 

This is a very similar (but not exactly the same) error message as if I didn't have the rpmrc file set up correctly.

[root@mactest~]# rpm -i hello-ambfjrcjdl77xgb7qvbfp5k89i8rivl6-1-0.aarch64.rpm
warning: hello-2.10-ambfjrcjdl77xgb7qvbfp5k89i8rivl6-1-0.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 14e56dc8: NOKEY
	package hello-aarch64-ambfjrcjdl77xgb7qvbfp5k89i8rivl6-1-0.aarch64 is intended for a different architecture

I tried setting

ignorearch=1

In the dnf.conf, but no luck so far.

Any idea what else I would have to do to let microdnf recognize the additional arch as valid?

@rb2k
Copy link
Author

rb2k commented Aug 4, 2021

Ah, it seems like I might have to add some code to treat it similarly to this flag:

microdnf/dnf/dnf-main.c

Lines 190 to 202 in 7b84c06

else if (strcmp (setopt[0], "allow_vendor_change") == 0)
{
const char *setopt_val = setopt[1];
if (setopt_val[0] == '1' && setopt_val[1] == '\0')
opt_allow_vendor_change = ARG_TRUE;
else if (setopt_val[0] == '0' && setopt_val[1] == '\0')
opt_allow_vendor_change = ARG_FALSE;
else
{
local_error = g_error_new (G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
"Invalid boolean value \"%s\" in: %s", setopt[1], value);
ret = FALSE;
}

and then

microdnf/dnf/dnf-main.c

Lines 563 to 566 in 7b84c06

if (opt_allow_vendor_change == ARG_TRUE)
dnf_context_set_allow_vendor_change (TRUE);
else if (opt_allow_vendor_change == ARG_FALSE)
dnf_context_set_allow_vendor_change (FALSE);

@rb2k rb2k changed the title multiple archs: rpmrc options not picked up? multiple archs: ignorearch option not picked up? Aug 4, 2021
@rb2k
Copy link
Author

rb2k commented Aug 4, 2021

Hmm, I think this might also not be easily surfaced in libdnf yet?
I think I might need to do something similar to what @jrohel did in rpm-software-management/libdnf#1116

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.

1 participant