Skip to content

Commit cc54122

Browse files
author
John Kleinschmidt
committed
Add component to build mksnapshot binaries for armv7/arm64
1 parent 0db3730 commit cc54122

File tree

7 files changed

+66
-21
lines changed

7 files changed

+66
-21
lines changed

.circleci/config.yml

+28-12
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
script/upload -t $TARGET_ARCH
3535
fi
3636
- store_artifacts:
37-
path: libchromiumcontent.zip
37+
path: libchromiumcontent.tar.bz2
3838

3939
libchromiumcontent-linux-x64-static:
4040
docker:
@@ -70,7 +70,7 @@ jobs:
7070
script/upload -t $TARGET_ARCH
7171
fi
7272
- store_artifacts:
73-
path: libchromiumcontent-static.zip
73+
path: libchromiumcontent-static.tar.bz2
7474

7575
libchromiumcontent-linux-ia32-shared:
7676
docker:
@@ -106,7 +106,7 @@ jobs:
106106
script/upload -t $TARGET_ARCH
107107
fi
108108
- store_artifacts:
109-
path: libchromiumcontent.zip
109+
path: libchromiumcontent.tar.bz2
110110

111111
libchromiumcontent-linux-ia32-static:
112112
docker:
@@ -142,7 +142,7 @@ jobs:
142142
script/upload -t $TARGET_ARCH
143143
fi
144144
- store_artifacts:
145-
path: libchromiumcontent-static.zip
145+
path: libchromiumcontent-static.tar.bz2
146146

147147
libchromiumcontent-linux-arm-shared:
148148
docker:
@@ -159,16 +159,22 @@ jobs:
159159
- run:
160160
name: Update
161161
command: script/update --clean -t $TARGET_ARCH
162+
- run:
163+
name: Build mksnapshot
164+
command: script/build -t $TARGET_ARCH -c native_mksnapshot
162165
- run:
163166
name: Build shared library
164167
command: script/build -t $TARGET_ARCH -c $COMPONENT
165168
- run:
166169
name: Build FFmpeg
167170
command: script/build -t $TARGET_ARCH -c ffmpeg
168171
- run:
169-
name: Create distribution
172+
name: Create shared distribution
170173
command: script/create-dist -t $TARGET_ARCH -c $COMPONENT
171174
no_output_timeout: 20m
175+
- run:
176+
name: Create mksnapshot distribution
177+
command: script/create-dist -t $TARGET_ARCH -c native_mksnapshot
172178
- run:
173179
name: Upload to S3
174180
command: |
@@ -178,7 +184,9 @@ jobs:
178184
script/upload -t $TARGET_ARCH
179185
fi
180186
- store_artifacts:
181-
path: libchromiumcontent.zip
187+
path: libchromiumcontent.tar.bz2
188+
- store_artifacts:
189+
path: native-mksnapshot.tar.bz2
182190

183191
libchromiumcontent-linux-arm-static:
184192
docker:
@@ -214,7 +222,7 @@ jobs:
214222
script/upload -t $TARGET_ARCH
215223
fi
216224
- store_artifacts:
217-
path: libchromiumcontent-static.zip
225+
path: libchromiumcontent-static.tar.bz2
218226

219227
libchromiumcontent-linux-arm64-shared:
220228
docker:
@@ -231,16 +239,22 @@ jobs:
231239
- run:
232240
name: Update
233241
command: script/update --clean -t $TARGET_ARCH
242+
- run:
243+
name: Build mksnapshot
244+
command: script/build -t $TARGET_ARCH -c native_mksnapshot
234245
- run:
235246
name: Build shared library
236247
command: script/build -t $TARGET_ARCH -c $COMPONENT
237248
- run:
238249
name: Build FFmpeg
239250
command: script/build -t $TARGET_ARCH -c ffmpeg
240251
- run:
241-
name: Create distribution
252+
name: Create shared distribution
242253
command: script/create-dist -t $TARGET_ARCH -c $COMPONENT
243254
no_output_timeout: 20m
255+
- run:
256+
name: Create mksnapshot distribution
257+
command: script/create-dist -t $TARGET_ARCH -c native_mksnapshot
244258
- run:
245259
name: Upload to S3
246260
command: |
@@ -250,7 +264,9 @@ jobs:
250264
script/upload -t $TARGET_ARCH
251265
fi
252266
- store_artifacts:
253-
path: libchromiumcontent.zip
267+
path: libchromiumcontent.tar.bz2
268+
- store_artifacts:
269+
path: native-mksnapshot.tar.bz2
254270

255271
libchromiumcontent-linux-arm64-static:
256272
docker:
@@ -286,7 +302,7 @@ jobs:
286302
script/upload -t $TARGET_ARCH
287303
fi
288304
- store_artifacts:
289-
path: libchromiumcontent-static.zip
305+
path: libchromiumcontent-static.tar.bz2
290306

291307
libchromiumcontent-linux-mips64el-shared:
292308
docker:
@@ -322,7 +338,7 @@ jobs:
322338
script/upload -t $TARGET_ARCH
323339
fi
324340
- store_artifacts:
325-
path: libchromiumcontent.zip
341+
path: libchromiumcontent.tar.bz2
326342

327343
libchromiumcontent-linux-mips64el-static:
328344
docker:
@@ -358,7 +374,7 @@ jobs:
358374
script/upload -t $TARGET_ARCH
359375
fi
360376
- store_artifacts:
361-
path: libchromiumcontent-static.zip
377+
path: libchromiumcontent-static.tar.bz2
362378

363379
workflows:
364380
version: 2

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
*.pyc
44
/dist/
55
/src/
6-
/libchromiumcontent.zip
7-
/libchromiumcontent-static.zip
6+
/libchromiumcontent.tar.bz2
7+
/libchromiumcontent-static.tar.bz2
88
/vendor/binutils-aarch64
99
/vendor/cross-gcc-4.9.3-n64-loongson-rc5.4
1010
.gclient
1111
.gclient_entries
1212
_gclient_src_*
1313
s3credentials
14+
/native-mksnapshot.tar.bz2
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root_extra_deps = [ "//v8:v8_maybe_snapshot" ]
2+
is_electron_build = true
3+
is_component_build = false
4+
is_debug = false
5+
enable_linux_installer = false
6+
v8_use_snapshot = true
7+
v8_enable_i18n_support = false
8+
if (target_cpu == "arm") {
9+
v8_snapshot_toolchain="//build/toolchain/linux:clang_arm"
10+
}
11+
12+
if (target_cpu == "arm64") {
13+
v8_snapshot_toolchain="//build/toolchain/linux:clang_arm64"
14+
}

script/build

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ from lib.config import MIPS64EL_GCC, set_mips64el_env, get_output_dir
1111

1212
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
1313
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
14-
COMPONENTS = ['static_library', 'shared_library', 'ffmpeg', 'tests']
14+
COMPONENTS = ['static_library', 'shared_library', 'ffmpeg', 'tests', 'native_mksnapshot']
1515

1616
NINJA = os.path.join(VENDOR_DIR, 'depot_tools', 'ninja')
1717
if sys.platform == 'win32':
@@ -51,6 +51,8 @@ def main():
5151
target = 'chromiumcontent:chromiumcontent'
5252
if component == 'tests':
5353
target = 'chromiumcontent:chromiumcontent_tests'
54+
if component == 'native_mksnapshot':
55+
target = 'v8:mksnapshot'
5456
subprocess.check_call([NINJA, '-C', os.path.relpath(out_dir), target], env=env)
5557
if component == 'static_library':
5658
subenv = env.copy()

script/create-dist

+15-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ STATIC_LIBRARY_SUFFIX = {
5656
'win32': 'lib',
5757
}[TARGET_PLATFORM]
5858

59-
COMPONENTS = ['static_library', 'shared_library']
59+
COMPONENTS = ['static_library', 'shared_library','native_mksnapshot']
6060
BINARIES = {
6161
'all': [
6262
'content_shell.pak',
@@ -390,7 +390,8 @@ def main():
390390
subprocess.check_call([NINJA, '-C', MAIN_DIR])
391391

392392
for component in COMPONENTS:
393-
if args.component == 'all' or args.component == component:
393+
if ((args.component == 'all' or args.component == component)
394+
and args.component != 'native_mksnapshot'):
394395
strip_binaries(args.create_debug_archive, args.keep_debug_symbols,
395396
component, os.path.join(MAIN_DIR, component),
396397
args.target_arch)
@@ -415,8 +416,9 @@ def generate_ninja(args, ninja):
415416
copy_generated_sources(target_arch, component, ninja)
416417
copy_locales(target_arch, component, ninja)
417418

418-
copy_ffmpeg(target_arch, ninja)
419-
copy_sources(ninja)
419+
if args.component != 'native_mksnapshot':
420+
copy_ffmpeg(target_arch, ninja)
421+
copy_sources(ninja)
420422
generate_licenses(ninja)
421423

422424

@@ -475,6 +477,11 @@ def copy_binaries(target_arch, component, create_debug_archive,
475477
output_dir = get_output_dir(SOURCE_ROOT, target_arch, component)
476478
target_dir = component
477479

480+
if component == 'native_mksnapshot':
481+
ninja.copy(os.path.join(output_dir, 'mksnapshot'), target_dir)
482+
copy_dir('gen', relative_to=output_dir, destination=target_dir, ninja=ninja)
483+
return
484+
478485
binaries = BINARIES['all'] + BINARIES[TARGET_PLATFORM]
479486
if component == 'shared_library':
480487
binaries += BINARIES_SHARED_LIBRARY[TARGET_PLATFORM]
@@ -734,6 +741,10 @@ def create_archive(create_debug_archive, component):
734741
print 'Packing static_library builds...'
735742
p = os.path.join(SOURCE_ROOT, 'libchromiumcontent-static.tar.bz2')
736743
make_archive(MAIN_DIR, ['static_library'], [], p)
744+
if component == 'native_mksnapshot':
745+
print 'Packing native mksnapshot...'
746+
p = os.path.join(SOURCE_ROOT, 'native-mksnapshot.tar.bz2')
747+
make_archive(MAIN_DIR, ['native_mksnapshot'], ['LICENSES.chromium.html'], p)
737748

738749

739750
def make_archive(src, dirs, files, target):

script/update

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
2323
SRC_DIR = os.path.join(SOURCE_ROOT, 'src')
2424
CHROMIUMCONTENT_SOURCE_DIR = os.path.join(SOURCE_ROOT, 'chromiumcontent')
2525
CHROMIUMCONTENT_DESTINATION_DIR = os.path.join(SRC_DIR, 'chromiumcontent')
26-
COMPONENTS = ['static_library', 'shared_library', 'ffmpeg', 'tests']
26+
COMPONENTS = ['static_library', 'shared_library', 'ffmpeg', 'tests', 'native_mksnapshot']
2727
DEPOT_TOOLS = os.path.join(VENDOR_DIR, 'depot_tools')
2828

2929
DEBIAN_MIRROR = 'http://ftp.jp.debian.org/debian/pool/main/'

script/upload

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ def upload(target_arch):
4444
else:
4545
platform = PLATFORM_KEY
4646

47+
upload_files = glob.glob('libchromiumcontent*.tar.bz2') + glob.glob('native-mksnapshot.tar.bz2')
4748
s3put(bucket, access_key, secret_key, SOURCE_ROOT,
4849
'libchromiumcontent/{0}/{1}/{2}'.format(platform, target_arch, commit),
49-
glob.glob('libchromiumcontent*.tar.bz2'))
50+
upload_files)
5051

5152

5253
def s3_config():

0 commit comments

Comments
 (0)