diff options
author | 2017-09-21 13:45:16 -0400 | |
---|---|---|
committer | 2017-09-21 18:24:43 +0000 | |
commit | ebf648e57afa0484b4665b2c945331e1af0dfb83 (patch) | |
tree | 8d45c7834e8f5933cb22f4db2b9d1af3297e6ccc /infra/bots/recipe_modules/flavor | |
parent | 5e996b85dbfe016af4160acd70e110689b10c2d9 (diff) |
[WASM] Add POC compile bot for WebAssembly
Fix core.gni to use not use Assembler for none cpu.
Right now, there are no outputs because we aren't compiling
dm or nanobench. However, this still compiles the skia
library and creates two executables, so it's a good canary
for a real WASM build.
Additional note: the two executables in question don't draw
anything to the screen via GL, which is still not possible with
Skia+WASM.
Bug: skia:
Change-Id: I0d767467e94e40d01070e34223dd90e96f1c96f2
Reviewed-on: https://skia-review.googlesource.com/49540
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/flavor')
3 files changed, 72 insertions, 1 deletions
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Ubuntu-EMCC-wasm-Release.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Ubuntu-EMCC-wasm-Release.json new file mode 100644 index 0000000000..0d98a7690e --- /dev/null +++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Ubuntu-EMCC-wasm-Release.json @@ -0,0 +1,54 @@ +[ + { + "cmd": [ + "python", + "-u", + "[CUSTOM_/_B_WORK]/skia/bin/fetch-gn" + ], + "cwd": "[CUSTOM_/_B_WORK]/skia", + "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", + "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-EMCC-wasm-Release" + }, + "infra_step": true, + "name": "fetch-gn" + }, + { + "cmd": [ + "[CUSTOM_/_B_WORK]/skia/bin/gn", + "gen", + "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-EMCC-wasm-Release/Release", + "--args=cc=\"[START_DIR]/emscripten_sdk/emscripten/incoming/emcc\" cxx=\"[START_DIR]/emscripten_sdk/emscripten/incoming/em++\" extra_cflags=[\"-Wno-unknown-warning-option\"] is_debug=false skia_enable_gpu=false skia_use_dng_sdk=false skia_use_fontconfig=false skia_use_freetype=false skia_use_icu=false target_cpu=\"wasm\"" + ], + "cwd": "[CUSTOM_/_B_WORK]/skia", + "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", + "PATH": "[START_DIR]/emscripten_sdk/clang/fastcomp/build_incoming_64/bin:<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-EMCC-wasm-Release" + }, + "name": "gn gen" + }, + { + "cmd": [ + "ninja", + "-C", + "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-EMCC-wasm-Release/Release" + ], + "cwd": "[CUSTOM_/_B_WORK]/skia", + "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", + "PATH": "[START_DIR]/emscripten_sdk/clang/fastcomp/build_incoming_64/bin:<PATH>:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-EMCC-wasm-Release" + }, + "name": "ninja" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +]
\ No newline at end of file diff --git a/infra/bots/recipe_modules/flavor/examples/full.py b/infra/bots/recipe_modules/flavor/examples/full.py index abe7478fd2..71b0affbc9 100644 --- a/infra/bots/recipe_modules/flavor/examples/full.py +++ b/infra/bots/recipe_modules/flavor/examples/full.py @@ -61,6 +61,7 @@ TEST_BUILDERS = [ 'Build-Ubuntu-Clang-x86_64-Release-Mini', 'Build-Ubuntu-Clang-x86_64-Release-Shared', 'Build-Ubuntu-Clang-x86_64-Release-Vulkan', + 'Build-Ubuntu-EMCC-wasm-Release', 'Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE', 'Build-Ubuntu-GCC-x86_64-Release-ANGLE', 'Build-Ubuntu-GCC-x86_64-Release-Fast', diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py index a6591b92c5..88a164a91d 100644 --- a/infra/bots/recipe_modules/flavor/gn_flavor.py +++ b/infra/bots/recipe_modules/flavor/gn_flavor.py @@ -30,7 +30,8 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): os = self.m.vars.builder_cfg.get('os', '') target_arch = self.m.vars.builder_cfg.get('target_arch', '') - clang_linux = str(self.m.vars.slave_dir.join('clang_linux')) + clang_linux = str(self.m.vars.slave_dir.join('clang_linux')) + emscripten_sdk = str(self.m.vars.slave_dir.join('emscripten_sdk')) linux_vulkan_sdk = str(self.m.vars.slave_dir.join('linux_vulkan_sdk')) win_toolchain = str(self.m.vars.slave_dir.join( 't', 'depot_tools', 'win_toolchain', 'vs_files', @@ -53,6 +54,10 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): cc, cxx = 'gcc-4.8', 'g++-4.8' elif compiler == 'GCC': cc, cxx = 'gcc', 'g++' + elif compiler == 'EMCC': + cc = emscripten_sdk + '/emscripten/incoming/emcc' + cxx = emscripten_sdk + '/emscripten/incoming/em++' + extra_cflags.append('-Wno-unknown-warning-option') if compiler != 'MSVC' and configuration == 'Debug': extra_cflags.append('-O1') @@ -113,6 +118,14 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): args['skia_compile_processors'] = 'true' if compiler == 'Clang' and 'Win' in os: args['clang_win'] = '"%s"' % self.m.vars.slave_dir.join('clang_win') + if target_arch == 'wasm': + args.update({ + 'skia_use_freetype': 'false', + 'skia_use_fontconfig': 'false', + 'skia_use_dng_sdk': 'false', + 'skia_use_icu': 'false', + 'skia_enable_gpu': 'false', + }) sanitize = '' if extra_config == 'UBSAN_float_cast_overflow': @@ -149,6 +162,9 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): self._py( 'fetch-clang-format', self.m.vars.skia_dir.join('bin', 'fetch-clang-format')) + if target_arch == 'wasm': + fastcomp = emscripten_sdk + '/clang/fastcomp/build_incoming_64/bin' + env['PATH'] = '%s:%%(PATH)s' % fastcomp with self.m.env(env): self._run('gn gen', [gn, 'gen', self.out_dir, '--args=' + gn_args]) |