From patchwork Tue Jan 23 14:06:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 38241 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 C8823C47258 for ; Tue, 23 Jan 2024 14:06:58 +0000 (UTC) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by mx.groups.io with SMTP id smtpd.web10.12948.1706018817658088203 for ; Tue, 23 Jan 2024 06:06:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=ufLRY5ST; spf=pass (domain: baylibre.com, ip: 209.85.208.180, mailfrom: jstephan@baylibre.com) Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2cddb2c2b54so43064451fa.1 for ; Tue, 23 Jan 2024 06:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1706018815; x=1706623615; 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=39Mj3J8NiAGnFD5+wIVjybr9VmHKjpe5br1DegH/4zw=; b=ufLRY5STXpKLAwTl4j5FIJohSgYKT4uSaXhFXiBd+rFcIeX4DV50D+RBSE1CchzVOG +XFQlHz6qzzNCspmTmTRdsK0ZH8KIMb7qENJUx+NUkQl8BtH14Wucdi1ukLSDInyjN6+ EKfrTV5jl4mOGZMikCKCAP9jmr4xXh2S+IQwp0VqXtumMnTVSCGUU4pDBVtn00GXtrA0 xsjiaLGodq+3jwdvHE1hvSDmBW74vwJzu8kZ56zGpMDQTajaLaTRGo7NwzgFn/xeY0i3 r/XDhI1+gqhcRcj2oMA56Lekp8zswV1ONY2lAZ0bBd88gzWMCBCVZeajXdr+bSXFROpm 2FzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706018815; x=1706623615; 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=39Mj3J8NiAGnFD5+wIVjybr9VmHKjpe5br1DegH/4zw=; b=AKPoz/OxbI9/+gfmmnCCl+3p5Yv85A/Oxr1R/rIfe2N5MxxYU+rQh3AwxonxRX5B/K Ii3OzUMPPlH7qqFFe1RxgiqIprk8pl/Nh//yQtYMzjIytu9PS1ZE18wb3vFFudTdf5qy UUfkIe9tlk8ZHnGLYNH0GWq6JKKBImWBeBmhdn7mkLJ+gaNvT7+QwatMxLUVa9patJeM 4dr2yRwFkCo2zJ/XtDCAd8uVLOkTW+9xCo976B+c2ZD+nqotLnpAySIhA+CI0INOy55D 0BlJs/9VZSQKeV1YkrO/r7STXvZaGcQ0dY6MYxYnxS9DMvejb9PC+eWNHg2VEJ4Q5EIQ R7CQ== X-Gm-Message-State: AOJu0Yz7UrMctgCpoQxdewYT4hcc9/4jFmfD2kfZoM4soA2R1xfNB1iO MlA41enABDgghA8P7FWg+AtDpUGfe8rYg3hR9wSOoZZpu+36hp2GULFod/OgWNFa3ulpqhgrqRO m7HM= X-Google-Smtp-Source: AGHT+IHKRMfgaTlnl2cuBx7k5uhUsCJo2kWPmac7NAxbw1ZPTT7XNcZ9fUI4vo4T/HbXhr/T09eFqA== X-Received: by 2002:a2e:300c:0:b0:2cc:8735:5532 with SMTP id w12-20020a2e300c000000b002cc87355532mr2584739ljw.59.1706018814778; Tue, 23 Jan 2024 06:06:54 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:55f:21e0:9e19:4376:dea6:dbfa]) by smtp.gmail.com with ESMTPSA id q9-20020adff789000000b00337d6aa3912sm12998447wrp.10.2024.01.23.06.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 06:06:53 -0800 (PST) From: Julien Stephan To: openembedded-core@lists.openembedded.org Cc: Julien Stephan Subject: [PATCH v3 1/3] externalsrc: fix task dependency for do_populate_lic Date: Tue, 23 Jan 2024 15:06:49 +0100 Message-ID: <20240123140651.930307-2-jstephan@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123140651.930307-1-jstephan@baylibre.com> References: <20240123140651.930307-1-jstephan@baylibre.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 ; Tue, 23 Jan 2024 14:06:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/194238 do_populate_lic dependencies are defined inside license.bbclass such as: addtask populate_lic after do_patch before do_build but externalsrc deletes the do_patch task, so the only dependency left for do_populate_lic is "before do_build" On a devtool context, when doing devtool modify, sources are extracted inside build/workspace/sources/${BPN}/ and local files inside build/workspace/sources/${BPN}/oe-local-files When building the recipe after a devtool modify, do_unpack is called again to unpack (possibly modified) local files from build/workspace/sources/${BPN}/oe-local-files into ${WORKDIR}. Since the only left dependency for do_populate_lic is do_build, the do_populate_lic can be called BEFORE do_unpack. Most of the time this is not a problem, because license files are generally located inside ${S}, which corresponds to build/workspace/sources/${BPN} (and is already unpacked), but this can lead to an issue if recipe sets LIC_FILES_CHKSUM to look for files in ${WORKDIR} (example from init-ifupdown_1.0.bb): LIC_FILES_CHKSUM = "file://${WORKDIR}/copyright;md5=3dd6192d306f582dee7687da3d8748ab" So devtool modify init-ifupdown && bitbake init-ifupdown gives the following error: WARNING: init-ifupdown-1.0-r0 do_populate_lic: Could not copy license file <...>/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0/copyright to <...>/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0/license-destdir/qemux86_64/init-ifupdown/copyright: [Errno 2] No such file or directory: '<...>/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0/copyright' ERROR: init-ifupdown-1.0-r0 do_populate_lic: QA Issue: init-ifupdown: LIC_FILES_CHKSUM points to an invalid file: <...>/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0/copyright [license-checksum] ERROR: init-ifupdown-1.0-r0 do_populate_lic: Fatal QA errors were found, failing task. ERROR: Logfile of failure stored in: <...>/build/tmp/work/qemux86_64-poky-linux/init-ifupdown/1.0/temp/log.do_populate_lic.838584 ERROR: Task (<...>/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb:do_populate_lic) failed with exit code '1' Fix this by forcing the do_populate_lic task to run after do_unpack Signed-off-by: Julien Stephan --- meta/classes/externalsrc.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index a54f316aa0a..70e27a8d351 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass @@ -104,6 +104,7 @@ python () { # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one # Note that we cannot use d.appendVarFlag() here because deps is expected to be a list object, not a string d.setVarFlag('do_configure', 'deps', (d.getVarFlag('do_configure', 'deps', False) or []) + ['do_unpack']) + d.setVarFlag('do_populate_lic', 'deps', (d.getVarFlag('do_populate_lic', 'deps', False) or []) + ['do_unpack']) for task in d.getVar("SRCTREECOVEREDTASKS").split(): if local_srcuri and task in fetch_tasks: From patchwork Tue Jan 23 14:06:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 38242 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 C9371C47DDB for ; Tue, 23 Jan 2024 14:06:58 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web10.12949.1706018817981530562 for ; Tue, 23 Jan 2024 06:06:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=mF4xYMfm; spf=pass (domain: baylibre.com, ip: 209.85.221.52, mailfrom: jstephan@baylibre.com) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-339289fead2so3599626f8f.3 for ; Tue, 23 Jan 2024 06:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1706018815; x=1706623615; 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=xgQiHXprsNxqlLgZ4HJwptnUCvdcOwvzMqzu1nwYn6Q=; b=mF4xYMfmXe/RdAHP+0RGzWtf8AiTQXT6IdVyq6QSmUmInH3WILk+u3Oi9pRXkYTb1u siryPOkNed2F/mGHBeGekJJHT5IvUIjstClBIZ4xC6r6BNhscMLI56au2Z/D7jwIRovd eLAy4aCAciY10B3NxVKah9BXdK61bXKedEE+jq+1R1VTgqL0tRWe+nPxwxSTzyH2DXf+ 3KFu3sbQ4QXLJTINhn1fmS3NdRSl4ZbEQYLMv60oK65fcO1bf9AvEM+faDaurqFOfFaq k8D7hVE0sOmNt34OUv9mKGjm2nFm6yyusmSTqUOnTo6+WZ6XywMdobH8kIa3/yeJx78f QFLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706018815; x=1706623615; 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=xgQiHXprsNxqlLgZ4HJwptnUCvdcOwvzMqzu1nwYn6Q=; b=cf9aK1E+Ojzhl3+DmFhzjnJeXh2fRvuwLR/dwg6r1E0wAu6lK6mTKPy3z15qX9qPqf 6Kz/xgRXFbeOENEkEqsHPwncorQUDpCHW+3sJR2lLB+dUThtQ0ju3P4iLlZVJ0Df+6t5 4UC07MueEyzSjAsa5bQIac7ZBrwyZ9EauQfb25yI0wgxx+Sdnn1dxQCFu8K5I5enb81E JQRVs0NFWFjEx3Vlu7KPef+uXZ5CZ8N8UV30vz6ADOg+E2jwG0JdEm6GiKEvwC90GAi3 3KEWmujXff1ptzZSDfd4aF9TO+F2ae/bhLwtqQvtDo8ZKqjEBYh7aUOq9UPBAsMfIPaX uNqA== X-Gm-Message-State: AOJu0YwCouyCu27Zt2TVaf9lYukn8a5sNj2kdyndSI1jnPOj47FXqp9K vtIs1ClqkNmjujP3x/bWm6PUgXmcLPs4KRb6TLg/2GBOX8aT+0h7WT6r69wkQQdLI0DEqTPZ83c 9IpI= X-Google-Smtp-Source: AGHT+IH7y3395KSjn4PZYG629aai21TYfLcuqQ9kLkfT+wDbG8Zc8aoS8LcE46UczbLOXqT+3k6LCQ== X-Received: by 2002:a5d:4bc5:0:b0:337:c0b9:f6f5 with SMTP id l5-20020a5d4bc5000000b00337c0b9f6f5mr3577567wrt.102.1706018815256; Tue, 23 Jan 2024 06:06:55 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:55f:21e0:9e19:4376:dea6:dbfa]) by smtp.gmail.com with ESMTPSA id q9-20020adff789000000b00337d6aa3912sm12998447wrp.10.2024.01.23.06.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 06:06:55 -0800 (PST) From: Julien Stephan To: openembedded-core@lists.openembedded.org Cc: Julien Stephan Subject: [PATCH v3 2/3] devtool: modify: add support for multiple source in SRC_URI Date: Tue, 23 Jan 2024 15:06:50 +0100 Message-ID: <20240123140651.930307-3-jstephan@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123140651.930307-1-jstephan@baylibre.com> References: <20240123140651.930307-1-jstephan@baylibre.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 ; Tue, 23 Jan 2024 14:06:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/194239 [YOCTO #15162] when doing devtool modify, sources are extracted into a devtool temporary workdir. The main source is moved inside build/workspace/sources/${BPN}/ and local files are moved inside build/workspace/sources/${BPN}/oe-local-files. Secondary sources are currently not handled and are lost. Here is the output of devtool modify/build on bzip2 recipe: NOTE: bzip2: compiling from external source tree <...>/build/workspace/sources/bzip2 ERROR: bzip2-1.0.8-r0 do_install_ptest_base: ExecutionError('<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368', 1, None, None) ERROR: Logfile of failure stored in: <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/log.do_install_ptest_base.3368 Log data follows: | DEBUG: Executing shell function do_install_ptest_base | NOTE: make -j 16 DESTDIR=<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest install-ptest | sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \ | ../../../../../../workspace/sources/bzip2/Makefile.am > <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/Makefile | cp ../../../../../../workspace/sources/bzip2/sample1.ref <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample2.ref <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample3.ref <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample1.bz2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample2.bz2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | cp ../../../../../../workspace/sources/bzip2/sample3.bz2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/ | ln -s /usr/bin/bzip2 <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/bzip2 | cp: cannot stat '<...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/git/commons-compress': No such file or directory | WARNING: <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368:189 exit 1 from 'cp -r <...>/build/tmp/work/core2-64-poky-linux/bzip2/ 1.0.8/git/commons-compress <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/image/usr/lib/bzip2/ptest/bzip2-tests/commons-compress' | WARNING: Backtrace (BB generated script): | #1: do_install_ptest, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 189 | #2: do_install_ptest_base, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 158 | #3: main, <...>/build/tmp/work/core2-64-poky-linux/bzip2/1.0.8/temp/run.do_install_ptest_base.3368, line 226 ERROR: Task (<...>/poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb:do_install_ptest_base) failed with exit code '1' NOTE: Tasks Summary: Attempted 776 tasks of which 765 didn't need to be rerun and 1 failed. Summary: 1 task failed: <...>/poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb:do_install_ptest_base externalsrc class modify SRC_URI to keep only: * 'file', 'npmsw' and 'crate' sources * url with type parameter matching 'kmeta' or 'git-dependency' So by forcing to add type='git-dependency' on secondary sources, we ensure that when building the recipe, the secondary sources can be unpacked into WORKDIR. This allows recipes containing several sources to be built under a devtool context, but it has some limitations: * user would not be able to generate patches for the secondary sources * type="git-dependency" is added for secondary sources even on non git sources, so we may want to rename this parameter Signed-off-by: Julien Stephan --- scripts/lib/devtool/standard.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 13612d64c4c..8fb4b934d43 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -956,6 +956,26 @@ def modify(args, config, basepath, workspace): bb.utils.mkdirhier(os.path.dirname(appendfile)) with open(appendfile, 'w') as f: + # if not present, add type=git-dependency to the secondary sources + # (non local files) so they can be extracted correctly when building a recipe after + # doing a devtool modify on it + src_uri = rd.getVar('SRC_URI').split() + src_uri_append = [] + src_uri_remove = [] + + # Assume first entry is main source extracted in ${S} so skip it + src_uri = src_uri[1::] + + #Add "type=git-dependency" to all non local sources + for url in src_uri: + if not url.startswith('file://') and not 'type=' in url: + src_uri_remove.append(url) + src_uri_append.append('%s;type=git-dependency' % url) + + if src_uri_remove: + f.write('SRC_URI:remove = "%s"\n' % ' '.join(src_uri_remove)) + f.write('SRC_URI:append = "%s"\n\n' % ' '.join(src_uri_append)) + f.write('FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"\n') # Local files can be modified/tracked in separate subdir under srctree # Mostly useful for packages with S != WORKDIR From patchwork Tue Jan 23 14:06:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Stephan X-Patchwork-Id: 38243 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 ACD26C47258 for ; Tue, 23 Jan 2024 14:07:08 +0000 (UTC) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mx.groups.io with SMTP id smtpd.web11.13148.1706018819071496232 for ; Tue, 23 Jan 2024 06:06:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=zz7+8OIy; spf=pass (domain: baylibre.com, ip: 209.85.208.176, mailfrom: jstephan@baylibre.com) Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ceba21ccccso26216471fa.3 for ; Tue, 23 Jan 2024 06:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1706018816; x=1706623616; 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=ImmVnxbKZqVDhBcDBEdPfxHuaz+S0teTbpVaIWgLr6I=; b=zz7+8OIyePP/r/tJ87t/etcKHE6cUB9EDkCMj+10KjpoJJecquksN8MIafqMgpbERi hstbIzW6aUgt2XQ0HvQSp2afE4IaFhIvLRQ2ejMv8Iwg8xYLD4Dx7jD+WIrOTs/biriM 4cp2LUWK2UxCjnOEXjPur6FCceM8CPc38AwkWbfVLmH98HfGbcWf3KpJYvvSltBKJ/cq JkCvJekZOmJ1EgT2Sbd9M+HNHg/hudZHfDWerR9xIVGqmQ0/xaDENc1WFieHoS8gkVpe TCQVHANz17/2sYPMHkTBuVdCB4zC8jXLTDaXuizLJXZIYV6dqM9Z6D+GClaDPl16pz0Z QhzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706018816; x=1706623616; 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=ImmVnxbKZqVDhBcDBEdPfxHuaz+S0teTbpVaIWgLr6I=; b=W9mzTKReHeMHMTpoyhWVp6mb40oGTVUYJv+DpRAHq1W/AwW7J3rKV4mWVPNl8KKVtp UcQkx+LBhAhAJevrQ2Exul7ZV6kbPU5p4oj9cJIFLjAQqUQOKc8ZKYv/diLV1K5wcxnm 4UQaZZkO+PCqsLtUFrc8pAPRrPzTJ4/K5REw4cDojOzS+f0dpjd57550dsBM0qb9WQoE e3jRKf3wiRInunnd0LEcnmurhAIZFTlPWQSRZ91dkOyytk02/MF1REI3k5wHfxSos47M x/I9oqeoJJA0a+yeGQiYGNtPfTouFEuDLiNrTITHHMDoHrFsH3y2V/qVbznqHOmYHo9I U4nw== X-Gm-Message-State: AOJu0Yy3BQrp0nzCG4tSvVZXnN2xq1yaoQMlEbuUs0gc+OW89cRYLRdD MiyQlyAOkJ0h6vwRynJyz9Z0NvthSRUvYsi7T54XjwdYJQEPDjCYrFRrSWDwPU7z56+6PEjzDp8 /8ec= X-Google-Smtp-Source: AGHT+IGTlpkzcgHlAV2ED9t/fCb4WovYyOxRtL9zM4DvmQj6xPwAYdS+FMuL3zQIuxUsntEZPWCEcg== X-Received: by 2002:a2e:8801:0:b0:2cd:c75d:8a60 with SMTP id x1-20020a2e8801000000b002cdc75d8a60mr2743882ljh.40.1706018816607; Tue, 23 Jan 2024 06:06:56 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:55f:21e0:9e19:4376:dea6:dbfa]) by smtp.gmail.com with ESMTPSA id q9-20020adff789000000b00337d6aa3912sm12998447wrp.10.2024.01.23.06.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 06:06:55 -0800 (PST) From: Julien Stephan To: openembedded-core@lists.openembedded.org Cc: Julien Stephan Subject: [PATCH v3 3/3] oeqa/selftest/devtool: add test for recipes with multiple sources in SRC_URI Date: Tue, 23 Jan 2024 15:06:51 +0100 Message-ID: <20240123140651.930307-4-jstephan@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123140651.930307-1-jstephan@baylibre.com> References: <20240123140651.930307-1-jstephan@baylibre.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 ; Tue, 23 Jan 2024 14:07:08 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/194240 add a non regression test for devtool modify/build on recipe having several sources in SRC_URI Signed-off-by: Julien Stephan --- meta/lib/oeqa/selftest/cases/devtool.py | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index a8777207694..6ed51d7a452 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1086,6 +1086,32 @@ class DevtoolModifyTests(DevtoolBase): check('devtool-override-qemuarm', 'This is a test for qemuarm\n') check('devtool-override-qemux86', 'This is a test for qemux86\n') + def test_devtool_modify_multiple_sources(self): + # This test check that recipes fetching several sources can be used with devtool modify/build + # Check preconditions + testrecipe = 'bzip2' + src_uri = get_bb_var('SRC_URI', testrecipe) + src1 = 'https://' in src_uri + src2 = 'git://' in src_uri + self.assertTrue(src1 and src2, 'This test expects the %s recipe to fetch both a git source and a tarball and it seems that it no longer does' % testrecipe) + # Clean up anything in the workdir/sysroot/sstate cache + bitbake('%s -c cleansstate' % testrecipe) + # Try modifying a recipe + tempdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(tempdir) + self.track_for_cleanup(self.workspacedir) + self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe) + self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') + result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) + self.assertEqual(result.status, 0, "Could not modify recipe %s. Output: %s" % (testrecipe, result.output)) + # Test devtool status + result = runCmd('devtool status') + self.assertIn(testrecipe, result.output) + self.assertIn(tempdir, result.output) + # Try building + result = bitbake(testrecipe) + self.assertEqual(result.status, 0, "Bitbake failed, exit code %s, output %s" % (result.status, result.output)) + class DevtoolUpdateTests(DevtoolBase): def test_devtool_update_recipe(self):