]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity: check the format of SDK_VENDOR
authorRoss Burton <ross.burton@intel.com>
Mon, 14 Oct 2019 11:42:57 +0000 (12:42 +0100)
committerArmin Kuster <akuster808@gmail.com>
Sat, 26 Oct 2019 06:44:33 +0000 (23:44 -0700)
If SDK_VENDOR isn't formatted as -foosdk and is instead for example -foo-sdk
then the triple that are constructed are not in fact triples, which results in
mysterious compile errors.

Check in sanity.bbclass so this failure is detected early.

[ YOCTO #13573 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b0efd8d4d0dbc30e6505b42f5603f18fa764d732)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/sanity.bbclass

index 2d3f49eb1a748cf2ed7d553a080e1859e7cfa621..705062bc864e4cae02fc3f8ef1f6d4d58fe1dd4f 100644 (file)
@@ -798,6 +798,11 @@ def check_sanity_everybuild(status, d):
         elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}":
             status.addresult('SDKMACHINE is set, but SDK_ARCH has not been changed as a result - SDKMACHINE may have been set too late (e.g. in the distro configuration)\n')
 
+    # If SDK_VENDOR looks like "-my-sdk" then the triples are badly formed so fail early
+    sdkvendor = d.getVar("SDK_VENDOR")
+    if not (sdkvendor.startswith("-") and sdkvendor.count("-") == 1):
+        status.addresult("SDK_VENDOR should be of the form '-foosdk' with a single dash\n")
+
     check_supported_distro(d)
 
     omask = os.umask(0o022)