Add logic to bundle native mksnapshot for arm/arm64
This commit is contained in:
parent
23bb3bd963
commit
7acbbf2ef3
4 changed files with 53 additions and 13 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -40,6 +40,8 @@
|
||||||
/vendor/llvm/
|
/vendor/llvm/
|
||||||
/vendor/npm/
|
/vendor/npm/
|
||||||
/vendor/python_26/
|
/vendor/python_26/
|
||||||
|
/vendor/native_mksnapshot
|
||||||
|
/vendor/LICENSES.chromium.html
|
||||||
node_modules/
|
node_modules/
|
||||||
SHASUMS256.txt
|
SHASUMS256.txt
|
||||||
**/package-lock.json
|
**/package-lock.json
|
||||||
|
|
|
@ -40,6 +40,9 @@ def main():
|
||||||
if args.target_arch == 'mips64el':
|
if args.target_arch == 'mips64el':
|
||||||
download_mips64el_toolchain()
|
download_mips64el_toolchain()
|
||||||
|
|
||||||
|
if args.target_arch.startswith('arm'):
|
||||||
|
download_native_mksnapshot(args.target_arch)
|
||||||
|
|
||||||
# Redirect to use local libchromiumcontent build.
|
# Redirect to use local libchromiumcontent build.
|
||||||
if args.build_release_libcc or args.build_debug_libcc:
|
if args.build_release_libcc or args.build_debug_libcc:
|
||||||
build_libchromiumcontent(args.verbose, args.target_arch,
|
build_libchromiumcontent(args.verbose, args.target_arch,
|
||||||
|
@ -216,6 +219,15 @@ def download_mips64el_toolchain():
|
||||||
subprocess.check_call(['tar', '-xf', tar_name, '-C', VENDOR_DIR])
|
subprocess.check_call(['tar', '-xf', tar_name, '-C', VENDOR_DIR])
|
||||||
os.remove(tar_name)
|
os.remove(tar_name)
|
||||||
|
|
||||||
|
def download_native_mksnapshot(arch):
|
||||||
|
if not os.path.exists(os.path.join(VENDOR_DIR,
|
||||||
|
'native_mksnapshot')):
|
||||||
|
tar_name = 'native-mksnapshot.tar.bz2'
|
||||||
|
url = '{0}/linux/{1}/{2}/{3}'.format(BASE_URL, arch,
|
||||||
|
get_libchromiumcontent_commit(), tar_name)
|
||||||
|
download(tar_name, url, os.path.join(SOURCE_ROOT, tar_name))
|
||||||
|
subprocess.call(['tar', '-jxf', tar_name, '-C', VENDOR_DIR])
|
||||||
|
os.remove(tar_name)
|
||||||
|
|
||||||
def create_chrome_version_h():
|
def create_chrome_version_h():
|
||||||
version_file = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'VERSION')
|
version_file = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'VERSION')
|
||||||
|
|
|
@ -24,6 +24,7 @@ DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
||||||
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'R')
|
||||||
CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'download',
|
CHROMIUM_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'download',
|
||||||
'libchromiumcontent', 'static_library')
|
'libchromiumcontent', 'static_library')
|
||||||
|
NATIVE_MKSNAPSHOT_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'native_mksnapshot')
|
||||||
|
|
||||||
PROJECT_NAME = electron_gyp()['project_name%']
|
PROJECT_NAME = electron_gyp()['project_name%']
|
||||||
PRODUCT_NAME = electron_gyp()['product_name%']
|
PRODUCT_NAME = electron_gyp()['product_name%']
|
||||||
|
@ -141,7 +142,6 @@ def copy_chrome_binary(binary):
|
||||||
shutil.copyfile(src, dest)
|
shutil.copyfile(src, dest)
|
||||||
os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC)
|
os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC)
|
||||||
|
|
||||||
|
|
||||||
def copy_vcruntime_binaries():
|
def copy_vcruntime_binaries():
|
||||||
with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
|
with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
|
||||||
r"SOFTWARE\Microsoft\VisualStudio\14.0\Setup\VC", 0,
|
r"SOFTWARE\Microsoft\VisualStudio\14.0\Setup\VC", 0,
|
||||||
|
@ -260,17 +260,39 @@ def create_dist_zip():
|
||||||
|
|
||||||
|
|
||||||
def create_chrome_binary_zip(binary, version):
|
def create_chrome_binary_zip(binary, version):
|
||||||
dist_name = get_zip_name(binary, version)
|
file_suffix = ''
|
||||||
|
create_native_mksnapshot = False
|
||||||
|
if binary == 'mksnapshot':
|
||||||
|
arch = get_target_arch()
|
||||||
|
if arch.startswith('arm'):
|
||||||
|
# if the arch is arm/arm64 the mksnapshot executable is an x64 binary,
|
||||||
|
# so name it as such.
|
||||||
|
file_suffix = 'x64'
|
||||||
|
create_native_mksnapshot = True
|
||||||
|
dist_name = get_zip_name(binary, version, file_suffix)
|
||||||
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||||
|
|
||||||
with scoped_cwd(DIST_DIR):
|
|
||||||
files = ['LICENSE', 'LICENSES.chromium.html']
|
files = ['LICENSE', 'LICENSES.chromium.html']
|
||||||
if PLATFORM == 'win32':
|
if PLATFORM == 'win32':
|
||||||
files += [binary + '.exe']
|
files += [binary + '.exe']
|
||||||
else:
|
else:
|
||||||
files += [binary]
|
files += [binary]
|
||||||
|
|
||||||
|
with scoped_cwd(DIST_DIR):
|
||||||
make_zip(zip_file, files, [])
|
make_zip(zip_file, files, [])
|
||||||
|
|
||||||
|
if create_native_mksnapshot == True:
|
||||||
|
# Create a zip with the native version of the mksnapshot binary.
|
||||||
|
src = os.path.join(NATIVE_MKSNAPSHOT_DIR, binary)
|
||||||
|
dest = os.path.join(DIST_DIR, binary)
|
||||||
|
# Copy file and keep the executable bit.
|
||||||
|
shutil.copyfile(src, dest)
|
||||||
|
os.chmod(dest, os.stat(dest).st_mode | stat.S_IEXEC)
|
||||||
|
|
||||||
|
dist_name = get_zip_name(binary, version)
|
||||||
|
zip_file = os.path.join(SOURCE_ROOT, 'dist', dist_name)
|
||||||
|
with scoped_cwd(DIST_DIR):
|
||||||
|
make_zip(zip_file, files, [])
|
||||||
|
|
||||||
def create_ffmpeg_zip():
|
def create_ffmpeg_zip():
|
||||||
dist_name = get_zip_name('ffmpeg', ELECTRON_VERSION)
|
dist_name = get_zip_name('ffmpeg', ELECTRON_VERSION)
|
||||||
|
|
|
@ -85,8 +85,6 @@ def main():
|
||||||
upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg),
|
upload_electron(github, release, os.path.join(DIST_DIR, ffmpeg),
|
||||||
args.upload_to_s3)
|
args.upload_to_s3)
|
||||||
|
|
||||||
# Upload chromedriver and mksnapshot for minor version update.
|
|
||||||
if parse_version(args.version)[2] == '0':
|
|
||||||
chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION)
|
chromedriver = get_zip_name('chromedriver', ELECTRON_VERSION)
|
||||||
upload_electron(github, release, os.path.join(DIST_DIR, chromedriver),
|
upload_electron(github, release, os.path.join(DIST_DIR, chromedriver),
|
||||||
args.upload_to_s3)
|
args.upload_to_s3)
|
||||||
|
@ -94,6 +92,12 @@ def main():
|
||||||
upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot),
|
upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot),
|
||||||
args.upload_to_s3)
|
args.upload_to_s3)
|
||||||
|
|
||||||
|
if get_target_arch().startswith('arm'):
|
||||||
|
# Upload the x64 binary for arm/arm64 mksnapshot
|
||||||
|
mksnapshot = get_zip_name('mksnapshot', ELECTRON_VERSION, 'x64')
|
||||||
|
upload_electron(github, release, os.path.join(DIST_DIR, mksnapshot),
|
||||||
|
args.upload_to_s3)
|
||||||
|
|
||||||
if PLATFORM == 'win32' and not tag_exists and not args.upload_to_s3:
|
if PLATFORM == 'win32' and not tag_exists and not args.upload_to_s3:
|
||||||
# Upload PDBs to Windows symbol server.
|
# Upload PDBs to Windows symbol server.
|
||||||
run_python_script('upload-windows-pdb.py')
|
run_python_script('upload-windows-pdb.py')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue