From patchwork Thu Sep 19 10:01:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Ferreira X-Patchwork-Id: 49292 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7531CE8D6B for ; Thu, 19 Sep 2024 10:01:41 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web11.16043.1726740092428479031 for ; Thu, 19 Sep 2024 03:01:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VxAs1OZQ; spf=pass (domain: gmail.com, ip: 209.85.128.50, mailfrom: pmi183@gmail.com) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42cba6cdf32so5262375e9.1 for ; Thu, 19 Sep 2024 03:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726740091; x=1727344891; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UjcImidVtIvDiXB/hutGMCSvG4r7HWzm3nWYgdhXa98=; b=VxAs1OZQFwy+r7Y7NrYJw2HybRfNPMpKdzpx3btxnW4hDQYsXjAha5wUaudS8dkS2Y GrOwNM4PJNZDkDC6zPOwWPBKqj8oPWKK6m1HilOVfDtbp20zsdgE8W0rr8ULesO2+WUV +vz35pW4X0wYb56N3qQnx8WKSIQDNLZl3VX6VeUNj6iaWcRHcqxvZlAURAOU4cIrhT78 DQzRrzl0uf4zVmBrCiUcU9+eY4kRImQfsi4a+YeH4en1Y4wcZQ1t2oP2quOy5Us/yHpY EYSjsT8tX3P9MBd6skZrHMyfcIZluY7a8Vj+oArUytw7muEgVrAtvLBm8HtJuS6Xo3qD dkTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726740091; x=1727344891; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UjcImidVtIvDiXB/hutGMCSvG4r7HWzm3nWYgdhXa98=; b=tMEH3nR0F8wNwWE8nPMffiIjuUrn2TmVk5uuf/RUbOw7Q8XSRODjNNbS5CMlDobveV 3qCVRtdZLipdCes6+09xQNrQ1wb5HNspObazcSAdPv2M2IxumuJRpN2LRdQw3vO5uXR5 Jvy+mMhPUo+qfl/NlWyjvUByMUn9K7wfVDQzBg6ZNK2Bu71O109mzmqy7IOCd33U/GaW fE75Ye6l8C2qtXQKA6vjJA+GYeu1leX255B6PbbX208Qkt2Pultc1M452SHpm6HCA/aE 9IHaILDyosrdTQVB2ZeJ9/1RWOXkEnJIe9c1nen6mYoJCuL7cZ+jLKhfWQ0kFKIv6qdH ggkw== X-Gm-Message-State: AOJu0Yy4kAWr/PPCjB7D/0Egpq/69oh/4UA29Z48M1mTrT2a0R3t1zAa 2EYZ40Jf0iu0qeEhncypzsb+jvKWN1neOx+3eMQNex+dWPKbl8f+PouobZyi X-Google-Smtp-Source: AGHT+IHnJzvXCzHUuUzUfD6/wpJegq2kBIbLDfHbn3qcwd9TnloxMBq2iC09HBmng37uCAWNQTlHeQ== X-Received: by 2002:a05:600c:4709:b0:42c:ac9f:b505 with SMTP id 5b1f17b1804b1-42cdb58e130mr167346205e9.31.1726740090458; Thu, 19 Sep 2024 03:01:30 -0700 (PDT) Received: from LAPTOP-0FHSM1V0.criticaltechworks.com ([78.137.195.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e75452b8esm17679405e9.28.2024.09.19.03.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 03:01:29 -0700 (PDT) From: Pedro Ferreira To: openembedded-core@lists.openembedded.org Cc: Pedro Ferreira , Pedro Silva Ferreira , Richard Purdie Subject: [kirkstone][PATCH v3 1/3] buildhistory: Fix intermittent package file list creation Date: Thu, 19 Sep 2024 11:01:25 +0100 Message-Id: <20240919100127.2857748-1-pmi183@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 19 Sep 2024 10:01:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204662 From: Pedro Ferreira The directory that buildhistory_list_pkg_files writes to during do_package is created by do_packagedata so a clean buildhistory doesn't have files-in-package written during the first build since packagedata happens after do_package. Ensure the output package folder is created to avoid missing files-in-package.txt files. Also it ensures that in case of `find` fails we leave with a hard error instead of hiding the error on the for loop. Signed-off-by: Pedro Silva Ferreira Signed-off-by: Richard Purdie (cherry picked from commit 8de9b8c1e199896b9a7bc5ed64967c6bfbf84bea) --- meta/classes/buildhistory.bbclass | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 4345ffc693..b35508db27 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -597,15 +597,12 @@ buildhistory_list_files_no_owners() { buildhistory_list_pkg_files() { # Create individual files-in-package for each recipe's package - for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do + pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) + for pkgdir in $pkgdirlist; do pkgname=$(basename $pkgdir) outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname" outfile="$outfolder/files-in-package.txt" - # Make sure the output folder exists so we can create the file - if [ ! -d $outfolder ] ; then - bbdebug 2 "Folder $outfolder does not exist, file $outfile not created" - continue - fi + mkdir -p $outfolder buildhistory_list_files $pkgdir $outfile fakeroot done } From patchwork Thu Sep 19 10:01:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Ferreira X-Patchwork-Id: 49291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2918CE8D68 for ; Thu, 19 Sep 2024 10:01:41 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web10.15922.1726740093369632356 for ; Thu, 19 Sep 2024 03:01:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AsCvLx01; spf=pass (domain: gmail.com, ip: 209.85.128.42, mailfrom: pmi183@gmail.com) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so5172145e9.3 for ; Thu, 19 Sep 2024 03:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726740092; x=1727344892; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FEZZ2o05L7RdS9xhj19mzYIi0jE2fBxCwklBeRCzcSk=; b=AsCvLx01lO/hGyfbHSmr8nR+g5GqCmNT0s1E1rFvIf+QU7uQ+OdPW2ry5zbAKRPGMz BuK2/m28PF3g/NQ0dXmaO/TTLjsrk0yqo3nmbt4dZhFAgqvEKcCQiXXYHJ5qV8Lr8hI6 276JJ3FTc2TvvU19I9WeeTt8zafBkLpCAa4LMGF2Z9ol97ThTmRMLqsa0E1j+zNey84O MOZOHnBDs8Ku1wGZP3R8TS4LDy2pf14GatVaaZO0Lu1kc+sR4IEnIl0HhO5ULWOhhw1W DyoancWsR7dI7uOvyJuoLRhKivX4z+QYJ+3M0Uvn/AMPNT7lFlGYw8V9+FVz9Mzxxstp VfWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726740092; x=1727344892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FEZZ2o05L7RdS9xhj19mzYIi0jE2fBxCwklBeRCzcSk=; b=KUECAX7Uh1ZIvHLjFEvzucy1XE56yj5I52vFFOOB5Pff6ZIvaOVHW7PZot9zCCVeW+ QZQkz5ZlsORTQnqoOd8+4LxaHGr6gsJjg+Uo0UJ6WcLMIZFNvMTeoVTcIyfNSSxm/TH7 y1w7LZBV5xx9wkKL4kldlKSnf6BpDNkOK99Ti3+9WQJTFFjE3LS3vWj2NK+nKXyELIxa OUmQuerOy3hSzUv49YgoBYbNaeFCK16wEt43dEYZSkUkZpxf8Si/iC7Otyp9aD7+Tdng R7tGdEGmjuuOO46f87j1WIV8KdU1tl7GHA/aNA5+04CsJQED7zvjf6P4+iaB01YyMUVt OHiA== X-Gm-Message-State: AOJu0Yz9EDpTVe/zzeRZRUom9O1+2GDnuIxabXMYEk861YUz7xdMuelX erGMFW7FhH9TQV4qJJmiRj9b1fl5zHbRJu8vk4Vo4Wn0ZYHp6308GRbHjDYI X-Google-Smtp-Source: AGHT+IHZ3bmrVxqKo2HfEmAjMQvWSc+YP3gxV6u0bPMzD30WeLDUuZrZ891j+wVGvN5BVyvz7RB+TQ== X-Received: by 2002:a05:600c:1987:b0:42c:b4f1:f281 with SMTP id 5b1f17b1804b1-42cdb58f2bbmr178600485e9.34.1726740091643; Thu, 19 Sep 2024 03:01:31 -0700 (PDT) Received: from LAPTOP-0FHSM1V0.criticaltechworks.com ([78.137.195.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e75452b8esm17679405e9.28.2024.09.19.03.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 03:01:31 -0700 (PDT) From: Pedro Ferreira To: openembedded-core@lists.openembedded.org Cc: Pedro Ferreira , Pedro Ferreira , Richard Purdie Subject: [kirkstone][PATCH v3 2/3] buildhistory: Restoring files from preserve list Date: Thu, 19 Sep 2024 11:01:26 +0100 Message-Id: <20240919100127.2857748-2-pmi183@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240919100127.2857748-1-pmi183@gmail.com> References: <20240919100127.2857748-1-pmi183@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 19 Sep 2024 10:01:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204663 From: Pedro Ferreira This fix will ensure that, when we activate feature `BUILDHISTORY_RESET`, files marked to keep on feature `BUILDHISTORY_PRESERVE` will indeed exist is buildhistory final path since they are moved to buildhistory/old but not restored at any point. Signed-off-by: Pedro Ferreira Signed-off-by: Richard Purdie (cherry picked from commit 9f68a45aa238ae5fcdfaca71ba0e7015e9cb720e) --- meta/classes/buildhistory.bbclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index b35508db27..8adb44eba5 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -108,6 +108,7 @@ python buildhistory_emit_pkghistory() { import json import shlex import errno + import shutil pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') @@ -221,6 +222,20 @@ python buildhistory_emit_pkghistory() { items.sort() return ' '.join(items) + def preservebuildhistoryfiles(pkg, preserve): + if os.path.exists(os.path.join(oldpkghistdir, pkg)): + listofobjs = os.listdir(os.path.join(oldpkghistdir, pkg)) + for obj in listofobjs: + if obj not in preserve: + continue + try: + bb.utils.mkdirhier(os.path.join(pkghistdir, pkg)) + shutil.copyfile(os.path.join(oldpkghistdir, pkg, obj), os.path.join(pkghistdir, pkg, obj)) + except IOError as e: + bb.note("Unable to copy file. %s" % e) + except EnvironmentError as e: + bb.note("Unable to copy file. %s" % e) + pn = d.getVar('PN') pe = d.getVar('PE') or "0" pv = d.getVar('PV') @@ -248,6 +263,14 @@ python buildhistory_emit_pkghistory() { if not os.path.exists(pkghistdir): bb.utils.mkdirhier(pkghistdir) else: + # We need to make sure that all files kept in + # buildhistory/old are restored successfully + # otherwise next block of code wont have files to + # check and purge + if d.getVar("BUILDHISTORY_RESET"): + for pkg in packagelist: + preservebuildhistoryfiles(pkg, preserve) + # Remove files for packages that no longer exist for item in os.listdir(pkghistdir): if item not in preserve: From patchwork Thu Sep 19 10:01:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Ferreira X-Patchwork-Id: 49293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3345CCE8D6E for ; Thu, 19 Sep 2024 10:01:42 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web10.15924.1726740095549294113 for ; Thu, 19 Sep 2024 03:01:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Lqv1Tbr/; spf=pass (domain: gmail.com, ip: 209.85.128.47, mailfrom: pmi183@gmail.com) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42cd74c0d16so5762285e9.1 for ; Thu, 19 Sep 2024 03:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726740094; x=1727344894; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aYpCMJDGJfaAIW/C1TBUa08liIja3syGdWOjAvNeKqY=; b=Lqv1Tbr/Rma8zr8ymB8FA7bECTWJoQJR/07x828a/peqPZdtK+wHNh5TymMxr7KkL0 2DldbKOzHkCsKMZIVGPakm2v5x203zEdxdaRTiKBRbqxYf/rWhaj8VKrxO9OOuCnFKhj 2p2wAWD8JWebJB9hqtBcjfAji1/+SoMzcB0f43LTAF3K+b9CxufujwTZcoN1xGlLrW1M FStoDr+iVzLD44+VKmIRpjOMEjNKUkKWZ4DJtSHH+Q70OlB2atBYmXMgg14DAkP7z327 JadhqQv5YSNvM0cpB1JqTQty+3nnwfwWWy9IY6ClMYrfEDwHsc8wXStckAKlVFJhD2jD X5jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726740094; x=1727344894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aYpCMJDGJfaAIW/C1TBUa08liIja3syGdWOjAvNeKqY=; b=XHMdpz7xRIfO4UmYMmANnicK/nxchR9KKR3XK9q6lo6LcBcJeNp0daJwr+boGyc7hI 2L7/OkrkACmrIOkGWm7QJflg1rkDm2ZblZpT6v4R/DB8ZPm5mLNNTQbqNMFlqwTCyjBB CtYc05b1U/Pt5Q1VkF5EnxCf7DlmWMD7qB2Zs9S0NWJnjftvtqHRM0BA3Dk6DCocjwM7 taT2xpi4w4m7vb3xl+RY/NoqAMQieoN2j4ZVR7fCbmTFBIjJ8g87eAST9yZpOE6t7Gy3 /2Wx4eefPt8xEMEUorFv3Y+mgKIRhazXuWUwji8oIg5gg4IPrTGb+9VZJ0BZm+vDdL5Z m9/w== X-Gm-Message-State: AOJu0YzPcWSJu+GOcl68LZRn0bL4/mYYl7vaFX5PGfWQRPG4pwZLJDFd kFFN4S1C1vwqsSy7P3+1a5kfVJsW23WSsFJEzXW0vrjk7joSJM7nM3KbfU+j X-Google-Smtp-Source: AGHT+IHFq5TylDqLlCMgnPE5jyEOTxgmJbYPDPk0YE6z+qTyDXzUbmzRUSHHb8jIJUuIl1y1uZPSaA== X-Received: by 2002:a05:600c:4ecb:b0:42c:b3e5:f688 with SMTP id 5b1f17b1804b1-42cdb511c3fmr167482065e9.4.1726740093735; Thu, 19 Sep 2024 03:01:33 -0700 (PDT) Received: from LAPTOP-0FHSM1V0.criticaltechworks.com ([78.137.195.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e75452b8esm17679405e9.28.2024.09.19.03.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2024 03:01:33 -0700 (PDT) From: Pedro Ferreira To: openembedded-core@lists.openembedded.org Cc: Richard Purdie Subject: [kirkstone][PATCH v3 3/3] buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage Date: Thu, 19 Sep 2024 11:01:27 +0100 Message-Id: <20240919100127.2857748-3-pmi183@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240919100127.2857748-1-pmi183@gmail.com> References: <20240919100127.2857748-1-pmi183@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 19 Sep 2024 10:01:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/204664 From: Richard Purdie We planned to drop SSTATEPOSTINSTFUNC some time ago with the introduction of postfuncs. Finally get around to doing that which should make the buildhistory code a little more readable. Unfortunately ordering the buildhistory function calls after the sstate ones is difficult without coding that into the sstate class. This patch does that to ensure everything functions as expected until we can find a better way. This is still likely preferable than the generic sstate postfuncs support since the function flow is much more readable. Signed-off-by: Richard Purdie (cherry picked from commit c9e2a8fa2f0305ef1247ec405555612326f798f8) --- meta/classes/buildhistory.bbclass | 39 +++++++++++++++---------------- meta/classes/sstate.bbclass | 5 +++- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 8adb44eba5..83993f5752 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -45,11 +45,18 @@ BUILDHISTORY_PUSH_REPO ?= "" BUILDHISTORY_TAG ?= "build" BUILDHISTORY_PATH_PREFIX_STRIP ?= "" -SSTATEPOSTINSTFUNCS:append = " buildhistory_emit_pkghistory" -# We want to avoid influencing the signatures of sstate tasks - first the function itself: -sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory" -# then the value added to SSTATEPOSTINSTFUNCS: -SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory" +# We want to avoid influencing the signatures of the task so use vardepsexclude +do_populate_sysroot[postfuncs] += "buildhistory_emit_sysroot" +do_populate_sysroot_setscene[postfuncs] += "buildhistory_emit_sysroot" +do_populate_sysroot[vardepsexclude] += "buildhistory_emit_sysroot" + +do_package[postfuncs] += "buildhistory_list_pkg_files" +do_package_setscene[postfuncs] += "buildhistory_list_pkg_files" +do_package[vardepsexclude] += "buildhistory_list_pkg_files" + +do_packagedata[postfuncs] += "buildhistory_emit_pkghistory" +do_packagedata_setscene[postfuncs] += "buildhistory_emit_pkghistory" +do_packagedata[vardepsexclude] += "buildhistory_emit_pkghistory" # Similarly for our function that gets the output signatures SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs" @@ -89,27 +96,15 @@ buildhistory_emit_sysroot() { # Write out metadata about this package for comparison when writing future packages # python buildhistory_emit_pkghistory() { - if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: - bb.build.exec_func("buildhistory_emit_sysroot", d) - return 0 - - if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): - return 0 - - if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']: - # Create files-in-.txt files containing a list of files of each recipe's package - bb.build.exec_func("buildhistory_list_pkg_files", d) - return 0 - - if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: - return 0 - import re import json import shlex import errno import shutil + if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split(): + return 0 + pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE') oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE') @@ -619,6 +614,10 @@ buildhistory_list_files_no_owners() { } buildhistory_list_pkg_files() { + if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'package', '1', '0', d)}" = "0" ] ; then + return + fi + # Create individual files-in-package for each recipe's package pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d) for pkgdir in $pkgdirlist; do diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index dd6cf12920..91d42665c1 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -156,7 +156,10 @@ python () { d.setVar('SSTATETASKS', " ".join(unique_tasks)) for task in unique_tasks: d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ") - d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc") + # Generally sstate should be last, execpt for buildhistory functions + postfuncs = (d.getVarFlag(task, 'postfuncs') or "").split() + newpostfuncs = [p for p in postfuncs if "buildhistory" not in p] + ["sstate_task_postfunc"] + [p for p in postfuncs if "buildhistory" in p] + d.setVarFlag(task, 'postfuncs', " ".join(newpostfuncs)) d.setVarFlag(task, 'network', '1') d.setVarFlag(task + "_setscene", 'network', '1') }