From 0f0402900af660b5b8686774173cf27280ce75a3 Mon Sep 17 00:00:00 2001 From: David James Date: Wed, 15 Sep 2010 16:19:38 -0700 Subject: [PATCH] Temporary workaround to fix make_chroot --fast Three changes here: 1) parallel_emerge now only disables PORTAGE_LOCKS on board builds. This slows down make_chroot --fast, but works around a bug where make_chroot --fast sometimes merges broken packages. 2) Only set PORTAGE_LOCKS if it's not already set. This allows users to override PORTAGE_LOCKS and request that it be enabled using PORTAGE_LOCKS=true 3) Only add the no-env-update feature if PORTAGE_LOCKS=false. This feature is only needed for that case. Long term fix is to patch PORTAGE_LOCKS feature to lock postinst. That'll be tracked in a separate bug. BUG=chromium-os:6750 TEST=Run make_chroot --fast. It works every time now, but is slower. build_packages && build_image run at same speed as before. Change-Id: I12ab40671034e10cd2ffbba45281ca44718d1d2c Review URL: http://codereview.chromium.org/3446006 --- parallel_emerge | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/parallel_emerge b/parallel_emerge index 2e8f95b1c8..4518575cf5 100755 --- a/parallel_emerge +++ b/parallel_emerge @@ -300,8 +300,12 @@ class DepGraphGenerator(object): # will be going away soon as we migrate to CROS_WORKON_SRCROOT. os.environ.setdefault("CHROMEOS_ROOT", os.environ["HOME"] + "/trunk") - # Modify the environment to disable locking. - os.environ["PORTAGE_LOCKS"] = "false" + # Modify the environment to disable locking by default. + # TODO(davidjames): This option can cause problems if packages muck + # with each other during the post-install step. There are a few host + # packages that do this, so we only do this environment modification for + # board builds. + os.environ.setdefault("PORTAGE_LOCKS", "false") # Turn off interactive delays os.environ["EBEEP_IGNORE"] = "1" @@ -344,9 +348,10 @@ class DepGraphGenerator(object): features = os.environ.get("FEATURES", "") + " -collision-protect" # If we're cross-compiling, updating the environment every time we install - # a package isn't necessary, and leads to race conditions. Do environment - # updates at the end, instead. - if self.board: + # a package isn't necessary, and leads to race conditions when + # PORTAGE_LOCKS is false. In this case, do environment updates at the end, + # instead. + if self.board and os.environ.get("PORTAGE_LOCKS") == "false": features = features + " no-env-update" os.environ["FEATURES"] = features