Hash :
4f4062ae
Author :
Date :
2024-11-08T10:18:02
Add support for running the parser generation on Mac For cloud storage, uses new bucket angle-flex-bison-mac for clarity, the names Linux and Mac clash. The lexer diffs seem to be due to formatter changes after the last generation of tjhe lexer. The diffs repro on Linux too. Lexer produces too hard to format source or diffs, and one hunk is left unformatted the first time. Add a workaround. Bug: angleproject:377941128 Change-Id: Id9d8f9a5c4a169955ccd8cd9cb3d632fbb339d28 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000005 Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
#!/usr/bin/python3
#
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# update_flex_bison_binaries.py:
# Helper script to update the version of flex and bison in cloud storage.
# These binaries are used to generate the ANGLE translator's lexer and parser.
# This script relies on flex and bison binaries to be externally built which
# is expected to be a rare operation. It currently only works on Windows and
# Linux. It also will update the hashes stored in the tree. For more info see
# README.md in this folder.
import os
import platform
import shutil
import sys
sys.path.append('tools/')
import angle_tools
def main():
if angle_tools.is_linux:
subdir = 'linux'
files = ['flex', 'bison']
bucket = 'angle-flex-bison'
elif angle_tools.is_mac:
subdir = 'mac'
files = ['flex', 'bison']
bucket = 'angle-flex-bison-mac'
elif angle_tools.is_windows:
subdir = 'windows'
files = [
'flex.exe', 'bison.exe', 'm4.exe', 'msys-2.0.dll', 'msys-iconv-2.dll',
'msys-intl-8.dll'
]
bucket = 'angle-flex-bison'
else:
print('Script must be run on Linux, Mac or Windows.')
return 1
files = [os.path.join(sys.path[0], subdir, f) for f in files]
# Step 1: Upload to cloud storage
if not angle_tools.upload_to_google_storage(bucket, files):
print('Error upload to cloud storage')
return 1
# Step 2: Stage new SHA to git
if not angle_tools.stage_google_storage_sha1(files):
print('Error running git add')
return 2
print('')
print('The updated SHA has been staged for commit. Please commit and upload.')
print('Suggested commit message (please indicate flex/bison versions):')
print('----------------------------')
print('')
print('Update flex and bison binaries for %s.' % platform.system())
print('')
print('These binaries were updated using %s.' % os.path.basename(__file__))
print('Please see instructions in tools/flex-bison/README.md.')
print('')
print('flex is at version TODO.')
print('bison is at version TODO.')
print('')
print('Bug: None')
return 0
if __name__ == '__main__':
sys.exit(main())