diff mbox series

[3/3] insane: Error for S == WORKDIR

Message ID 20240522092817.1250809-3-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 32cba1cc916ad530c5e6630a927e74ca6f06289b
Headers show
Series [1/3] base: Switch UNPACKDIR to a subdir of WORKDIR | expand

Commit Message

Richard Purdie May 22, 2024, 9:28 a.m. UTC
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 <richard.purdie@linuxfoundation.org>
---
 meta/classes-global/insane.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

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}'))):