ci: make sure mksnapshot is invoked with proper args. (#21991)

* build: robustify verify-mksnapshot w.r.t. command-line parameters

Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
This commit is contained in:
John Kleinschmidt 2020-02-04 13:10:11 -05:00 committed by GitHub
parent 6273bc9957
commit 6f1f4d3f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -593,6 +593,7 @@ step-mksnapshot-build: &step-mksnapshot-build
command: | command: |
cd src cd src
ninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES ninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
if [ "`uname`" != "Darwin" ]; then if [ "`uname`" != "Darwin" ]; then
if [ "$TARGET_ARCH" == "arm" ]; then if [ "$TARGET_ARCH" == "arm" ]; then
electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot electron/script/strip-binaries.py --file $PWD/out/Default/clang_x86_v8_arm/mksnapshot
@ -605,6 +606,7 @@ step-mksnapshot-build: &step-mksnapshot-build
fi fi
if [ "$SKIP_DIST_ZIP" != "1" ]; then if [ "$SKIP_DIST_ZIP" != "1" ]; then
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
fi fi
step-mksnapshot-store: &step-mksnapshot-store step-mksnapshot-store: &step-mksnapshot-store

View file

@ -188,6 +188,7 @@ test_script:
- cd .. - cd ..
- if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg ) - if "%RUN_TESTS%"=="true" ( echo Verifying non proprietary ffmpeg & python electron\script\verify-ffmpeg.py --build-dir out\Default --source-root %cd% --ffmpeg-path out\ffmpeg )
- echo "About to verify mksnapshot" - echo "About to verify mksnapshot"
- if "%RUN_TESTS%"=="true" ( gn desc out\Default v8:run_mksnapshot_default args > out\Default\mksnapshot_args )
- if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% ) - if "%RUN_TESTS%"=="true" ( echo Verifying mksnapshot & python electron\script\verify-mksnapshot.py --build-dir out\Default --source-root %cd% )
- echo "Done verifying mksnapshot" - echo "Done verifying mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% ) - if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )

View file

@ -26,12 +26,9 @@ def main():
try: try:
with scoped_cwd(app_path): with scoped_cwd(app_path):
if args.snapshot_files_dir is None: if args.snapshot_files_dir is None:
mkargs = [ get_binary_path('mksnapshot', app_path), \ with open(os.path.join(app_path, 'mksnapshot_args')) as f:
SNAPSHOT_SOURCE, '--startup_blob', 'snapshot_blob.bin', \ mkargs = f.read().splitlines()
'--no-native-code-counters', '--turbo_instruction_scheduling' ] subprocess.check_call(mkargs + [ SNAPSHOT_SOURCE ], cwd=app_path)
if get_target_arch() == 'ia32':
mkargs.append('--target_arch=x86')
subprocess.check_call(mkargs)
print('ok mksnapshot successfully created snapshot_blob.bin.') print('ok mksnapshot successfully created snapshot_blob.bin.')
context_snapshot = 'v8_context_snapshot.bin' context_snapshot = 'v8_context_snapshot.bin'
context_snapshot_path = os.path.join(app_path, context_snapshot) context_snapshot_path = os.path.join(app_path, context_snapshot)