[Lldb-commits] [PATCH] D133011: [LLDB] Make build.py use uname to set platform

Muhammad Omair Javaid via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 31 04:39:00 PDT 2022


omjavaid created this revision.
Herald added a project: All.
omjavaid requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This patch makes build helper script build.py to use platform.uname for
machine/architecture detection. Visual studio environment when set using
various batch files like vcvars*.bat set PLATFORM environment variable
however VsDevCmd.bat does not set PLATFORM variable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133011

Files:
  lldb/test/Shell/helper/build.py


Index: lldb/test/Shell/helper/build.py
===================================================================
--- lldb/test/Shell/helper/build.py
+++ lldb/test/Shell/helper/build.py
@@ -2,6 +2,7 @@
 
 import argparse
 import os
+import platform
 import shutil
 import signal
 import subprocess
@@ -274,7 +275,7 @@
     def __init__(self, toolchain_type, args):
         Builder.__init__(self, toolchain_type, args, '.obj')
 
-        if os.getenv('PLATFORM') == 'arm64':
+        if platform.uname().machine.lower() == 'arm64':
             self.msvc_arch_str = 'arm' if self.arch == '32' else 'arm64'
         else:
             self.msvc_arch_str = 'x86' if self.arch == '32' else 'x64'


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133011.456926.patch
Type: text/x-patch
Size: 686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220831/c186c319/attachment.bin>


More information about the lldb-commits mailing list