From patchwork Wed May 22 09:28:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 44027 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 6AB7AC25B7A for ; Wed, 22 May 2024 09:28:22 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web10.5832.1716370100765728480 for ; Wed, 22 May 2024 02:28:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=QlkjNNjo; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-41fd5dc0480so39059685e9.1 for ; Wed, 22 May 2024 02:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1716370099; x=1716974899; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=HO2u5ASUXtbMB1XvwpcMhkfDOsPmjeV2MAbIoEifP6w=; b=QlkjNNjoSuLGJUWIRdZ+hVBOgutRUAqSBpkgiwXUKQ166rBKvGs+kLcEb8+S+0/yp7 mYtqGSs5hoOVxOyHhaLKC6j6gsNwMU+jmqsmy7RizPIcVMltQWYccSFaVpo3AujYVE+w ir547XuV/BonHP/0332x6D4nYjOSF5AaQeeO4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716370099; x=1716974899; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HO2u5ASUXtbMB1XvwpcMhkfDOsPmjeV2MAbIoEifP6w=; b=fKgkOJZ8wId3leMlZ2Fw0kJvD0DKhk3v+uLN6RvEKgL3v6DNkp+xF05AeUEVgmGSZx eghqQqlOsQeghzrG7Aph7Xv4CpInU2vWuPfph9mFb7mLi0aOJJrRfDY4/mXB6LM3X4cu vydTemAkqYJDx+a2O1YLGJa372mehOdtSXv+YzgCTPzdMqi5fbFE+nyjtuIcO5glQ1PJ raSFhRszwMpkfHmbkmI1bDwmgMr3Di/0NCjhm3W5ZG/J+h6O30HNrG7rWgYvUTw8SlHm 7Hl4BFySfHtu4OBWqRDe7gdjbWrwYFRxIbUkAZ3ovXYxQrBEqnpzZBL2h3C3KXWWNKu2 1frw== X-Gm-Message-State: AOJu0YxdEhOmQdLJTKNJAfo5k5TV2WBi/i4dLNNFlvPStRfzk/WfNeN0 7mZQEa3CvJKtbXSKIXMwKLBtKdiJ11E8hMv2mEaGK4aVNs5oD3+/Ehkr5tG+fRjjCXxmTyp2z2o Lklk= X-Google-Smtp-Source: AGHT+IG+hcwkJRrFkOpvRf+l64afSJ2yjZ3wCWpCRXRN7JBab1Lv0JEB5sjkfLJxkK2dVD2pYfAYVw== X-Received: by 2002:a7b:cb44:0:b0:41b:ab72:3f4d with SMTP id 5b1f17b1804b1-420fd2d6eb5mr10033105e9.1.1716370098693; Wed, 22 May 2024 02:28:18 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:ef1c:155d:9d8e:11ce]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fe36f373fsm470058385e9.20.2024.05.22.02.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 02:28:18 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/3] base: Switch UNPACKDIR to a subdir of WORKDIR Date: Wed, 22 May 2024 10:28:15 +0100 Message-Id: <20240522092817.1250809-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.40.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 ; Wed, 22 May 2024 09:28:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/199738 Change do_unpack to unpack files to a subdirectory of WORKDIR instead of WORKDIR itself. There are several good reasons for this but it is mainly about being able to isolate the output of the unpack task and tell the files apart from other things which are created in workdir (logs, sysroots, temp dirs and more). This means that when the do_unpack task reruns, we can clean UNPACKDIR and know we have a standard point to start builds from. It also makes code in tools like devtool and recipetool easier. To reduce the impact to users, if a subdirectory under UNPACKDIR matches the first subdirectory under WORKDIR of S, that directory is moved into position inside WORKDIR. This preserves the behaviour of S = "${WORKDIR}/git", S = "${WORKDIR}/${BPN}" and other commonly used source directory setups. The directory is moved since sadly many autotools based projects can't cope with symlinks in their paths. The patch also updates reproducible and SOURCE_DATE_EPOCH handling to match the new potential source locations. We can get rid of the horrible list of hardcoded directories in WORKDIR to ignore from that code. Signed-off-by: Richard Purdie --- meta/classes-global/base.bbclass | 28 +++++++++++++++++++++++----- meta/conf/bitbake.conf | 2 +- meta/lib/oe/reproducible.py | 19 ++++++++++--------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 066f3848f7c..13e91b24a3b 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -153,20 +153,38 @@ python base_do_fetch() { } addtask unpack after do_fetch -do_unpack[dirs] = "${UNPACKDIR}" - -do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) != os.path.normpath(d.getVar('WORKDIR')) else os.path.join('${S}', 'patches')}" +do_unpack[cleandirs] = "${UNPACKDIR}" python base_do_unpack() { + import shutil + + sourcedir = d.getVar('S') + # Intentionally keep SOURCE_BASEDIR internal to the task just for SDE + d.setVar("SOURCE_BASEDIR", sourcedir) + src_uri = (d.getVar('SRC_URI') or "").split() if not src_uri: return + basedir = None + unpackdir = d.getVar('UNPACKDIR') + workdir = d.getVar('WORKDIR') + if sourcedir.startswith(workdir) and not sourcedir.startswith(unpackdir): + basedir = sourcedir.replace(workdir, '').strip("/").split('/')[0] + if basedir: + bb.utils.remove(workdir + '/' + basedir, True) + d.setVar("SOURCE_BASEDIR", workdir + '/' + basedir) + try: fetcher = bb.fetch2.Fetch(src_uri, d) fetcher.unpack(d.getVar('UNPACKDIR')) except bb.fetch2.BBFetchException as e: bb.fatal("Bitbake Fetcher Error: " + repr(e)) + + if basedir and os.path.exists(unpackdir + '/' + basedir): + # Compatibility magic to ensure ${WORKDIR}/git and ${WORKDIR}/${BP} + # as often used in S work as expected. + shutil.move(unpackdir + '/' + basedir, workdir + '/' + basedir) } SSTATETASKS += "do_deploy_source_date_epoch" @@ -199,8 +217,8 @@ addtask do_deploy_source_date_epoch_setscene addtask do_deploy_source_date_epoch before do_configure after do_patch python create_source_date_epoch_stamp() { - # Version: 1 - source_date_epoch = oe.reproducible.get_source_date_epoch(d, d.getVar('S')) + # Version: 2 + source_date_epoch = oe.reproducible.get_source_date_epoch(d, d.getVar('SOURCE_BASEDIR') or d.getVar('S')) oe.reproducible.epochfile_write(source_date_epoch, d.getVar('SDE_FILE'), d) } do_unpack[postfuncs] += "create_source_date_epoch_stamp" diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index b2c500d8739..75c850760f6 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -405,7 +405,7 @@ STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}" STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*" BASE_WORKDIR ?= "${TMPDIR}/work" WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}" -UNPACKDIR ??= "${WORKDIR}" +UNPACKDIR ??= "${WORKDIR}/sources-unpack" T = "${WORKDIR}/temp" D = "${WORKDIR}/image" S = "${WORKDIR}/${BP}" diff --git a/meta/lib/oe/reproducible.py b/meta/lib/oe/reproducible.py index a9f717159e3..1957c974347 100644 --- a/meta/lib/oe/reproducible.py +++ b/meta/lib/oe/reproducible.py @@ -75,10 +75,10 @@ def get_source_date_epoch_from_known_files(d, sourcedir): return source_date_epoch def find_git_folder(d, sourcedir): - # First guess: WORKDIR/git + # First guess: UNPACKDIR/git # This is the default git fetcher unpack path - workdir = d.getVar('WORKDIR') - gitpath = os.path.join(workdir, "git/.git") + unpackdir = d.getVar('UNPACKDIR') + gitpath = os.path.join(unpackdir, "git/.git") if os.path.isdir(gitpath): return gitpath @@ -88,15 +88,16 @@ def find_git_folder(d, sourcedir): return gitpath # Perhaps there was a subpath or destsuffix specified. - # Go looking in the WORKDIR - exclude = set(["build", "image", "license-destdir", "patches", "pseudo", - "recipe-sysroot", "recipe-sysroot-native", "sysroot-destdir", "temp"]) - for root, dirs, files in os.walk(workdir, topdown=True): - dirs[:] = [d for d in dirs if d not in exclude] + # Go looking in the UNPACKDIR + for root, dirs, files in os.walk(unpackdir, topdown=True): if '.git' in dirs: return os.path.join(root, ".git") - bb.warn("Failed to find a git repository in WORKDIR: %s" % workdir) + for root, dirs, files in os.walk(sourcedir, topdown=True): + if '.git' in dirs: + return os.path.join(root, ".git") + + bb.warn("Failed to find a git repository in UNPACKDIR: %s" % unpackdir) return None def get_source_date_epoch_from_git(d, sourcedir): From patchwork Wed May 22 09:28:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 44026 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 6D8D2C41513 for ; Wed, 22 May 2024 09:28:22 +0000 (UTC) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by mx.groups.io with SMTP id smtpd.web11.5840.1716370101680552547 for ; Wed, 22 May 2024 02:28:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=hEXT6MWB; spf=pass (domain: linuxfoundation.org, ip: 209.85.208.173, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2e271acb015so82319731fa.1 for ; Wed, 22 May 2024 02:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1716370100; x=1716974900; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=weeqhOZI7QdwGNxdECbfM7t15XMHjD4SKqwEEl/hdgo=; b=hEXT6MWBfjuIiVOtSj8Oqc3rOLKfRKfdSfayN9zx+lfeQnmhObIxNpMe81WvAQ88tU UaUjtR31uZnsJHKtCJHK5MXCAxg1a5rbOqocTLQ3EpO1sVFLU3dEN3ye+9Lw5HUXWbJU /c3SQoOUWIrzcVDQ5HrfWZ2oifMj0PBidpBvA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716370100; x=1716974900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=weeqhOZI7QdwGNxdECbfM7t15XMHjD4SKqwEEl/hdgo=; b=r3l8lX8T7k7gnl5OjyMdFkSLbGfdEKgY8xu8vvsx05hxOwUELsCLocvtl62VXH3r5Z J2NBE8H08Fzh7ZeyjM3mA0tbWYfPFlnwy7pTtlcrrZzrbkM6FgF8q3M0frF0MBub8i1x KUK/LId+nkoUvpALQfoQ7YMh313fMxH4b5pwYKVGMmXQfsSXhaEHOG7KjBVkMgSHdPbF VkU2gGOsCOuXaMDUgU1BYI2sXXYimJcG89n1tmhjmiNkHB9aRQ3uwXibqRC/XAYBrBo2 h50GFRUBLxV7CfF8rnUp+MUV4AwMJ9Kj2SiZ2dIlxvczytzJmm97pVYxGmrs0GeWnPCe vQ0w== X-Gm-Message-State: AOJu0Yw7IVQz0gV0Uglz3G6XhydSgTZVcQZ6PTyUW3C2oukwjwgvAKbo Gb1f4uep+GmXABakzkhr3ZoAYWeCzPBCAXBZ6f7lUJtR0c4xGy2k7kaLMDkQIDK7j+K9mbulNOl t X-Google-Smtp-Source: AGHT+IFEaQUvljUZraE/82ZiAsZXFaGk2cgK3UqMZBU3BoWN17F/9G0X8WKYUO91N46F+T57DjTtdg== X-Received: by 2002:a2e:361a:0:b0:2e0:e470:882f with SMTP id 38308e7fff4ca-2e9494bc8b1mr8840821fa.28.1716370099333; Wed, 22 May 2024 02:28:19 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:ef1c:155d:9d8e:11ce]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fe36f373fsm470058385e9.20.2024.05.22.02.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 02:28:19 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/3] recipetool/devtool: Update to work correctly with UNPACKDIR Date: Wed, 22 May 2024 10:28:16 +0100 Message-Id: <20240522092817.1250809-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240522092817.1250809-1-richard.purdie@linuxfoundation.org> References: <20240522092817.1250809-1-richard.purdie@linuxfoundation.org> 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 ; Wed, 22 May 2024 09:28:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/199739 Tweak recipetool and devtool to correclty use UNPACKDIR. This allows some simplification of the code. This patch makes things basically work but there are likely deeper improvements that can be made now that WORKDIR != UNPACKDIR. Signed-off-by: Richard Purdie --- scripts/lib/devtool/upgrade.py | 2 +- scripts/lib/recipetool/create.py | 2 +- scripts/lib/scriptutils.py | 15 ++------------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index fa5b8ef3c77..a8130ed23f5 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -32,7 +32,7 @@ def _run(cmd, cwd=''): def _get_srctree(tmpdir): srctree = tmpdir - dirs = scriptutils.filter_src_subdirs(tmpdir) + dirs = os.listdir(tmpdir) if len(dirs) == 1: srctree = os.path.join(tmpdir, dirs[0]) else: diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 8e9ff38db6c..066366e34f6 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py @@ -528,7 +528,7 @@ def create_recipe(args): if ftmpdir and args.keep_temp: logger.info('Fetch temp directory is %s' % ftmpdir) - dirlist = scriptutils.filter_src_subdirs(srctree) + dirlist = os.listdir(srctree) logger.debug('Directory listing (excluding filtered out):\n %s' % '\n '.join(dirlist)) if len(dirlist) == 1: singleitem = os.path.join(srctree, dirlist[0]) diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py index f23e53cba93..81f0b01fa53 100644 --- a/scripts/lib/scriptutils.py +++ b/scripts/lib/scriptutils.py @@ -179,6 +179,8 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False, mirr f.write('SRCREV = "%s"\n' % srcrev) f.write('PV = "0.0+"\n') f.write('WORKDIR = "%s"\n' % tmpworkdir) + f.write('UNPACKDIR = "%s"\n' % destdir) + # Set S out of the way so it doesn't get created under the workdir f.write('S = "%s"\n' % os.path.join(tmpdir, 'emptysrc')) if not mirrors: @@ -232,10 +234,6 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False, mirr if e.errno != errno.ENOTEMPTY: raise - bb.utils.mkdirhier(destdir) - for fn in os.listdir(tmpworkdir): - shutil.move(os.path.join(tmpworkdir, fn), destdir) - finally: if not preserve_tmp: shutil.rmtree(tmpdir) @@ -271,12 +269,3 @@ def is_src_url(param): return True return False -def filter_src_subdirs(pth): - """ - Filter out subdirectories of initial unpacked source trees that we do not care about. - Used by devtool and recipetool. - """ - dirlist = os.listdir(pth) - filterout = ['git.indirectionsymlink', 'source-date-epoch', 'sstate-install-recipe_qa'] - dirlist = [x for x in dirlist if x not in filterout] - return dirlist From patchwork Wed May 22 09:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 44028 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 88696C25B77 for ; Wed, 22 May 2024 09:28:22 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.web10.5833.1716370101819215846 for ; Wed, 22 May 2024 02:28:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=ExGdko5+; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.45, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4202cea9941so38513855e9.1 for ; Wed, 22 May 2024 02:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1716370100; x=1716974900; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ctyfd0pYVWbDeUUCXtZrRzFklh68amOhsFdK4pFP4M4=; b=ExGdko5+813ULw3lHUmNe8Xan1FXhbUfsdqhHiLfQmj36PWUo5y1yQbvXHECfZIPTP bxqUzJQtdyX7J+bQWszvzG7ZcabbaBAvxrK0ytdUs/5PSS2fJlYIxNWlLYayGFzqt2kW 6lVns4gNLczmIdwLrX9O04kpOujWalKAWkJ+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716370100; x=1716974900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ctyfd0pYVWbDeUUCXtZrRzFklh68amOhsFdK4pFP4M4=; b=hx5+DdAuAnCFksgNS41lE8wHj2nziL3zG1iokRLhlxou67IJxYDnYXAoJ7XxLa8tPs yISHrEQKMyRQNvra+uboA3JRXev+vt3HpmcTjf1fjHTth2DdYDs+ZSAilM+zhz/bOnHm hsxYzdMvAZJXNdJ80ulHgRn0v97nBQNQAxLKXPV6lrByzQrWzc3jiNiorXNMgvfabu6o Qu9aVf20TQ4Uwx9TzzM5fgqE/66tqsvF5rW/oUzbp9NxsGTqob6BhZSmCOOjBEzQtqgg JoxZvR1bKGZdzsW4lBcFD36kajQfJ/jAZjFL7pU+UD3t5feHJLl0rv0Rz9ot+hrCIT1k fv7g== X-Gm-Message-State: AOJu0YwWRJi7pFaBWtLP2ZsZVEWz1TvEbq1g46M+7lHZOog9M8pshgFt tECsSBt3yLKDB9f7cZTkYd0TWnvg/aqx0vn552dQEOhkX+GTTSb8G5WjPtjn+N+68UAolezJooC 23Lk= X-Google-Smtp-Source: AGHT+IF3f5svFAAyzx+Xhje3geuDPsZyMJb+VxsHlzQOdJsSfmC3hhpvv1vd1TJ3hvtJxsd/hSgHog== X-Received: by 2002:a05:600c:22da:b0:41a:c86e:a4db with SMTP id 5b1f17b1804b1-420fd2fe98fmr9736365e9.9.1716370100037; Wed, 22 May 2024 02:28:20 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:ef1c:155d:9d8e:11ce]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fe36f373fsm470058385e9.20.2024.05.22.02.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 02:28:19 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/3] insane: Error for S == WORKDIR Date: Wed, 22 May 2024 10:28:17 +0100 Message-Id: <20240522092817.1250809-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240522092817.1250809-1-richard.purdie@linuxfoundation.org> References: <20240522092817.1250809-1-richard.purdie@linuxfoundation.org> 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 ; Wed, 22 May 2024 09:28:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/199740 Where a recipe uses WORKDIR as S, exit with a fatal error since the code is no longer safe for this layout. Signed-off-by: Richard Purdie --- meta/classes-global/insane.bbclass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 03ac06b102f..eeef43d00e2 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -1602,6 +1602,11 @@ python () { if prog.search(pn): oe.qa.handle_error("uppercase-pn", 'PN: %s is upper case, this can result in unexpected behavior.' % pn, d) + sourcedir = d.getVar("S") + workdir = d.getVar("WORKDIR") + if sourcedir == workdir: + bb.fatal("Using S = ${WORKDIR} is no longer supported") + # Some people mistakenly use DEPENDS:${PN} instead of DEPENDS and wonder # why it doesn't work. if (d.getVar(d.expand('DEPENDS:${PN}'))):