]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity: Add check for WSL
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Nov 2018 10:28:10 +0000 (10:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Dec 2018 22:31:31 +0000 (22:31 +0000)
Users are starting to expect OE to work under WSL which it doesn't. Add a warning to
tell them about this up front and manage expectations.

(From OE-Core rev: 4f22710f9a310412f1de0b4e6905c058ec416f25)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/sanity.bbclass

index 4e8eae8946de2452d746fc6b5aa039cd40564712..374dacf4d0e442330a8a77c9c850a59ff8538eae 100644 (file)
@@ -511,6 +511,16 @@ def check_make_version(sanity_data):
     return None
 
 
+# Check if we're running on WSL (Windows Subsystem for Linux). Its known not to
+# work but we should tell the user that upfront.
+def check_wsl(d):
+    with open("/proc/version", "r") as f:
+        verdata = f.readlines()
+    for l in verdata:
+        if "Microsoft" in l:
+            return "OpenEmbedded doesn't work under WSL at this time, sorry"
+    return None
+
 # Tar version 1.24 and onwards handle overwriting symlinks correctly
 # but earlier versions do not; this needs to work properly for sstate
 def check_tar_version(sanity_data):
@@ -625,6 +635,7 @@ def check_sanity_version_change(status, d):
     status.addresult(check_tar_version(d))
     status.addresult(check_git_version(d))
     status.addresult(check_perl_modules(d))
+    status.addresult(check_wsl(d))
 
     missing = ""