Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
create Namespace Reference

Functions

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

Variables

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

Detailed Description

Create the asset.
Create bazel_build task_driver. This should rarely need to change, so by putting it into
CIPD, we should reduce build latency by removing the need for the BuildTaskDrivers job.
That job *is* idempotent, so Swarming does eventually deduplicate it sometimes (but not
after a usually unrelated change to something in //bazel), but skipping the step is faster.
Create Bloaty as a Linux executable.
Create a ccache binary for linux hosts.
Create a ccache binary for mac hosts.
Create a Clang toolchain for Linux hosts.
Create the cockroachDB asset.
Create the DWriteCore asset. DWriteCore is now part of the WindowsAppSDK
which is distrubuted as a nuget package. To update, go to
https://www.nuget.org/packages/Microsoft.WindowsAppSDK and pick a version.
The URL below should match that of the "Download package" link.

The asset this creates contains just the DWriteCore headers and dll. In
particular the lib is not bundled as Skia does not link directly against
DWriteCore.
Create the mesa driver. This defers to a Docker container
   with the build_mesa.sh script.
Create the mesa driver.
The fonts collected by this script are used by SkParagraphTests.cpp which uses measurements
that are very particular to the specific font being used. Thus, we try to get the fonts from
a repeatable, documented source.

Function Documentation

◆ build_valgrind()

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

◆ copy_files()

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

◆ create_asset()

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
void print(void *str)
Definition bridge.cpp:126

◆ create_install_dir()

create.create_install_dir ( )

Definition at line 51 of file create.py.

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

◆ download_tarball()

create.download_tarball ( )

Definition at line 36 of file create.py.

36def download_tarball():
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)

◆ find_ndk()

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()

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
Definition main.py:1

◆ unzip_tarball()

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

Variable Documentation

◆ ARABIC_SHA256

str create.ARABIC_SHA256 = 'b957e8c71a24e50c1aad4df775c46282bbe5e62e2b2b2ca72b153d75b6a15edd'

Definition at line 33 of file create.py.

◆ ARABIC_URL

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

Definition at line 32 of file create.py.

◆ BASE_URL

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

Definition at line 21 of file create.py.

◆ BINARY

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

Definition at line 20 of file create.py.

◆ BINARY_NAME

str create.BINARY_NAME = "mockery"

Definition at line 20 of file create.py.

◆ BUILD_SCRIPT

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

Definition at line 21 of file create.py.

◆ CLANG_REVISION

str create.CLANG_REVISION = 'llvmorg-15-init-8945-g3d7da810'

Definition at line 24 of file create.py.

◆ CLANG_SUB_REVISION

int create.CLANG_SUB_REVISION = 2

Definition at line 25 of file create.py.

◆ DMG

str create.DMG = "ndk.dmg"

Definition at line 23 of file create.py.

◆ DOCKER_IMAGE

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

Definition at line 20 of file create.py.

◆ DOWNLOAD_URL

str 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

str 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

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

Definition at line 22 of file create.py.

◆ GCLOUD_URL

str create.GCLOUD_URL = BASE_URL % GCLOUD_ARCHIVE

Definition at line 24 of file create.py.

◆ GO_URL

str 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

str create.MESA_VERSION = '18.3.3'

Definition at line 22 of file create.py.

◆ MOUNTED_NAME_START

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

Definition at line 24 of file create.py.

◆ NDK_URL

str create.NDK_URL
Initial value:
1= \
2 "https://dl.google.com/android/repository/%s-darwin.dmg" % NDK_VER

Definition at line 21 of file create.py.

◆ NDK_VER

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

Definition at line 20 of file create.py.

◆ NODE_EXTRACT_NAME

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

Definition at line 18 of file create.py.

◆ NODE_URL

str 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

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

Definition at line 27 of file create.py.

◆ REPO

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

Definition at line 24 of file create.py.

◆ REPO_DIR

str create.REPO_DIR = "mockery_repo"

Definition at line 19 of file create.py.

◆ REPO_URL

str 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

str create.SDK_VERSION = '1.3.211.0'

Definition at line 23 of file create.py.

◆ SHA256

str create.SHA256 = '61699e22abb2a26304edfa1376f65ad24191f94a4ffed68a58d42b6fee01e124'

Definition at line 18 of file create.py.

◆ SHA256_URL

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

Definition at line 19 of file create.py.

◆ SHORT_VERSION

str 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

str 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

str create.TAG = 'v1.0'

Definition at line 25 of file create.py.

◆ TARBALL

str 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

dict 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

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

Definition at line 17 of file create.py.

◆ VALGRIND

str create.VALGRIND = 'valgrind-3.15.0'

Definition at line 29 of file create.py.

◆ VERSION

str 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.