From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by mx.groups.io with SMTP id smtpd.web10.3821.1631240534846977918 for ; Thu, 09 Sep 2021 19:22:15 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: kernel.crashing.org, ip: 63.228.1.57, mailfrom: mark.hatle@kernel.crashing.org) Received: from lons-builder.int.hatle.net ([192.40.192.95]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 18A2MDks022976 for ; Thu, 9 Sep 2021 21:22:14 -0500 From: "Mark Hatle" To: openembedded-core@lists.openembedded.org Subject: [OE-core][PATCH v3 2/2] externalsrc: Work with reproducible_build Date: Thu, 9 Sep 2021 21:22:13 -0500 Message-Id: <20210910022213.28378-3-mark.hatle@kernel.crashing.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210910022213.28378-1-mark.hatle@kernel.crashing.org> References: <20210910022213.28378-1-mark.hatle@kernel.crashing.org> From: Mark Hatle Externalsrc removes do_fetch, do_unpack, and do_patch. The system normally discovers the correct reproducible date as a postfuncs of do_unpack, so this date is never found, so it falls back to the default epoch. Instead we can move the discovery function to a prefuncs on the epoch deploy task. This task will run before do_configure, and since the source is already available can run safely at anytime. Signed-off-by: Mark Hatle Signed-off-by: Mark Hatle --- meta/classes/externalsrc.bbclass | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index 54b08adf62..7f1a760eec 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass @@ -110,6 +110,16 @@ python () { continue bb.build.deltask(task, d) + if bb.data.inherits_class('reproducible_build', d) and 'do_unpack' in d.getVar("SRCTREECOVEREDTASKS").split(): + # The reproducible_build's create_source_date_epoch_stamp function must + # be run after the source is available and before the + # do_deploy_source_date_epoch task. In the normal case, it's attached + # to do_unpack as a postfuncs, but since we removed do_unpack (above) + # we need to move the function elsewhere. The easiest thing to do is + # move it into the prefuncs of the do_deploy_source_date_epoch task. + # This is safe, as externalsrc runs with the source already unpacked. + d.prependVarFlag('do_deploy_source_date_epoch', 'prefuncs', 'create_source_date_epoch_stamp ') + d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ") d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ") -- 2.17.1