1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

package_manager: Fix multilib package arch ordering issues

Order is not preserved in dict() and this code depends on the order of
these lists of package architectures used when multilibs are enabled.
This caused 'random' breakage where sometimes the correct order was present
and sometimes it wasn't.

Use collections.OrderedDict() to avoid this problem.

Kudos to Bill Randle and Alejandro Hernandez who did most of the work debugging
this, I simply took the problem they identified and wrote a patch to fix it.

This unblocks the M1 build but this code needs auditing as there are clearly
other ordering issues (e.g. the set() usage).

[YOCTO #9717]

(From OE-Core rev: 61a33582dfc964d612d20d34734a787d873e312c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2016-06-21 12:57:25 +01:00
parent 95f6e7bd0f
commit e6d26f5dbc
+4 -8
View File
@@ -5,6 +5,7 @@ import subprocess
import shutil import shutil
import multiprocessing import multiprocessing
import re import re
import collections
import bb import bb
import tempfile import tempfile
import oe.utils import oe.utils
@@ -101,13 +102,8 @@ class Indexer(object, metaclass=ABCMeta):
class RpmIndexer(Indexer): class RpmIndexer(Indexer):
def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None): def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None):
package_archs = { package_archs = collections.OrderedDict()
'default': [], target_os = collections.OrderedDict()
}
target_os = {
'default': "",
}
if arch_var is not None and os_var is not None: if arch_var is not None and os_var is not None:
package_archs['default'] = self.d.getVar(arch_var, True).split() package_archs['default'] = self.d.getVar(arch_var, True).split()
@@ -138,7 +134,7 @@ class RpmIndexer(Indexer):
target_os[eext[1]] = localdata.getVar("TARGET_OS", target_os[eext[1]] = localdata.getVar("TARGET_OS",
True).strip() True).strip()
ml_prefix_list = dict() ml_prefix_list = collections.OrderedDict()
for mlib in package_archs: for mlib in package_archs:
if mlib == 'default': if mlib == 'default':
ml_prefix_list[mlib] = package_archs[mlib] ml_prefix_list[mlib] = package_archs[mlib]