diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-21 12:57:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-21 12:58:40 +0100 |
commit | e6d26f5dbcc62388f7fba91d317387f37bd5cf3c (patch) | |
tree | d1f4fca8a2ccf9a50114809b986d919952b70bbc /meta/lib | |
parent | 95f6e7bd0f7188f59e66e1769799e44a123b638b (diff) | |
download | poky-e6d26f5dbcc62388f7fba91d317387f37bd5cf3c.tar.gz |
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>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/package_manager.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 4aaff8ca43..bc22c5fc75 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -5,6 +5,7 @@ import subprocess | |||
5 | import shutil | 5 | import shutil |
6 | import multiprocessing | 6 | import multiprocessing |
7 | import re | 7 | import re |
8 | import collections | ||
8 | import bb | 9 | import bb |
9 | import tempfile | 10 | import tempfile |
10 | import oe.utils | 11 | import oe.utils |
@@ -101,13 +102,8 @@ class Indexer(object, metaclass=ABCMeta): | |||
101 | 102 | ||
102 | class RpmIndexer(Indexer): | 103 | class RpmIndexer(Indexer): |
103 | def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None): | 104 | def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None): |
104 | package_archs = { | 105 | package_archs = collections.OrderedDict() |
105 | 'default': [], | 106 | target_os = collections.OrderedDict() |
106 | } | ||
107 | |||
108 | target_os = { | ||
109 | 'default': "", | ||
110 | } | ||
111 | 107 | ||
112 | if arch_var is not None and os_var is not None: | 108 | if arch_var is not None and os_var is not None: |
113 | package_archs['default'] = self.d.getVar(arch_var, True).split() | 109 | package_archs['default'] = self.d.getVar(arch_var, True).split() |
@@ -138,7 +134,7 @@ class RpmIndexer(Indexer): | |||
138 | target_os[eext[1]] = localdata.getVar("TARGET_OS", | 134 | target_os[eext[1]] = localdata.getVar("TARGET_OS", |
139 | True).strip() | 135 | True).strip() |
140 | 136 | ||
141 | ml_prefix_list = dict() | 137 | ml_prefix_list = collections.OrderedDict() |
142 | for mlib in package_archs: | 138 | for mlib in package_archs: |
143 | if mlib == 'default': | 139 | if mlib == 'default': |
144 | ml_prefix_list[mlib] = package_archs[mlib] | 140 | ml_prefix_list[mlib] = package_archs[mlib] |