-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
BUILD.gn
453 lines (420 loc) · 15.2 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import("build/config/gclient_args.gni")
import("sdk_args.gni")
targeting_fuchsia = target_os == "fuchsia"
# This target will be built if no target is specified when invoking ninja.
group("default") {
if (targeting_fuchsia) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
}
deps = [ ":runtime" ]
}
group("most") {
import("runtime/runtime_args.gni")
if (targeting_fuchsia) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
}
deps = [
":analysis_server",
":create_sdk",
":dart2js",
":dartanalyzer",
":ddc",
":runtime",
":samples",
]
}
group("samples") {
deps = [ "samples/embedder:all" ]
}
group("runtime") {
import("runtime/runtime_args.gni")
if (targeting_fuchsia) {
# Fuchsia has run_vm_tests marked testonly.
testonly = true
}
deps = [
"runtime/bin:dart",
"runtime/bin:ffi_test_dynamic_library",
"runtime/bin:ffi_test_functions",
"runtime/bin:process_test",
"runtime/bin:run_vm_tests",
"runtime/vm:kernel_platform_files($host_toolchain)",
"samples/ffi/http:fake_http",
"utils/dartdev:dartdev",
"utils/kernel-service:kernel-service",
]
if (!is_win) {
# The test isn't run on windows
deps += [ "runtime/bin:entrypoints_verification_test" ]
}
# This flag is set in runtime/runtime_args.gni
# The analyze_snapshot tool is only supported on 64 bit AOT builds running
# under linux and android platforms
if (build_analyze_snapshot) {
deps += [
# The `analyze_snapshot` tests require the `analyze_snapshot` as well as
# `gen_snapshot` binaries.
"runtime/bin:analyze_snapshot",
"runtime/bin:analyze_snapshot($host_toolchain)",
"runtime/bin:gen_snapshot",
"runtime/bin:gen_snapshot($host_toolchain)",
]
}
if (is_linux || is_android) {
deps += [ "runtime/bin:abstract_socket_test" ]
} else if (is_fuchsia) {
deps += [ ":fuchsia_test_package" ]
}
}
# A separate target and not included in group("runtime"). This way the target\
# "runtime" does not get many executables extra as build output.
group("run_ffi_unit_tests") {
deps = [ "runtime/bin/ffi_unit_test:run_ffi_unit_tests" ]
}
group("runtime_precompiled") {
import("runtime/runtime_args.gni")
deps = [
"runtime/bin:dartaotruntime",
"runtime/bin:gen_snapshot",
"runtime/bin:gen_snapshot($host_toolchain)",
"runtime/bin:process_test",
"runtime/vm:kernel_platform_files($host_toolchain)",
]
if (is_linux || is_android) {
deps += [ "runtime/bin:abstract_socket_test" ]
}
if (dart_dynamic_modules) {
deps += [ "utils/dart2bytecode:dart2bytecode_snapshot" ]
deps += [ "utils/dynamic_module_runner:dynamic_module_runner_snapshot" ]
}
}
group("create_sdk") {
public_deps = [ "sdk:create_sdk" ]
}
group("create_platform_sdk") {
public_deps = [ "sdk:create_platform_sdk" ]
}
group("dart2js") {
import("runtime/runtime_args.gni")
if (dart_target_arch != "ia32" && dart_target_arch != "x86") {
deps = [
":runtime_precompiled",
"utils/compiler:dart2js_sdk_aot",
]
} else {
deps = [ "utils/compiler:dart2js" ]
}
}
group("dart2wasm_platform") {
deps = [
":runtime_precompiled",
"utils/dart2wasm:compile_dart2wasm_js_compatibility_platform",
"utils/dart2wasm:compile_dart2wasm_platform",
"utils/dart2wasm:dart2wasm_snapshot",
]
if (defined(is_product)) {
if (is_product) {
deps += [ "utils/dart2wasm:dart2wasm_product_snapshot" ]
} else {
deps += [ "utils/dart2wasm:dart2wasm_asserts_snapshot" ]
}
}
}
group("dart2wasm") {
deps = [
":dart2wasm_platform",
"utils/dart2wasm:test_wasm_modules",
]
}
group("dart2wasm_benchmark") {
deps = [
":dart2wasm_platform",
"third_party/binaryen:wasm-opt",
]
}
group("dartanalyzer") {
deps = [ "utils/dartanalyzer" ]
}
group("ddc") {
import("runtime/runtime_args.gni")
if (dart_target_arch != "ia32" && dart_target_arch != "x86") {
deps = [
":runtime_precompiled",
"utils/bazel:kernel_worker_aot",
"utils/ddc:dartdevc_aot",
]
} else {
deps = [
"utils/bazel:kernel_worker",
"utils/ddc:dartdevc",
]
}
}
group("analysis_server") {
deps = [ "utils/analysis_server" ]
}
group("tools") {
deps = [
"utils:compile_platform.exe",
"utils:gen_kernel.exe",
]
}
# This is the target that is built on the dart2js build bots.
# It must depend on anything that is required by the dart2js
# test suites.
group("dart2js_bot") {
deps = [ ":create_sdk" ]
}
# This rule and the compressed_observatory_archive rule are for the Fuchsia
# bots that pre-build the Observatory. They copy the observatory tar files to
# the root build output directory for convenient access by the Fuchsia buildbot
# scripts.
group("observatory_archive") {
deps = [ "runtime/observatory:copy_observatory_archive" ]
}
group("compressed_observatory_archive") {
deps = [ "runtime/observatory:copy_compressed_observatory_archive" ]
}
if (is_fuchsia) {
import("third_party/fuchsia/gn-sdk/src/component.gni")
import("third_party/fuchsia/gn-sdk/src/package.gni")
import("utils/application_snapshot.gni")
# tests/ffi/**_test.dart except those with compile-time errors
test_sources = [
"tests/ffi/abi_specific_int_incomplete_aot_test.dart",
"tests/ffi/abi_specific_int_incomplete_jit_test.dart",
"tests/ffi/abi_specific_int_test.dart",
"tests/ffi/abi_test.dart",
"tests/ffi/address_of_array_generated_test.dart",
"tests/ffi/address_of_cast_test.dart",
"tests/ffi/address_of_struct_generated_test.dart",
"tests/ffi/address_of_test.dart",
"tests/ffi/address_of_typeddata_generated_test.dart",
"tests/ffi/aliasing_test.dart",
"tests/ffi/allocator_test.dart",
"tests/ffi/async_void_function_callbacks_test.dart",
"tests/ffi/bool_test.dart",
"tests/ffi/c_types_test.dart",
"tests/ffi/callback_unwind_error_test.dart",
"tests/ffi/calloc_test.dart",
"tests/ffi/data_not_asan_test.dart",
"tests/ffi/data_test.dart",
"tests/ffi/deeply_immutable_c_api_finalizer_test.dart",
"tests/ffi/dl_api_exit_enter_isolate_test.dart",
"tests/ffi/dylib_close_test.dart",
"tests/ffi/dylib_isolates_test.dart",
"tests/ffi/dylib_open_test.dart",
"tests/ffi/expando_test.dart",
"tests/ffi/extension_methods_test.dart",
"tests/ffi/external_typed_data_finalizer_test.dart",
"tests/ffi/external_typed_data_test.dart",
"tests/ffi/ffi_callback_unique_test.dart",
"tests/ffi/ffi_induce_a_crash_test.dart",
"tests/ffi/ffi_native_test.dart",
"tests/ffi/finalizer_external_size_accounting_test.dart",
"tests/ffi/function_callbacks_many_test.dart",
"tests/ffi/function_callbacks_structs_by_value_generated_test.dart",
"tests/ffi/function_callbacks_structs_by_value_native_callable_generated_test.dart",
"tests/ffi/function_callbacks_structs_by_value_test.dart",
"tests/ffi/function_callbacks_subtype_test.dart",
"tests/ffi/function_callbacks_test.dart",
"tests/ffi/function_callbacks_varargs_generated_test.dart",
"tests/ffi/function_callbacks_varargs_native_callable_generated_test.dart",
"tests/ffi/function_callbacks_very_many_test.dart",
"tests/ffi/function_struct_by_value_out_of_bounds_test.dart",
"tests/ffi/function_structs_by_value_generated_args_leaf_test.dart",
"tests/ffi/function_structs_by_value_generated_args_native_leaf_test.dart",
"tests/ffi/function_structs_by_value_generated_args_native_test.dart",
"tests/ffi/function_structs_by_value_generated_args_test.dart",
"tests/ffi/function_structs_by_value_generated_compounds_sizeof_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_arg_leaf_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_arg_native_leaf_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_arg_native_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_arg_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_leaf_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_native_leaf_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_native_test.dart",
"tests/ffi/function_structs_by_value_generated_ret_test.dart",
"tests/ffi/function_structs_test.dart",
"tests/ffi/function_test.dart",
"tests/ffi/function_varargs_generated_leaf_test.dart",
"tests/ffi/function_varargs_generated_native_leaf_test.dart",
"tests/ffi/function_varargs_generated_native_test.dart",
"tests/ffi/function_varargs_generated_test.dart",
"tests/ffi/function_varargs_name_test.dart",
"tests/ffi/function_varargs_test.dart",
"tests/ffi/function_very_many_test.dart",
"tests/ffi/hardfp_test.dart",
"tests/ffi/has_symbol_test.dart",
"tests/ffi/inline_array_multi_dimensional_test.dart",
"tests/ffi/inline_array_test.dart",
"tests/ffi/inline_array_variable_length_test.dart",
"tests/ffi/invoke_callback_after_suspension_test.dart",
"tests/ffi/isolate_local_function_callbacks_test.dart",
"tests/ffi/msan_test.dart",
"tests/ffi/native_assets/asset_absolute_test.dart",
"tests/ffi/native_assets/asset_executable_test.dart",
"tests/ffi/native_assets/asset_library_annotation_test.dart",
"tests/ffi/native_assets/asset_process_test.dart",
"tests/ffi/native_assets/asset_relative_test.dart",
"tests/ffi/native_assets/asset_system_test.dart",
"tests/ffi/native_assets/infer_native_assets_yaml_dart_kernel_snapshot_test.dart",
"tests/ffi/native_assets/infer_native_assets_yaml_isolate_spawnuri_2_test.dart",
"tests/ffi/native_assets/infer_native_assets_yaml_isolate_spawnuri_3_test.dart",
"tests/ffi/native_assets/infer_native_assets_yaml_isolate_spawnuri_test.dart",
"tests/ffi/native_assets/infer_native_assets_yaml_process_run_test.dart",
"tests/ffi/native_assets/process_test.dart",
"tests/ffi/native_callables_async_structs_by_value_generated_test.dart",
"tests/ffi/native_callables_sync_structs_by_value_generated_test.dart",
"tests/ffi/native_effect_test.dart",
"tests/ffi/negative_function_test.dart",
"tests/ffi/pointer_arithmetic_operators_test.dart",
"tests/ffi/regress_37254_test.dart",
"tests/ffi/regress_39044_test.dart",
"tests/ffi/regress_39063_test.dart",
"tests/ffi/regress_39885_test.dart",
"tests/ffi/regress_40537_test.dart",
"tests/ffi/regress_43016_test.dart",
"tests/ffi/regress_43693_test.dart",
"tests/ffi/regress_45189_test.dart",
"tests/ffi/regress_45198_test.dart",
"tests/ffi/regress_45507_test.dart",
"tests/ffi/regress_45988_test.dart",
"tests/ffi/regress_46004_test.dart",
"tests/ffi/regress_46127_test.dart",
"tests/ffi/regress_47594_test.dart",
"tests/ffi/regress_47673_test.dart",
"tests/ffi/regress_49402_test.dart",
"tests/ffi/regress_49684_test.dart",
"tests/ffi/regress_51315_test.dart",
"tests/ffi/regress_51321_test.dart",
"tests/ffi/regress_51504_test.dart",
"tests/ffi/regress_51538_2_test.dart",
"tests/ffi/regress_51538_3_test.dart",
"tests/ffi/regress_51538_test.dart",
"tests/ffi/regress_52298_test.dart",
"tests/ffi/regress_52399_test.dart",
"tests/ffi/regress_56412_2_test.dart",
"tests/ffi/regress_56412_test.dart",
"tests/ffi/regress_b_261224444_test.dart",
"tests/ffi/regress_flutter79441_test.dart",
"tests/ffi/regress_flutter97301_test.dart",
"tests/ffi/regress_jump_to_frame_test.dart",
"tests/ffi/sizeof_test.dart",
"tests/ffi/snapshot_test.dart",
"tests/ffi/stacktrace_regress_37910_test.dart",
"tests/ffi/structs_nested_test.dart",
"tests/ffi/structs_nnbd_workaround_test.dart",
"tests/ffi/structs_packed_test.dart",
"tests/ffi/structs_test.dart",
"tests/ffi/structs_typed_data_test.dart",
"tests/ffi/unaligned_test.dart",
"tests/ffi/variance_function_test.dart",
"tests/ffi/vmspecific_deprecated_funcs_test.dart",
"tests/ffi/vmspecific_dynamic_library_test.dart",
"tests/ffi/vmspecific_enable_ffi_test.dart",
"tests/ffi/vmspecific_ffi_native_handles_test.dart",
"tests/ffi/vmspecific_ffi_native_test.dart",
"tests/ffi/vmspecific_function_callbacks_exit_test.dart",
"tests/ffi/vmspecific_function_callbacks_test.dart",
"tests/ffi/vmspecific_function_gc_test.dart",
"tests/ffi/vmspecific_function_test.dart",
"tests/ffi/vmspecific_handle_dynamically_linked_test.dart",
"tests/ffi/vmspecific_handle_test.dart",
"tests/ffi/vmspecific_highmem_32bit_test.dart",
"tests/ffi/vmspecific_leaf_call_test.dart",
"tests/ffi/vmspecific_native_finalizer_2_test.dart",
"tests/ffi/vmspecific_native_finalizer_deeply_immutable_test.dart",
"tests/ffi/vmspecific_native_finalizer_isolate_groups_test.dart",
"tests/ffi/vmspecific_native_finalizer_isolates_test.dart",
"tests/ffi/vmspecific_native_finalizer_test.dart",
"tests/ffi/vmspecific_object_gc_test.dart",
"tests/ffi/vmspecific_pointer_load_il_test.dart",
"tests/ffi/vmspecific_regress_37100_test.dart",
"tests/ffi/vmspecific_regress_37511_callbacks_test.dart",
"tests/ffi/vmspecific_regress_37511_test.dart",
"tests/ffi/vmspecific_regress_37780_test.dart",
"tests/ffi/vmspecific_regress_51794_test.dart",
"tests/ffi/vmspecific_send_port_id_test.dart",
]
test_deps = []
test_resources = []
foreach(test_source, test_sources) {
label = string_replace(test_source, "/", "_")
application_snapshot(label) {
dart_snapshot_kind = "kernel"
main_dart = test_source
training_args = [] # Not used
output = "$target_gen_dir/$test_source.dill"
}
test_deps += [ ":$label" ]
test_resources += [
{
path = rebase_path("$target_gen_dir/$test_source.dill")
dest = "data/$test_source"
},
]
}
test_binaries = [
"dart",
"dartaotruntime",
"run_vm_tests",
]
foreach(binary, test_binaries) {
fuchsia_component("${binary}_test_component") {
testonly = true
manifest = "runtime/bin/${binary}_test_component.cml"
data_deps = [
"runtime/bin:${binary}",
"runtime/bin:ffi_test_dynamic_library",
"runtime/bin:ffi_test_functions",
]
library_files = [
"libffi_test_dynamic_library.so",
"libffi_test_functions.so",
]
resource_files = [
".dart_tool/package_config.json",
"tools/addlatexhash.dart",
]
resources = []
foreach(file, library_files) {
resources += [
{
path = root_out_dir + "/" + file
dest = "lib/" + file
},
]
}
foreach(file, resource_files) {
resources += [
{
path = file
dest = "data/" + file
},
]
}
deps = test_deps
resources += test_resources
}
}
fuchsia_package("fuchsia_test_package") {
testonly = true
if (is_debug) {
package_name = "dart_test_debug"
} else if (is_release) {
package_name = "dart_test_release"
} else if (is_product) {
package_name = "dart_test_product"
}
deps = []
foreach(binary, test_binaries) {
deps += [ ":${binary}_test_component" ]
}
}
}