Skip to content

Commit 2376fa0

Browse files
sigmundchSigmund Cherem
andauthored
Add new builder for experiment with dynamic modules. (#162855)
This adds a new flavor of android_release_arm64, which enables a build flag. This is not part of the merge-queue since it's intended for experimental and internal use at the moment. Tested locally via `et build --config ci/android_release_arm64_ddm` This is a first step to get a better gauge of the cost on the build. The .json is identical to the android_release_arm64 configuration except for 2 new flags added (easier to diff locally). The .ci.yaml has additional changes to make set this up as no backfill and no release. cc @jtmcdole @jiahaog @andrewkolos --------- Co-authored-by: Sigmund Cherem < [email protected]>
1 parent 6c9a555 commit 2376fa0

File tree

6 files changed

+296
-6
lines changed

6 files changed

+296
-6
lines changed

engine/src/flutter/.ci.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,30 @@ targets:
247247
# at https://github.com/flutter/flutter/issues/152186.
248248
cores: "8"
249249

250+
- name: Linux linux_host_engine_ddm
251+
recipe: engine_v2/engine_v2
252+
bringup: true
253+
timeout: 120
254+
properties:
255+
release_build: "false"
256+
backfill: "false"
257+
config_name: linux_host_engine_ddm
258+
dependencies: >-
259+
[
260+
{"dependency": "goldctl", "version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"}
261+
]
262+
# Do not remove(https://github.com/flutter/flutter/issues/144644)
263+
# Scheduler will fail to get the platform
264+
drone_dimensions:
265+
- os=Linux
266+
dimensions:
267+
# This is needed so that orchestrators that only spawn subbuilds are not
268+
# assigned to the large 32 core workers when doing release builds.
269+
# For more details see the issue
270+
# at https://github.com/flutter/flutter/issues/152186.
271+
cores: "8"
272+
273+
250274
- name: Linux linux_android_aot_engine
251275
recipe: engine_v2/engine_v2
252276
timeout: 120
@@ -265,6 +289,26 @@ targets:
265289
# at https://github.com/flutter/flutter/issues/152186.
266290
cores: "8"
267291

292+
- name: Linux linux_android_aot_engine_ddm
293+
recipe: engine_v2/engine_v2
294+
bringup: true
295+
timeout: 120
296+
properties:
297+
config_name: linux_android_aot_engine_ddm
298+
release_build: "false"
299+
backfill: "false"
300+
# Do not remove(https://github.com/flutter/flutter/issues/144644)
301+
# Scheduler will fail to get the platform
302+
drone_dimensions:
303+
- os=Linux
304+
dimensions:
305+
# This is needed so that orchestrators that only spawn subbuilds are not
306+
# assigned to the large 32 core workers when doing release builds.
307+
# For more details see the issue
308+
# at https://github.com/flutter/flutter/issues/152186.
309+
cores: "8"
310+
311+
268312
- name: Linux linux_android_debug_engine
269313
recipe: engine_v2/engine_v2
270314
timeout: 120
@@ -283,6 +327,25 @@ targets:
283327
# at https://github.com/flutter/flutter/issues/152186.
284328
cores: "8"
285329

330+
- name: Linux linux_android_debug_engine_ddm
331+
recipe: engine_v2/engine_v2
332+
bringup: true
333+
timeout: 120
334+
properties:
335+
release_build: "false"
336+
backfill: "false"
337+
config_name: linux_android_debug_engine_ddm
338+
# Do not remove(https://github.com/flutter/flutter/issues/144644)
339+
# Scheduler will fail to get the platform
340+
drone_dimensions:
341+
- os=Linux
342+
dimensions:
343+
# This is needed so that orchestrators that only spawn subbuilds are not
344+
# assigned to the large 32 core workers when doing release builds.
345+
# For more details see the issue
346+
# at https://github.com/flutter/flutter/issues/152186.
347+
cores: "8"
348+
286349
- name: Linux linux_license
287350
recipe: engine_v2/builder
288351
timeout: 120

engine/src/flutter/build/archives/BUILD.gn

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,17 @@ if (build_engine_artifacts) {
5858
# Mac artifacts sometimes use mac and sometimes darwin. Standardizing the
5959
# names will require changes in the list of artifacts the tool is downloading.
6060
if (flutter_runtime_mode == "debug") {
61-
prefix = "darwin-$target_cpu/"
61+
prefix = "darwin-$target_cpu"
6262
} else {
63-
prefix = "darwin-$target_cpu-$flutter_runtime_mode/"
63+
prefix = "darwin-$target_cpu-$flutter_runtime_mode"
6464
}
6565
} else if (flutter_runtime_mode != "debug") {
66-
prefix = "$full_target_platform_name-$flutter_runtime_mode/"
66+
prefix = "$full_target_platform_name-$flutter_runtime_mode"
6767
} else {
68-
prefix = "$full_target_platform_name/"
68+
prefix = "$full_target_platform_name"
69+
}
70+
if (dart_dynamic_modules) {
71+
prefix = "$prefix-ddm"
6972
}
7073
output = "$prefix/artifacts.zip"
7174

@@ -199,7 +202,11 @@ generated_file("dart_sdk_entitlement_config") {
199202
if (build_engine_artifacts && flutter_prebuilt_dart_sdk) {
200203
zip_bundle("dart_sdk_archive") {
201204
deps = [ ":dart_sdk_entitlement_config" ]
202-
output = "dart-sdk-$full_target_platform_name.zip"
205+
if (dart_dynamic_modules) {
206+
output = "dart-sdk-$full_target_platform_name-ddm.zip"
207+
} else {
208+
output = "dart-sdk-$full_target_platform_name.zip"
209+
}
203210
files = [
204211
{
205212
source = prebuilt_dart_sdk
@@ -224,7 +231,11 @@ if (build_engine_artifacts && flutter_prebuilt_dart_sdk) {
224231
if (build_engine_artifacts && !flutter_prebuilt_dart_sdk) {
225232
zip_bundle_from_file("dart_sdk_archive") {
226233
deps = [ "$dart_src:create_sdk" ]
227-
output = "dart-sdk-$full_target_platform_name.zip"
234+
if (dart_dynamic_modules) {
235+
output = "dart-sdk-$full_target_platform_name-ddm.zip"
236+
} else {
237+
output = "dart-sdk-$full_target_platform_name.zip"
238+
}
228239
files = [
229240
{
230241
source = rebase_path("$root_build_dir/dart-sdk")

engine/src/flutter/build/zip_bundle.gni

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import("//flutter/common/config.gni")
66
import("//flutter/shell/version/version.gni")
7+
import("$dart_src/runtime/runtime_args.gni")
78

89
if (flutter_runtime_mode == "jit_release") {
910
android_zip_archive_dir = "android-$target_cpu-jit-release"
@@ -12,6 +13,9 @@ if (flutter_runtime_mode == "jit_release") {
1213
if (flutter_runtime_mode != "debug") {
1314
android_zip_archive_dir += "-$flutter_runtime_mode"
1415
}
16+
if (dart_dynamic_modules) {
17+
android_zip_archive_dir += "-ddm"
18+
}
1519
}
1620

1721
# Creates a zip file in the $root_build_dir/zip_archives folder.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"_comment": [
3+
"The builds defined in this file should not contain tests, ",
4+
"and the file should not contain builds that are essentially tests. ",
5+
"The only builds in this file should be the builds necessary to produce ",
6+
"release artifacts. ",
7+
"Tests to run on linux hosts should go in one of the other linux_ build ",
8+
"definition files."
9+
],
10+
"builds": [
11+
{
12+
"archives": [
13+
{
14+
"name": "ci/android_release_arm64_ddm",
15+
"type": "gcs",
16+
"base_path": "out/ci/android_release_arm64_ddm/zip_archives/",
17+
"include_paths": [
18+
"out/ci/android_release_arm64_ddm/zip_archives/android-arm64-release-ddm/artifacts.zip",
19+
"out/ci/android_release_arm64_ddm/zip_archives/android-arm64-release-ddm/linux-x64.zip",
20+
"out/ci/android_release_arm64_ddm/zip_archives/android-arm64-release-ddm/symbols.zip",
21+
"out/ci/android_release_arm64_ddm/zip_archives/android-arm64-release-ddm/analyze-snapshot-linux-x64.zip"
22+
],
23+
"realm": "production"
24+
}
25+
],
26+
"drone_dimensions": [
27+
"device_type=none",
28+
"os=Linux"
29+
],
30+
"gclient_variables": {
31+
"use_rbe": true
32+
},
33+
"gn": [
34+
"--target-dir",
35+
"ci/android_release_arm64_ddm",
36+
"--runtime-mode",
37+
"release",
38+
"--android",
39+
"--android-cpu",
40+
"arm64",
41+
"--no-prebuilt-dart-sdk",
42+
"--gn-args=dart_dynamic_modules=true",
43+
"--rbe",
44+
"--no-goma"
45+
],
46+
"name": "ci/android_release_arm64_ddm",
47+
"description": "Produces experimental release mode artifacts to target 64-bit arm Android from a Linux host with dynamic modules enabled.",
48+
"ninja": {
49+
"config": "ci/android_release_arm64_ddm",
50+
"targets": [
51+
"default",
52+
"clang_x64/gen_snapshot",
53+
"flutter/shell/platform/android:analyze_snapshot"
54+
]
55+
},
56+
"tests": [
57+
{
58+
"name": "Generate treemap for android_release_arm64_ddm",
59+
"language": "bash",
60+
"script": "flutter/ci/binary_size_treemap.sh",
61+
"parameters": [
62+
"../../src/out/ci/android_release_arm64_ddm/libflutter.so",
63+
"${FLUTTER_LOGS_DIR}"
64+
]
65+
}
66+
]
67+
}
68+
],
69+
"generators": {
70+
"tasks": [
71+
{
72+
"name": "Verify-export-symbols-release-binaries",
73+
"parameters": [
74+
"src/out/ci",
75+
"src/flutter/buildtools"
76+
],
77+
"script": "flutter/testing/symbols/verify_exported.dart",
78+
"language": "dart"
79+
}
80+
]
81+
}
82+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"_comment": [
3+
"The builds defined in this file should not contain tests, ",
4+
"and the file should not contain builds that are essentially tests. ",
5+
"The only builds in this file should be the builds necessary to produce ",
6+
"release artifacts. ",
7+
"Tests to run on linux hosts should go in one of the other linux_ build ",
8+
"definition files."
9+
],
10+
"builds": [
11+
{
12+
"archives": [
13+
{
14+
"name": "ci/android_debug_arm64_ddm",
15+
"type": "gcs",
16+
"base_path": "out/ci/android_debug_arm64_ddm/zip_archives/",
17+
"include_paths": [
18+
"out/ci/android_debug_arm64_ddm/zip_archives/android-arm64-ddm/artifacts.zip",
19+
"out/ci/android_debug_arm64_ddm/zip_archives/android-arm64-ddm/symbols.zip"
20+
],
21+
"realm": "production"
22+
}
23+
],
24+
"drone_dimensions": [
25+
"device_type=none",
26+
"os=Linux"
27+
],
28+
"gclient_variables": {
29+
"use_rbe": true
30+
},
31+
"gn": [
32+
"--target-dir",
33+
"ci/android_debug_arm64_ddm",
34+
"--android",
35+
"--android-cpu=arm64",
36+
"--no-lto",
37+
"--no-prebuilt-dart-sdk",
38+
"--gn-args=dart_dynamic_modules=true",
39+
"--rbe",
40+
"--no-goma"
41+
],
42+
"name": "ci/android_debug_arm64_ddm",
43+
"description": "Produces experimental debug mode artifacts to target 64-bit arm Android from a Linux host with dynamic modules enabled.",
44+
"ninja": {
45+
"config": "ci/android_debug_arm64_ddm",
46+
"targets": [
47+
"flutter"
48+
]
49+
}
50+
}
51+
],
52+
"generators": {
53+
"tasks": [
54+
{
55+
"name": "Verify-export-symbols-release-binaries",
56+
"parameters": [
57+
"src/out/ci",
58+
"src/flutter/buildtools"
59+
],
60+
"script": "flutter/testing/symbols/verify_exported.dart",
61+
"language": "dart"
62+
}
63+
]
64+
}
65+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"_comment": [
3+
"The builds defined in this file should not contain tests, ",
4+
"and the file should not contain builds that are essentially tests. ",
5+
"The only builds in this file should be the builds necessary to produce ",
6+
"release artifacts. ",
7+
"Tests to run on linux hosts should go in one of the other linux_ build ",
8+
"definition files."
9+
],
10+
"builds": [
11+
{
12+
"archives": [
13+
{
14+
"name": "ci/host_debug_ddm",
15+
"base_path": "out/ci/host_debug_ddm/zip_archives/",
16+
"type": "gcs",
17+
"include_paths": [
18+
"out/ci/host_debug_ddm/zip_archives/dart-sdk-linux-x64-ddm.zip"
19+
],
20+
"realm": "production"
21+
}
22+
],
23+
"drone_dimensions": [
24+
"device_type=none",
25+
"os=Linux"
26+
],
27+
"gclient_variables": {
28+
"download_android_deps": false,
29+
"download_jdk": false,
30+
"use_rbe": true
31+
},
32+
"gn": [
33+
"--target-dir",
34+
"ci/host_debug_ddm",
35+
"--runtime-mode",
36+
"debug",
37+
"--no-prebuilt-dart-sdk",
38+
"--gn-args=dart_dynamic_modules=true",
39+
"--rbe",
40+
"--no-goma"
41+
],
42+
"name": "ci/host_debug_ddm",
43+
"description": "Produces experimental debug mode Linux host-side tooling with dynamic modules enabled.",
44+
"ninja": {
45+
"config": "ci/host_debug_ddm",
46+
"targets": [
47+
"flutter/build/archives:dart_sdk_archive"
48+
]
49+
}
50+
}
51+
],
52+
"generators": {
53+
"tasks": [
54+
{
55+
"name": "Verify-export-symbols-release-binaries",
56+
"parameters": [
57+
"src/out/ci",
58+
"src/flutter/buildtools"
59+
],
60+
"script": "flutter/testing/symbols/verify_exported.dart",
61+
"language": "dart"
62+
}
63+
]
64+
}
65+
}

0 commit comments

Comments
 (0)