File: BUILD.gn

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (260 lines) | stat: -rw-r--r-- 7,822 bytes parent folder | download | duplicates (5)
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
# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//build/config/compiler/compiler.gni")
if (is_android) {
  # Pull in enable_chrome_android_internal and public_android_sdk
  import("//build/config/android/config.gni")
  import("//tools/perf/chrome_telemetry_build/android_browser_types.gni")
}
is_remote_platform = is_android || is_fuchsia || is_chromeos
if (is_remote_platform) {
  import("//build/symlink.gni")
}

if (is_chromeos_device) {
  import("//build/config/chromeos/rules.gni")

  generate_runner_script("cros_update_wrapper") {
    generated_script = "$root_build_dir/bin/cros_update_wrapper"
    deploy_chrome = true
  }
}

if (is_remote_platform) {
  # Create a symlink from root_build_dir -> clang_x64/trace_processor_shell so
  # the stripped binary is actually included in the isolate.
  binary_symlink("host_trace_processor_shell") {
    binary_label = "//third_party/perfetto/src/trace_processor:trace_processor_shell($host_toolchain)"
    output_name = "host_trace_processor_shell"
  }
}

group("telemetry_chrome_test") {
  testonly = true

  data_deps = [ ":telemetry_chrome_test_without_chrome" ]
  data = []

  # Compile the host's version of trace_processor_shell for remote platforms.
  if (is_remote_platform) {
    data_deps += [
      ":host_trace_processor_shell",
      "//third_party/perfetto/src/trace_processor:trace_processor_shell($host_toolchain)",
    ]
  } else {
    data_deps += [ "//third_party/perfetto/src/trace_processor:trace_processor_shell($default_toolchain)" ]
  }

  if (!is_fuchsia && !is_android && !is_castos && !is_ios) {
    data_deps += [ "//chrome" ]
  }

  if (is_win) {
    data_deps += [ "//chrome:reorder_imports" ]
  }

  if (is_linux || is_chromeos) {
    data_deps += [ "//third_party/breakpad:dump_syms" ]

    # CrOS currently has issues with the locally compiled version of
    # crashpad_database_util, so only include it on traditional Linux
    # platforms.
    if (is_linux) {
      data_deps +=
          [ "//third_party/crashpad/crashpad/tools:crashpad_database_util" ]
    }
  }

  if (is_mac) {
    data_deps += [
      "//chrome:chrome_framework",
      "//chrome:chrome_helper_app_default",
      "//third_party/breakpad:dump_syms",
      "//third_party/crashpad/crashpad/tools:crashpad_database_util",
    ]
  }

  if (is_chromeos_device) {
    data_deps += [ ":cros_update_wrapper" ]
  }

  if (is_chromeos && is_chromeos_device) {
    data_deps += [
      "//:chromiumos_preflight",
      "//chromeos:cros_chrome_deploy",
      "//chromeos:cros_test_wrapper",
    ]
  }

  if (is_win) {
    data_deps += [
      "//build/win:copy_cdb_to_output",
      "//third_party/crashpad/crashpad/tools:crashpad_database_util",
    ]
  }
}

# These telemetry_chrome_test_* targets exist to reduce the amount of data
# included in swarming isolates. Including a bunch of different versions of
# Chrome and their unstripped .so files that aren't actually used adds gigabytes
# of data to the isolate, which in turn adds a non-trivial amount of swarming
# overhead. A new one should be added each time a new type of APK is supported
# and its suffix added to android_browser_types.gni.
if (is_android) {
  _bitness_if_needed = ""
  _webview_bitness_if_needed = ""
  if (defined(android_app_secondary_abi)) {
    _bitness_if_needed = "_64_32"
    _webview_bitness_if_needed = "_32_64"
  } else if (android_64bit_target_cpu) {
    _bitness_if_needed = "_64"
    _webview_bitness_if_needed = "_64"
  }
  group("telemetry_chrome_test_android_chrome") {
    testonly = true

    data_deps = [
      ":telemetry_chrome_test",
      "//chrome/android:chrome_public_apk",
    ]
  }

  group("telemetry_chrome_test_android_monochrome") {
    testonly = true

    data_deps = [
      ":telemetry_chrome_test",
      "//chrome/android:monochrome${_bitness_if_needed}_public_apk",
    ]
  }

  group("telemetry_chrome_test_android_monochrome_bundle") {
    testonly = true

    data_deps = [
      ":telemetry_chrome_test",
      "//chrome/android:monochrome${_bitness_if_needed}_public_bundle",
    ]
  }

  group("telemetry_chrome_test_android_webview") {
    testonly = true

    data_deps = [
      ":telemetry_chrome_test",
      "//android_webview:system_webview${_webview_bitness_if_needed}_apk",
      "//android_webview/test:webview_instrumentation_apk",
      "//android_webview/tools/system_webview_shell:system_webview_shell_apk",
    ]
  }

  group("telemetry_chrome_test_android_trichrome_chrome_bundle") {
    testonly = true

    data_deps = [
      ":telemetry_chrome_test",
      "//chrome/android:trichrome_chrome_bundle",
    ]
  }

  if (defined(android_app_secondary_abi)) {
    group("telemetry_chrome_test_android_trichrome_chrome_64_32_bundle") {
      testonly = true

      data_deps = [
        ":telemetry_chrome_test",
        "//chrome/android:trichrome_chrome${_bitness_if_needed}_bundle",
      ]
    }
  }

  if (enable_chrome_android_internal) {
    import("//clank/telemetry_browser_types.gni")

    template("telemetry_chrome_test_clank_template") {
      forward_variables_from(invoker, [ "telemetry_target_suffix" ])
      group(target_name) {
        testonly = true
        data_deps = [
          ":telemetry_chrome_test",
          "//clank:telemetry_clank_test${telemetry_target_suffix}",
        ]
      }
    }

    foreach(_target_suffix, telemetry_clank_browser_target_suffixes) {
      telemetry_chrome_test_clank_template(
          "telemetry_chrome_test${_target_suffix}") {
        telemetry_target_suffix = _target_suffix
      }
    }
  }
}

group("telemetry_chrome_test_without_chrome") {
  testonly = true

  data = [
    "//build/android/pylib/",  # chromium_config.py uses pylib to look for Java
    "//components/crash/content/tools/generate_breakpad_symbols.py",
    "//tools/perf/chrome_telemetry_build/",
    "//tools/perf/core/",  # chrome_telemetry_build/ depends on core/
  ]
  data_deps = [
    "//testing:test_scripts_shared",
    "//tools/metrics:metrics_python_tests",
  ]

  # Cr-Fuchsia doesn't support breakpad.
  if (!is_win && !is_fuchsia) {
    data_deps += [
      # This is defined for Windows, but is unused by Telemetry on
      # Windows, and including it can have issues when cross-compiling
      # for Arm-based Windows.
      "//third_party/breakpad:dump_syms",

      # These explicitly not defined for Windows builds in Breakpad.
      "//third_party/breakpad:minidump_dump",
      "//third_party/breakpad:minidump_stackwalk",
    ]
  }

  if (is_win) {
    data_deps += [
      # This is a stand-in for minidump_stackwalk on Windows since
      # minidump_stackwalk is not defined on Windows.
      "//third_party/crashpad/crashpad/tools:dump_minidump_annotations",
    ]
  }

  if (is_mac) {
    data += [
      # Required for the hermetic otool binary, which is required for
      # symbolizing minidumps on Mac.
      "//build/mac_files/xcode_binaries/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/",
    ]
  }

  if (is_android) {
    data += [
      # TODO(httpss://crbug.com/833808): Remove this once bots always set
      # CHROMIUM_OUTPUT_DIR correctly. Currently, this is necessary in order
      # for //build/android/pylib/constants/__init__.py to detect the output
      # directory, which tombstones.py depends on.
      "$root_out_dir/build.ninja",

      # These dependencies are necessary for running Telemetry tests in an
      # Android emulator.
      "//third_party/android_toolchain/ndk/simpleperf/",
      "//third_party/android_sdk/public/",
      "//tools/android/avd/proto/",
    ]
    data_deps += [
      "//build/android:devil_chromium_py",
      "//build/android:stack_tools",
    ]
  }
}