build: fix native_mksnapshot build (#15770)
* build: fix native_mksnapshot build When we changed our electron_mksnapshot_zip target to include the v8_context_snapshot_generator, this dependency made the `run_mksnapshot` target run which was trying to run an arm/arm64 binary on x64 hardware. Don't use custom build args for native_mksnapshot as they are not needed * Added comment on why snapshot_blob.bin is skipped on arm/arm64
This commit is contained in:
parent
9e8b26cc4e
commit
bb7c63c052
5 changed files with 50 additions and 6 deletions
13
build/zip.py
13
build/zip.py
|
@ -19,10 +19,17 @@ PATHS_TO_SKIP = [
|
|||
'pyproto',
|
||||
]
|
||||
|
||||
def skip_path(dep):
|
||||
def skip_path(dep, dist_zip, target_cpu):
|
||||
# Skip specific paths and extensions as well as the following special case:
|
||||
# snapshot_blob.bin is a dependency of mksnapshot.zip because
|
||||
# v8_context_generator needs it, but this file does not get generated for arm
|
||||
# and arm 64 binaries of mksnapshot since they are built on x64 hardware.
|
||||
# Consumers of arm and arm64 mksnapshot can generate snapshot_blob.bin
|
||||
# themselves by running mksnapshot.
|
||||
should_skip = (
|
||||
any(dep.startswith(path) for path in PATHS_TO_SKIP) or
|
||||
any(dep.endswith(ext) for ext in EXTENSIONS_TO_SKIP))
|
||||
any(dep.endswith(ext) for ext in EXTENSIONS_TO_SKIP) or
|
||||
('arm' in target_cpu and dist_zip == 'mksnapshot.zip' and dep == 'snapshot_blob.bin'))
|
||||
if should_skip:
|
||||
print("Skipping {}".format(dep))
|
||||
return should_skip
|
||||
|
@ -47,7 +54,7 @@ def main(argv):
|
|||
else:
|
||||
with zipfile.ZipFile(dist_zip, 'w', zipfile.ZIP_DEFLATED) as z:
|
||||
for dep in dist_files:
|
||||
if skip_path(dep):
|
||||
if skip_path(dep, dist_zip, target_cpu):
|
||||
continue
|
||||
if os.path.isdir(dep):
|
||||
for root, dirs, files in os.walk(dep):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue