[llvm-branch-commits] [llvm] 9595a7f - [gn build] Download prebuilt mac-arm64 binary now that it exists

Nico Weber via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 25 09:13:10 PST 2020


Author: Nico Weber
Date: 2020-11-25T12:08:48-05:00
New Revision: 9595a7ff55b6f3bf316ae182390fc74da65dda51

URL: https://github.com/llvm/llvm-project/commit/9595a7ff55b6f3bf316ae182390fc74da65dda51
DIFF: https://github.com/llvm/llvm-project/commit/9595a7ff55b6f3bf316ae182390fc74da65dda51.diff

LOG: [gn build] Download prebuilt mac-arm64 binary now that it exists

Sadly requires an ugly workaround for an ugly bug, but still nicer than
building locally.

Added: 
    

Modified: 
    llvm/utils/gn/get.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/get.py b/llvm/utils/gn/get.py
index f778ab931bba..bb185c187783 100755
--- a/llvm/utils/gn/get.py
+++ b/llvm/utils/gn/get.py
@@ -47,21 +47,15 @@ def main():
     if not platform:
         print('no prebuilt binary for', sys.platform)
         return 1
-    if platform == 'mac-arm64':
-        print('no prebuilt mac-arm64 binaries yet. build it yourself with:')
-        print('  rm -rf /tmp/gn &&')
-        print('  pushd /tmp && git clone https://gn.googlesource.com/gn &&')
-        print('  cd gn && build/gen.py && ninja -C out gn && popd &&')
-        print('  mkdir -p llvm/utils/gn/bin/mac-arm64 &&')
-        print('  cp /tmp/gn/out/gn llvm/utils/gn/bin/mac-arm64')
-        return 1
-
     dirname = os.path.join(os.path.dirname(__file__), 'bin', platform)
     if not os.path.exists(dirname):
         os.makedirs(dirname)
 
     url = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/%s/+/latest'
     gn = 'gn' + ('.exe' if sys.platform == 'win32' else '')
+    if platform == 'mac-arm64': # For https://openradar.appspot.com/FB8914243
+        try: os.remove(os.path.join(dirname, gn))
+        except OSError: pass
     download_and_unpack(url % platform, dirname, gn)
     set_executable_bit(os.path.join(dirname, gn))
 


        


More information about the llvm-branch-commits mailing list