[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.
This commit is contained in:
Nico Weber 2020-11-25 12:08:10 -05:00
parent dc96cc33c1
commit 9595a7ff55
1 changed files with 3 additions and 9 deletions

View File

@ -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))