Skip to contentSkip to conversation

improve the sanity check for PATH and BBPATH

PATCH In review Shiqun.Lin 3 participants 3 messages Dec 4, 2014 – May 19, 2015

lore
Share & tools
lore

Shiqun.Lin

author
#0 lore raw

PATCH 1/1 improve the sanity check for PATH and BBPATH

From 583f97149ed3122e7b196f08c6bceca9d5a4961c Mon Sep 17 00:00:00 2001
From: Shiqun Lin <[email protected]>
Date: Thu, 4 Dec 2014 09:50:18 +0800
Subject: [PATCH] improve the sanity check for PATH and BBPATH

Issue: LIN5-19447, Build fails if "./" is in the PATH

a customer was using "./" in his PATH, and this breaks the build.

$ export PATH="./:$PATH"
$ make -C build-tools elfutils
---
 meta/classes/sanity.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/sanity.bbclass +4 -4
index c2e7bee..1ade542 100644
@@ -388,15 +388,15 @@ def check_sanity(sanity_data):
             messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH"
 
     paths = sanity_data.getVar('PATH', True).split(":")
-    if "." in paths or "" in paths:
-        messages = messages + "PATH contains '.' or '', which will break the build, please remove this."
+    if "." in paths or "./" in paths or "" in paths:
+        messages = messages + "PATH contains '.', './' or '', which will break the build, please remove this."
 
     bbpaths = sanity_data.getVar('BBPATH', True).split(":")
-    if "." in bbpaths or "" in bbpaths:
+    if "." in bbpaths or "./" in bbpaths or "" in bbpaths:
         # TODO: change the following message to fatal when all BBPATH issues
         # are fixed
         bb.warn("BBPATH references the current directory, either through "    \
-                "an empty entry, or a '.'.\n\t This is unsafe and means your "\
+                "an empty entry, a './', or a '.'.\n\t This is unsafe and means your "\
                 "layer configuration is adding empty elements to BBPATH.\n\t "\
                 "Please check your layer.conf files and other BBPATH "        \
                 "settings to remove the current working directory "           \
Signature · 1 line
1.8.5.2.233.g932f7e4
#2 lore raw

Hi Ross,

Please refer to attachment for the rebased patch.

Thanks
Wenzong

Quoted 9 lines · Ross

This doesn't apply to master, can you rebase?

Ross

On 4 December 2014 at 02:29, Shiqun.Lin <[email protected] <mailto:[email protected]>> wrote:

Quoted 10 lines
    --
    _______________________________________________
    Openembedded-core mailing list
    [email protected]
    <mailto:[email protected]>
    http://lists.openembedded.org/mailman/listinfo/openembedded-core

From 21d94c8ea648650653636610765dd78be970b2ee Mon Sep 17 00:00:00 2001
From: Shiqun Lin <[email protected]>
Date: Wed, 7 Jan 2015 15:00:31 +0800
Subject: [PATCH] sanity.bbclass: improve the sanity check for PATH and BBPATH

Build fails if "./" is in the PATH

To reproduce the issue:

  $ export PATH="./:$PATH"
  $ make -C build-tools elfutils

Error: ./ld: unrecognized option '--sysroot=/'

---
 meta/classes/sanity.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/sanity.bbclass +4 -4
index fc8c980..e738110 100644
@@ -653,9 +653,9 @@ def check_sanity_version_change(status, d):
             status.addresult("You have a 32-bit libc, but no 32-bit headers.  You must install the 32-bit libc headers.\n")
 
     bbpaths = d.getVar('BBPATH', True).split(":")
-    if ("." in bbpaths or "" in bbpaths) and not status.reparse:
+    if ("." in bbpaths or "./" in bbpaths or "" in bbpaths) and not status.reparse:
         status.addresult("BBPATH references the current directory, either through "    \
-                "an empty entry, or a '.'.\n\t This is unsafe and means your "\
+                "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\
                 "layer configuration is adding empty elements to BBPATH.\n\t "\
                 "Please check your layer.conf files and other BBPATH "        \
                 "settings to remove the current working directory "           \
@@ -693,8 +693,8 @@ def check_sanity_everybuild(status, d):
     sanity_check_conffiles(status, d)
 
     paths = d.getVar('PATH', True).split(":")
-    if "." in paths or "" in paths:
-        status.addresult("PATH contains '.' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
+    if "." in paths or "./" in paths or "" in paths:
+        status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
 
     # Check that the DISTRO is valid, if set
     # need to take into account DISTRO renaming DISTRO
Signature · 1 line
1.9.1