Flutter Engine
The Flutter Engine
Functions | Variables
build.pathkit Namespace Reference

Functions

def compile_fn (api, checkout_root, _ignore)
 
def copy_build_products (api, _ignore, dst)
 

Variables

string DOCKER_IMAGE = 'gcr.io/skia-public/emsdk-base:3.1.26_v2'
 
string INNER_BUILD_SCRIPT = '/SRC/skia/infra/pathkit/build_pathkit.sh'
 
list PATHKIT_BUILD_PRODUCTS
 

Function Documentation

◆ compile_fn()

def build.pathkit.compile_fn (   api,
  checkout_root,
  _ignore 
)

Definition at line 8 of file pathkit.py.

8def compile_fn(api, checkout_root, _ignore):
9 out_dir = api.vars.cache_dir.join('docker', 'pathkit')
10 configuration = api.vars.builder_cfg.get('configuration', '')
11 target_arch = api.vars.builder_cfg.get('target_arch', '')
12
13 # We want to make sure the directories exist and were created by chrome-bot,
14 # because if that isn't the case, docker will make them and they will be
15 # owned by root, which causes mysterious failures. To mitigate this risk
16 # further, we don't use the same out_dir as everyone else (thus the _ignore)
17 # param. Instead, we use a "pathkit" subdirectory in the "docker" named_cache.
18 api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0o777)
19
20 # This uses the emscriptem sdk docker image and says "run the
21 # build_pathkit.sh helper script in there". Additionally, it binds two
22 # folders: the Skia checkout to /SRC and the output directory to /OUT
23 # The called helper script will make the compile happen and put the
24 # output in the right spot. The neat thing is that since the Skia checkout
25 # (and, by extension, the build script) is not a part of the image, but
26 # bound in at runtime, we don't have to re-build the image, except when the
27 # toolchain changes.
28 # Of note, the wasm build doesn't re-use any intermediate steps from the
29 # previous builds, so it's essentially a build from scratch every time.
30 cmd = ['docker', 'run', '--rm', '--volume', '%s:/SRC' % checkout_root,
31 '--volume', '%s:/OUT' % out_dir,
32 DOCKER_IMAGE, INNER_BUILD_SCRIPT]
33 if configuration == 'Debug':
34 cmd.append('debug') # It defaults to Release
35 if target_arch == 'asmjs':
36 cmd.append('asm.js') # It defaults to WASM
37 # Override DOCKER_CONFIG set by Kitchen.
38 env = {'DOCKER_CONFIG': '/home/chrome-bot/.docker'}
39 with api.env(env):
40 api.run(
41 api.step,
42 'Build PathKit with Docker',
43 cmd=cmd)
44
45
def compile_fn(api, checkout_root, _ignore)
Definition: pathkit.py:8

◆ copy_build_products()

def build.pathkit.copy_build_products (   api,
  _ignore,
  dst 
)

Definition at line 51 of file pathkit.py.

51def copy_build_products(api, _ignore, dst):
52 out_dir = api.vars.cache_dir.join('docker', 'pathkit')
53 # We don't use the normal copy_listed_files because it uses
54 # shutil.move, which attempts to delete the previous file, which
55 # doesn't work because the docker created outputs are read-only and
56 # owned by root (aka only docker images). It's likely safe to change
57 # the shutil.move in the original script to a non-deleting thing
58 # (like copy or copyfile), but there's some subtle behavior differences
59 # especially with directories, that kjlubick felt it best not to risk it.
60 script = api.build.resource('copy_build_products_no_delete.py')
61 api.step(
62 name='copy wasm output',
63 cmd=['python3', script, out_dir, dst, ','.join(PATHKIT_BUILD_PRODUCTS)],
64 infra_step=True)
def copy_build_products(api, _ignore, dst)
Definition: pathkit.py:51
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

Variable Documentation

◆ DOCKER_IMAGE

string build.pathkit.DOCKER_IMAGE = 'gcr.io/skia-public/emsdk-base:3.1.26_v2'

Definition at line 5 of file pathkit.py.

◆ INNER_BUILD_SCRIPT

string build.pathkit.INNER_BUILD_SCRIPT = '/SRC/skia/infra/pathkit/build_pathkit.sh'

Definition at line 6 of file pathkit.py.

◆ PATHKIT_BUILD_PRODUCTS

list build.pathkit.PATHKIT_BUILD_PRODUCTS
Initial value:
1= [
2 'pathkit.*'
3]

Definition at line 46 of file pathkit.py.