diff mbox series

[07/10] insane: Warn about S == WORKDIR

Message ID 20240515115620.420558-7-richard.purdie@linuxfoundation.org
State New
Headers show
Series [01/10] recipes: Start WORKDIR -> UNPACKDIR transition | expand

Commit Message

Richard Purdie May 15, 2024, 11:56 a.m. UTC
Where a recipe uses WORKDIR as S, add a warning since we're going
to stop supporting this soon.

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..7af29ded458 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.warn("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}'))):