Flutter Engine
The Flutter Engine
Functions | Variables
create Namespace Reference

Functions

def find_ndk (volume)
 
def create_asset (target_dir)
 
def main ()
 
def download_tarball ()
 
def unzip_tarball ()
 
def create_install_dir ()
 
def build_valgrind ()
 
def copy_files (target_dir)
 

Variables

string NDK_VER = "android-ndk-r26b"
 
 NDK_URL = \
 
string DMG = "ndk.dmg"
 
string MOUNTED_NAME_START = '/Volumes/Android NDK'
 
 FILE_DIR = os.path.dirname(os.path.abspath(__file__))
 
 SKIA_ROOT_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir))
 
string URL = 'https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64'
 
string SHA256 = '61699e22abb2a26304edfa1376f65ad24191f94a4ffed68a58d42b6fee01e124'
 
string BINARY = URL.split('/')[-1]
 
 INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
 
dictionary to_copy
 
string REPO = 'https://github.com/google/bloaty'
 
string TAG = 'v1.0'
 
string VERSION = "ccache-3.7.7"
 
string CLANG_REVISION = 'llvmorg-18-init-17730-gf670112a'
 
int CLANG_SUB_REVISION = 5
 
string PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
 
tuple GS_URL
 
string SHORT_VERSION = "1.4"
 
string BASE_URL = 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/%s'
 
string GCLOUD_BASE_NAME = 'google-cloud-sdk'
 
string GCLOUD_ARCHIVE = '%s-343.0.0-linux-x86_64.tar.gz' % GCLOUD_BASE_NAME
 
string GCLOUD_URL = BASE_URL % GCLOUD_ARCHIVE
 
string GO_URL = "https://go.dev/dl/go1.21.5.linux-amd64.tar.gz"
 
string DOWNLOAD_URL = 'https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64'
 
string SHA256_URL = 'https://dl.k8s.io/%s/bin/linux/amd64/kubectl.sha256' % VERSION
 
string SDK_VERSION = '1.3.211.0'
 
tuple SDK_URL
 
string DOCKER_IMAGE = 'gcr.io/skia-public/mesa-driver-builder:v2'
 
string BUILD_SCRIPT = '/opt/build_mesa.sh'
 
string MESA_VERSION = '18.3.3'
 
string REPO_URL = "https://github.com/vektra/mockery.git"
 
string REPO_DIR = "mockery_repo"
 
string BINARY_NAME = "mockery"
 
string NODE_URL = "https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz"
 
string NODE_EXTRACT_NAME = "node-v12.16.3-linux-x64"
 
tuple ZIP_URL
 
string ARABIC_URL = 'https://fonts.gstatic.com/s/notonaskharabic/v33/RrQ5bpV-9Dd1b1OAGA6M9PkyDuVBePeKNaxcsss0Y7bwvc5krK0z9_Mnuw.ttf'
 
string ARABIC_SHA256 = 'b957e8c71a24e50c1aad4df775c46282bbe5e62e2b2b2ca72b153d75b6a15edd'
 
 SVG_TOOLS = os.path.join(INFRA_BOTS_DIR, os.pardir, os.pardir, 'tools', 'svg')
 
string SVG_GS_BUCKET = 'gs://skia-svgs'
 
string VALGRIND = 'valgrind-3.15.0'
 
string TARBALL = '%s.tar.bz2' % VALGRIND
 
 TEMP_DIR = os.path.join(tempfile.gettempdir(), 'skia-%s' % VALGRIND)
 
 INSTALL_DIR = os.path.join(TEMP_DIR, 'valgrind_install')
 

Function Documentation

◆ build_valgrind()

def create.build_valgrind ( )

Definition at line 57 of file create.py.

57def build_valgrind():
58 if os.path.isfile(os.path.join(INSTALL_DIR, 'bin', 'valgrind')):
59 return
60 with utils.chdir(os.path.join(TEMP_DIR, VALGRIND)):
61 subprocess.check_call(['./configure', '--prefix=%s' % INSTALL_DIR])
62 subprocess.check_call(['make'])
63 subprocess.check_call(['make', 'install'])
64
65
def build_valgrind()
Definition: create.py:57

◆ copy_files()

def create.copy_files (   target_dir)

Definition at line 66 of file create.py.

66def copy_files(target_dir):
67 with utils.chdir(os.path.join(TEMP_DIR, VALGRIND)):
68 os.mkdir(os.path.join(target_dir, 'bin'))
69 shutil.copy(os.path.join(INSTALL_DIR, 'bin', 'valgrind'),
70 os.path.join(target_dir, 'bin', 'valgrind'))
71 os.mkdir(os.path.join(target_dir, 'lib'))
72 os.mkdir(os.path.join(target_dir, 'lib', 'valgrind'))
73 for lib in ['memcheck-amd64-linux']:
74 shutil.copy(os.path.join(INSTALL_DIR, 'lib', 'valgrind', lib),
75 os.path.join(target_dir, 'lib', 'valgrind', lib))
76 for lib in ['core', 'memcheck']:
77 libname = 'vgpreload_%s-amd64-linux.so' % lib
78 shutil.copy(os.path.join(INSTALL_DIR, 'lib', 'valgrind', libname),
79 os.path.join(target_dir, 'lib', 'valgrind', libname))
80
81 shutil.copy('default.supp',
82 os.path.join(target_dir, 'lib', 'valgrind', 'default.supp'))
83
84
def copy_files(target_dir)
Definition: create.py:66

◆ create_asset()

def create.create_asset (   target_dir)
Create the asset.
Compiles the task driver using bazel, which is presumed to be on PATH 
Copy the fonts from two different git repos into one folder.

Definition at line 32 of file create.py.

32def create_asset(target_dir):
33 """Create the asset."""
34 if platform.system() != 'Darwin':
35 print("This script can only be run on a Mac!")
36 sys.exit(1)
37
38 subprocess.check_call(["curl", NDK_URL, "-o", DMG])
39 output = subprocess.check_output(['hdiutil', 'attach', DMG])
40
41 # hdiutil mounted the DMG somewhere - find where it was mounted.
42 lines = output.decode('utf-8').split('\n')
43 found = False
44 for line in lines:
45 words = line.split('\t')
46 if len(words) == 3:
47 if words[2].startswith(MOUNTED_NAME_START):
48 found = True
49
50 # copytree (in python2, and by default in python3) requires that the
51 # dst does not exist. Remove it so that is the case.
52 if os.path.isdir(target_dir):
53 os.rmdir(target_dir)
54
55 shutil.copytree(find_ndk(words[2]), target_dir)
56
57 # Unmount the volume, now that we're done with it.
58 subprocess.check_call(['hdiutil', 'detach', words[0].strip()])
59
60 subprocess.check_call(["rm", DMG])
61 break
62
63 if not found:
64 print("Could not find mount point! Output from hdiutil attach:")
65 for line in lines:
66 print(line)
67 sys.exit(2)
68
def find_ndk(volume)
Definition: create.py:26
def print(*args, **kwargs)
Definition: run_tests.py:49
def create_asset(chrome_src_path, browser_executable, target_dir, upload_to_partner_bucket, dm_path)
Definition: create.py:68

◆ create_install_dir()

def create.create_install_dir ( )

Definition at line 51 of file create.py.

52 if os.path.isdir(INSTALL_DIR):
53 return
54 os.makedirs(INSTALL_DIR)
55
56
def create_install_dir()
Definition: create.py:51

◆ download_tarball()

def create.download_tarball ( )

Definition at line 36 of file create.py.

37 with utils.chdir(TEMP_DIR):
38 if os.path.isfile(TARBALL):
39 return
40 with open(TARBALL, 'wb') as f:
41 f.write(urlopen(DOWNLOAD_URL).read())
42
43
static bool read(SkStream *stream, void *buffer, size_t amount)
def download_tarball()
Definition: create.py:36

◆ find_ndk()

def create.find_ndk (   volume)
Find the NDK within the mounted volume.

Definition at line 26 of file create.py.

26def find_ndk(volume):
27 """Find the NDK within the mounted volume."""
28 for f in os.listdir(volume):
29 if f.endswith('.app'):
30 return os.path.join(volume, f, 'Contents/NDK')
31

◆ main()

def create.main ( )

Definition at line 69 of file create.py.

69def main():
70 parser = argparse.ArgumentParser()
71 parser.add_argument('--target_dir', '-t', required=True)
72 args = parser.parse_args()
73 create_asset(args.target_dir)
74
75

◆ unzip_tarball()

def create.unzip_tarball ( )

Definition at line 44 of file create.py.

44def unzip_tarball():
45 with utils.chdir(TEMP_DIR):
46 if os.path.isdir(VALGRIND):
47 return
48 subprocess.check_call(['tar', 'xvjf', TARBALL])
49
50
def unzip_tarball()
Definition: create.py:44

Variable Documentation

◆ ARABIC_SHA256

string create.ARABIC_SHA256 = 'b957e8c71a24e50c1aad4df775c46282bbe5e62e2b2b2ca72b153d75b6a15edd'

Definition at line 33 of file create.py.

◆ ARABIC_URL

string create.ARABIC_URL = 'https://fonts.gstatic.com/s/notonaskharabic/v33/RrQ5bpV-9Dd1b1OAGA6M9PkyDuVBePeKNaxcsss0Y7bwvc5krK0z9_Mnuw.ttf'

Definition at line 32 of file create.py.

◆ BASE_URL

string create.BASE_URL = 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/%s'

Definition at line 21 of file create.py.

◆ BINARY

string create.BINARY = URL.split('/')[-1]

Definition at line 20 of file create.py.

◆ BINARY_NAME

string create.BINARY_NAME = "mockery"

Definition at line 20 of file create.py.

◆ BUILD_SCRIPT

string create.BUILD_SCRIPT = '/opt/build_mesa.sh'

Definition at line 21 of file create.py.

◆ CLANG_REVISION

string create.CLANG_REVISION = 'llvmorg-18-init-17730-gf670112a'

Definition at line 24 of file create.py.

◆ CLANG_SUB_REVISION

int create.CLANG_SUB_REVISION = 5

Definition at line 25 of file create.py.

◆ DMG

string create.DMG = "ndk.dmg"

Definition at line 23 of file create.py.

◆ DOCKER_IMAGE

string create.DOCKER_IMAGE = 'gcr.io/skia-public/mesa-driver-builder:v2'

Definition at line 20 of file create.py.

◆ DOWNLOAD_URL

string create.DOWNLOAD_URL = 'https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64'

Definition at line 16 of file create.py.

◆ FILE_DIR

create.FILE_DIR = os.path.dirname(os.path.abspath(__file__))

Definition at line 22 of file create.py.

◆ GCLOUD_ARCHIVE

string create.GCLOUD_ARCHIVE = '%s-343.0.0-linux-x86_64.tar.gz' % GCLOUD_BASE_NAME

Definition at line 23 of file create.py.

◆ GCLOUD_BASE_NAME

string create.GCLOUD_BASE_NAME = 'google-cloud-sdk'

Definition at line 22 of file create.py.

◆ GCLOUD_URL

string create.GCLOUD_URL = BASE_URL % GCLOUD_ARCHIVE

Definition at line 24 of file create.py.

◆ GO_URL

string create.GO_URL = "https://go.dev/dl/go1.21.5.linux-amd64.tar.gz"

Definition at line 24 of file create.py.

◆ GS_URL

tuple create.GS_URL
Initial value:
1= ('https://commondatastorage.googleapis.com/chromium-browser-clang'
2 '/Win/clang-%s.tgz' % PACKAGE_VERSION)

Definition at line 31 of file create.py.

◆ INFRA_BOTS_DIR

create.INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))

Definition at line 20 of file create.py.

◆ INSTALL_DIR

create.INSTALL_DIR = os.path.join(TEMP_DIR, 'valgrind_install')

Definition at line 33 of file create.py.

◆ MESA_VERSION

string create.MESA_VERSION = '18.3.3'

Definition at line 22 of file create.py.

◆ MOUNTED_NAME_START

string create.MOUNTED_NAME_START = '/Volumes/Android NDK'

Definition at line 24 of file create.py.

◆ NDK_URL

create.NDK_URL = \

Definition at line 21 of file create.py.

◆ NDK_VER

string create.NDK_VER = "android-ndk-r26b"

Definition at line 20 of file create.py.

◆ NODE_EXTRACT_NAME

string create.NODE_EXTRACT_NAME = "node-v12.16.3-linux-x64"

Definition at line 18 of file create.py.

◆ NODE_URL

string create.NODE_URL = "https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz"

Definition at line 17 of file create.py.

◆ PACKAGE_VERSION

string create.PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)

Definition at line 27 of file create.py.

◆ REPO

string create.REPO = 'https://github.com/google/bloaty'

Definition at line 24 of file create.py.

◆ REPO_DIR

string create.REPO_DIR = "mockery_repo"

Definition at line 19 of file create.py.

◆ REPO_URL

string create.REPO_URL = "https://github.com/vektra/mockery.git"

Definition at line 18 of file create.py.

◆ SDK_URL

tuple create.SDK_URL
Initial value:
1= ('https://sdk.lunarg.com/sdk/download/%s/linux/'
2 'vulkansdk-linux-x86_64-%s.tar.gz' % (SDK_VERSION, SDK_VERSION))

Definition at line 24 of file create.py.

◆ SDK_VERSION

string create.SDK_VERSION = '1.3.211.0'

Definition at line 23 of file create.py.

◆ SHA256

string create.SHA256 = '61699e22abb2a26304edfa1376f65ad24191f94a4ffed68a58d42b6fee01e124'

Definition at line 18 of file create.py.

◆ SHA256_URL

string create.SHA256_URL = 'https://dl.k8s.io/%s/bin/linux/amd64/kubectl.sha256' % VERSION

Definition at line 19 of file create.py.

◆ SHORT_VERSION

string create.SHORT_VERSION = "1.4"

Definition at line 26 of file create.py.

◆ SKIA_ROOT_DIR

create.SKIA_ROOT_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir))

Definition at line 23 of file create.py.

◆ SVG_GS_BUCKET

string create.SVG_GS_BUCKET = 'gs://skia-svgs'

Definition at line 21 of file create.py.

◆ SVG_TOOLS

create.SVG_TOOLS = os.path.join(INFRA_BOTS_DIR, os.pardir, os.pardir, 'tools', 'svg')

Definition at line 20 of file create.py.

◆ TAG

string create.TAG = 'v1.0'

Definition at line 25 of file create.py.

◆ TARBALL

string create.TARBALL = '%s.tar.bz2' % VALGRIND

Definition at line 30 of file create.py.

◆ TEMP_DIR

create.TEMP_DIR = os.path.join(tempfile.gettempdir(), 'skia-%s' % VALGRIND)

Definition at line 32 of file create.py.

◆ to_copy

dictionary create.to_copy
Initial value:
1= {
2 # If we need other files, we can add them to this mapping.
3 'x86_64-linux-gnu-strip': 'strip',
4}

Definition at line 30 of file create.py.

◆ URL

string create.URL = 'https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64'

Definition at line 17 of file create.py.

◆ VALGRIND

string create.VALGRIND = 'valgrind-3.15.0'

Definition at line 29 of file create.py.

◆ VERSION

string create.VERSION = "ccache-3.7.7"

Definition at line 25 of file create.py.

◆ ZIP_URL

tuple create.ZIP_URL
Initial value:
1= ('https://github.com/google/protobuf/releases/download/v3.3.0/'
2 'protoc-3.3.0-linux-x86_64.zip')

Definition at line 16 of file create.py.