Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Cc: "Hernandez, Alejandro" <alejandro.hernandez@intel.com>
Subject: [PATCH] package_manager: Fix multilib package arch ordering issues
Date: Tue, 21 Jun 2016 12:57:25 +0100	[thread overview]
Message-ID: <1466510245.3319.174.camel@linuxfoundation.org> (raw)

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]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 4aaff8c..bc22c5f 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -5,6 +5,7 @@ import subprocess
 import shutil
 import multiprocessing
 import re
+import collections
 import bb
 import tempfile
 import oe.utils
@@ -101,13 +102,8 @@ class Indexer(object, metaclass=ABCMeta):
 
 class RpmIndexer(Indexer):
     def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None):
-        package_archs = {
-            'default': [],
-        }
-
-        target_os = {
-            'default': "",
-        }
+        package_archs = collections.OrderedDict()
+        target_os = collections.OrderedDict()
 
         if arch_var is not None and os_var is not None:
             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",
                                                               True).strip()
 
-        ml_prefix_list = dict()
+        ml_prefix_list = collections.OrderedDict()
         for mlib in package_archs:
             if mlib == 'default':
                 ml_prefix_list[mlib] = package_archs[mlib]




                 reply	other threads:[~2016-06-21 11:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466510245.3319.174.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=alejandro.hernandez@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox