[Lldb-commits] [lldb] 4db7832 - [LLDB] Make API tests to run using MSYS tools

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 1 02:02:10 PDT 2022


Author: Muhammad Omair Javaid
Date: 2022-09-01T14:00:46+05:00
New Revision: 4db78322031ffbd5ea607d7ff66fed5fafb40d68

URL: https://github.com/llvm/llvm-project/commit/4db78322031ffbd5ea607d7ff66fed5fafb40d68
DIFF: https://github.com/llvm/llvm-project/commit/4db78322031ffbd5ea607d7ff66fed5fafb40d68.diff

LOG: [LLDB] Make API tests to run using MSYS tools

MSYS 'uname' on windows returns "MSYS_NT*" instead of windows32 and also
MSYS 'pwd' returns non-windows path string.
This patch fixes Makefile.rules to make adjustments required to run LLDB
API tests using MSYS tools.

Differential Revision: https://reviews.llvm.org/D133002

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 36ef02810152..937a2ae06fc4 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -49,8 +49,9 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
 #----------------------------------------------------------------------
 # If OS is not defined, use 'uname -s' to determine the OS name.
 #
-# uname on Windows gives "windows32" or "server version windows32", but most
-# environments standardize on "Windows_NT", so we'll make it consistent here.
+# GNUWin32 uname gives "windows32" or "server version windows32" while
+# some versions of MSYS uname return "MSYS_NT*", but most environments
+# standardize on "Windows_NT", so we'll make it consistent here. 
 # When running tests from Visual Studio, the environment variable isn't
 # inherited all the way down to the process spawned for make.
 #----------------------------------------------------------------------
@@ -58,6 +59,11 @@ HOST_OS := $(shell uname -s)
 ifneq (,$(findstring windows32,$(HOST_OS)))
 	HOST_OS := Windows_NT
 endif
+
+ifneq (,$(findstring MSYS_NT,$(HOST_OS)))
+	HOST_OS := Windows_NT
+endif
+
 ifeq "$(OS)" ""
 	OS := $(HOST_OS)
 endif
@@ -68,9 +74,12 @@ endif
 # Some versions of make on Windows will search for other shells such as
 # C:\cygwin\bin\sh.exe. This shell fails for numerous 
diff erent reasons
 # so default to using cmd.exe.
+# Also reset BUILDDIR value because "pwd" returns cygwin or msys path
+# which needs to be converted to windows path.
 #----------------------------------------------------------------------
 ifeq "$(OS)" "Windows_NT"
 	SHELL = $(WINDIR)\system32\cmd.exe
+	BUILDDIR := $(shell echo %cd%)
 endif
 
 #----------------------------------------------------------------------


        


More information about the lldb-commits mailing list