Skip to contentSkip to conversation

Shiqun Lin : sanity.bbclass: improve the sanity check for PATH and BBPATH

oe-commits Andreas Müller 2 participants 4 messages May 22, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 46 lines · On Wed, May 20, 2015 at 11:20 PM, <[email protected]> wrote:
Module: openembedded-core.git
Branch: master-next
Commit: b6a23572b8f14e27d4341892b9069e7cac1e9c14
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=b6a23572b8f14e27d4341892b9069e7cac1e9c14
Author: Shiqun Lin <[email protected]>
Date:   Wed Jan  7 15:00:31 2015 +0800

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 +2 -2
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)
 

meta/classes/sanity.bbclass def check_sanity_everybuild(status, d):

Quoted 10 lines
meta/classes/sanity.bbclass +2 -3
     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
 
--

The PATH part is problematic: My system (fedora 22) or my user - have not yet checked where it comes from - sets './' in PATH. I am not happy risking fallout on my system for yocto's sanity.

Andreas

#2 lore raw
Quoted 34 lines · On Friday 22 May 2015 07:15:36 Andreas Müller wrote:
Quoted 33 lines · On Wed, May 20, 2015 at 11:20 PM, <[email protected]> wrote:

Module: openembedded-core.git
Branch: master-next
Commit: b6a23572b8f14e27d4341892b9069e7cac1e9c14
URL:
http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=b6a23572b
8f14e27d4341892b9069e7cac1e9c14

Author: Shiqun Lin <[email protected]>
Date:   Wed Jan  7 15:00:31 2015 +0800

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 +0 -0
index fc8c980..e738110 100644
Quoted 8 lines

meta/classes/sanity.bbclass def check_sanity_version_change(status, d): · line 658

Quoted 8 lines
meta/classes/sanity.bbclass +1 -1
@@ -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:

Quoted 27 lines
Quoted 27 lines
meta/classes/sanity.bbclass +0 -1
         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 "
\

meta/classes/sanity.bbclass +2 -2
@@ -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

Quoted 5 lines
Quoted 1 line

--

The PATH part is problematic: My system (fedora 22) or my user - have not yet checked where it comes from - sets './' in PATH. I am not happy risking fallout on my system for yocto's sanity.

FWIW, it's not in PATH for my account on F21.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#3 lore raw
Quoted 77 lines · Paul Eggleton
Quoted 34 lines · On Friday 22 May 2015 07:15:36 Andreas Müller wrote:
Quoted 33 lines · On Wed, May 20, 2015 at 11:20 PM, <[email protected]> wrote:

Module: openembedded-core.git
Branch: master-next
Commit: b6a23572b8f14e27d4341892b9069e7cac1e9c14
URL:
http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=b6a23572b
8f14e27d4341892b9069e7cac1e9c14

Author: Shiqun Lin <[email protected]>
Date:   Wed Jan  7 15:00:31 2015 +0800

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 +0 -0
index fc8c980..e738110 100644
Quoted 8 lines

meta/classes/sanity.bbclass def check_sanity_version_change(status, d): · line 658

Quoted 8 lines
meta/classes/sanity.bbclass +1 -1
@@ -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:

Quoted 27 lines
Quoted 27 lines
meta/classes/sanity.bbclass +0 -1
         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 "
\

meta/classes/sanity.bbclass +2 -2
@@ -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

Quoted 5 lines
Quoted 1 line

--

The PATH part is problematic: My system (fedora 22) or my user - have not yet checked where it comes from - sets './' in PATH. I am not happy risking fallout on my system for yocto's sanity.

Quoted 4 lines

FWIW, it's not in PATH for my account on F21.

Cheers,
Paul

FWIW2 (forgive me - I was without coffee): Have F20 here not F22

Andreas

#4 lore raw
Quoted 79 lines · Andreas Müller
Quoted 77 lines · Paul Eggleton
Quoted 34 lines · On Friday 22 May 2015 07:15:36 Andreas Müller wrote:
Quoted 33 lines · On Wed, May 20, 2015 at 11:20 PM, <[email protected]> wrote:

Module: openembedded-core.git
Branch: master-next
Commit: b6a23572b8f14e27d4341892b9069e7cac1e9c14
URL:
http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=b6a23572b
8f14e27d4341892b9069e7cac1e9c14

Author: Shiqun Lin <[email protected]>
Date:   Wed Jan  7 15:00:31 2015 +0800

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 +0 -0
index fc8c980..e738110 100644
Quoted 8 lines

meta/classes/sanity.bbclass def check_sanity_version_change(status, d): · line 658

Quoted 8 lines
meta/classes/sanity.bbclass +1 -1
@@ -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:

Quoted 32 lines
Quoted 27 lines
meta/classes/sanity.bbclass +0 -1
         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 "
\

meta/classes/sanity.bbclass +2 -2
@@ -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

Quoted 1 line

--

The PATH part is problematic: My system (fedora 22) or my user - have not yet checked where it comes from - sets './' in PATH. I am not happy risking fallout on my system for yocto's sanity.

Quoted 6 lines
Quoted 4 lines

FWIW, it's not in PATH for my account on F21.

Cheers,
Paul

FWIW2 (forgive me - I was without coffee): Have F20 here not F22

OK I checked: the entry comes from my .bash_profile in home. As /etc/skel/.bash_profile does not have it and fedora did not touch that file for a while [1] it must have been me who added (although I cannot remember) and we should close this with a 'sorry for the noise'.

[1] http://pkgs.fedoraproject.org/cgit/bash.git/log/dot-bash_profile

Andreas