ui/gfx/font_list.cc
[chromium-dfly.git] / .gn
1 # This file is used by the GN meta build system to find the root of the source
2 # tree and to set startup options. For documentation on the values set in this
3 # file, run "gn help dotfile" at the command line.
4
5 import("//build/dotfile_settings.gni")
6 import("//third_party/angle/dotfile_settings.gni")
7
8 # The location of the build configuration file.
9 buildconfig = "//build/config/BUILDCONFIG.gn"
10
11 # These arguments override the default values for items in a declare_args
12 # block. "gn args" in turn can override these.
13 #
14 # In general the value for a build arg in the declare_args block should be the
15 # default. In some cases, a DEPS-ed in project will want different defaults for
16 # being built as part of Chrome vs. being built standalone. In this case, the
17 # Chrome defaults should go here. There should be no overrides here for
18 # values declared in the main Chrome repository.
19 #
20 # Important note for defining defaults: This file is executed before the
21 # BUILDCONFIG.gn file. That file sets up the global variables like "is_ios".
22 # This means that the default_args can not depend on the platform,
23 # architecture, or other build parameters. If you really need that, the other
24 # repo should define a flag that toggles on a behavior that implements the
25 # additional logic required by Chrome to set the variables.
26 default_args = {
27   # TODO(brettw) bug 684096: Chrome on iOS does not build v8, so "gn gen" prints
28   # a warning that "Build argument has no effect". When adding a v8 variable, it
29   # also needs to be defined to src/ios/BUILD.gn (respectively removed from both
30   # location when it is removed).
31
32   v8_extra_library_files = [
33     # Do *not* add more files to this list. V8 extra libraries is deprecated.
34     # TODO(902633): This list is be removed once streams are ported to C++.
35     # Dependencies used by the extra libraries. Putting them here causes them
36     # to be executed first during snapshot creation.
37     "//third_party/blink/renderer/core/streams/CommonOperations.js",
38     "//third_party/blink/renderer/core/streams/CommonStrings.js",
39     "//third_party/blink/renderer/core/streams/SimpleQueue.js",
40
41     # Extra libraries.
42     "//third_party/blink/renderer/core/streams/ByteLengthQueuingStrategy.js",
43     "//third_party/blink/renderer/core/streams/CountQueuingStrategy.js",
44     "//third_party/blink/renderer/core/streams/ReadableStream.js",
45     "//third_party/blink/renderer/core/streams/WritableStream.js",
46     "//third_party/blink/renderer/core/streams/TransformStream.js",
47   ]
48   v8_experimental_extra_library_files = []
49   v8_enable_gdbjit = false
50   v8_imminent_deprecation_warnings = false
51
52   # TODO(jochen): Remove this. http://crbug.com/v8/5830,
53   # http://crbug.com/728583.
54   v8_check_microtasks_scopes_consistency = false
55
56   # Don't include webrtc's builtin task queue implementation.
57   rtc_link_task_queue_impl = false
58
59   # Don't include the iLBC audio codec.
60   # TODO(bugs.webrtc.org/8396): Once WebRTC gets rid of its internal
61   # deps on codecs, we can remove this.
62   rtc_include_ilbc = false
63
64   # Changes some setup for the Crashpad build to set them to build against
65   # Chromium's zlib, base, etc.
66   crashpad_dependencies = "chromium"
67 }
68
69 # These are the targets to check headers for by default. The files in targets
70 # matching these patterns (see "gn help label_pattern" for format) will have
71 # their includes checked for proper dependencies when you run either
72 # "gn check" or "gn gen --check".
73 check_targets = [
74   "//apps/*",
75   "//ash/*",
76   "//base/*",
77   "//blink/*",
78   "//build/*",
79   "//buildtools/*",
80   "//cc/*",
81
82   #"//chrome/*",          # Many errors: https://crbug.com/949535
83
84   "//chrome/android/*",
85   "//chrome/app/*",
86   "//chrome/app_shim/*",
87
88   #"//chrome/browser/*",  # ~1300 errors
89   #"//chrome/browser:*",  # ~600 errors
90   "//chrome/browser/accessibility/*",
91   "//chrome/browser/android/*",
92   "//chrome/browser/app_mode/*",
93   "//chrome/browser/apps/*",
94   "//chrome/browser/assist_ranker/*",
95   "//chrome/browser/autocomplete/*",
96   "//chrome/browser/autofill/*",
97   "//chrome/browser/background/*",
98   "//chrome/browser/background_fetch/*",
99   "//chrome/browser/background_sync/*",
100   "//chrome/browser/banners/*",
101   "//chrome/browser/bitmap_fetcher/*",
102   "//chrome/browser/bookmarks/*",
103   "//chrome/browser/browsing_data/*",
104   "//chrome/browser/budget_service/*",
105   "//chrome/browser/captive_portal/*",
106   "//chrome/browser/chooser_controller/*",
107   "//chrome/browser/chromeos/*",
108   "//chrome/browser/client_hints/*",
109   "//chrome/browser/clipboard/*",
110   "//chrome/browser/component_updater/*",
111   "//chrome/browser/consent_auditor/*",
112   "//chrome/browser/content_settings/*",
113   "//chrome/browser/crash_upload_list/*",
114   "//chrome/browser/custom_handlers/*",
115   "//chrome/browser/data_saver/*",
116   "//chrome/browser/data_use_measurement/*",
117   "//chrome/browser/dbus/*",
118
119   #"//chrome/browser/devtools/*",  # 93 errors
120   "//chrome/browser/diagnostics/*",
121   "//chrome/browser/domain_reliability/*",
122   "//chrome/browser/dom_distiller/*",
123   "//chrome/browser/downgrade/*",
124   "//chrome/browser/download/*",
125   "//chrome/browser/drive/*",
126   "//chrome/browser/engagement/*",
127   "//chrome/browser/extensions/*",
128   "//chrome/browser/external_protocol/*",
129   "//chrome/browser/favicon/*",
130   "//chrome/browser/feature_engagement/*",
131   "//chrome/browser/feedback/*",
132   "//chrome/browser/first_run/*",
133   "//chrome/browser/gcm/*",
134   "//chrome/browser/generic_sensor/*",
135   "//chrome/browser/geolocation/*",
136   "//chrome/browser/google/*",
137   "//chrome/browser/gpu/*",
138   "//chrome/browser/guest_view/*",
139   "//chrome/browser/hang_monitor/*",
140   "//chrome/browser/history/*",
141   "//chrome/browser/importer/*",
142   "//chrome/browser/infobars/*",
143   "//chrome/browser/installable/*",
144   "//chrome/browser/install_verification/*",
145   "//chrome/browser/internal/*",
146   "//chrome/browser/interstitials/*",
147   "//chrome/browser/invalidation/*",
148   "//chrome/browser/language/*",
149   "//chrome/browser/lifetime/*",
150
151   #"//chrome/browser/loader/*",  # 2 errors
152   "//chrome/browser/local_discovery/*",
153   "//chrome/browser/mac/*",
154
155   #"//chrome/browser/media/*",  # 74 errors
156   "//chrome/browser/media_galleries/*",
157   "//chrome/browser/memory/*",
158   "//chrome/browser/metrics/*",
159   "//chrome/browser/nacl_host/*",
160   "//chrome/browser/navigation_predictor/*",
161   "//chrome/browser/net/*",
162   "//chrome/browser/notifications/*",
163   "//chrome/browser/ntp_snippets/*",
164   "//chrome/browser/ntp_tiles/*",
165   "//chrome/browser/obsolete_system/*",
166   "//chrome/browser/offline_items_collection/*",
167   "//chrome/browser/offline_pages/*",
168   "//chrome/browser/page_load_metrics/*",
169   "//chrome/browser/password_manager/*",
170   "//chrome/browser/payments/*",
171   "//chrome/browser/pdf/*",
172   "//chrome/browser/performance_monitor/*",
173   "//chrome/browser/permissions/*",
174   "//chrome/browser/picture_in_picture/*",
175   "//chrome/browser/plugins/*",
176
177   # "//chrome/browser/policy/*",  # 1 error on Windows
178   "//chrome/browser/predictors/*",
179   "//chrome/browser/prefetch/*",
180   "//chrome/browser/prefs/*",
181   "//chrome/browser/prerender/*",
182   "//chrome/browser/previews/*",
183   "//chrome/browser/printing/*",
184   "//chrome/browser/profile_resetter/*",
185   "//chrome/browser/profiles/*",
186
187   #"//chrome/browser/profiling_host/*",  # 16 errors
188   "//chrome/browser/push_messaging/*",
189   "//chrome/browser/recovery/*",
190   "//chrome/browser/renderer_context_menu/*",
191   "//chrome/browser/renderer_host/*",
192   "//chrome/browser/resource_coordinator/*",
193
194   #"//chrome/browser/resources/*",  # 18 errors on ChromeOS
195   "//chrome/browser/rlz/*",
196
197   #"//chrome/browser/safe_browsing/*",  # 239 errors
198   "//chrome/browser/search/*",
199   "//chrome/browser/search_engines/*",
200   "//chrome/browser/search_provider_logos/*",
201   "//chrome/browser/service_process/*",
202   "//chrome/browser/sessions/*",
203   "//chrome/browser/signin/*",
204   "//chrome/browser/speech/*",
205   "//chrome/browser/spellchecker/*",
206   "//chrome/browser/ssl/*",
207   "//chrome/browser/status_icons/*",
208   "//chrome/browser/storage/*",
209   "//chrome/browser/subresource_filter/*",
210   "//chrome/browser/supervised_user/*",
211   "//chrome/browser/sync/*",
212   "//chrome/browser/sync_file_system/*",
213   "//chrome/browser/tab_contents/*",
214   "//chrome/browser/task_manager/*",
215   "//chrome/browser/themes/*",
216   "//chrome/browser/tracing/*",
217   "//chrome/browser/translate/*",
218   "//chrome/browser/ui/*",
219   "//chrome/browser/undo/*",
220   "//chrome/browser/unified_consent/*",
221   "//chrome/browser/update_client/*",
222   "//chrome/browser/upgrade_detector/*",
223   "//chrome/browser/usb/*",
224   "//chrome/browser/vr/*",
225   "//chrome/browser/web_applications/*",
226   "//chrome/browser/webauthn/*",
227   "//chrome/browser/webshare/*",
228   "//chrome/browser/win/*",
229
230   "//chrome/build/*",
231
232   #"//chrome/child/*",  # 1 error on Windows
233   "//chrome/chrome_elf/*",
234   "//chrome/chrome_cleaner/*",
235
236   #"//chrome/chrome_watcher/*",  # 3 errors on Windows
237   "//chrome/common/*",
238
239   #"//chrome/elevation_service/*",  # 1 error on Windows
240   #"//chrome/gpu/*",  # 7 errors
241   "//chrome/installer/*",
242
243   #"//chrome/install_static/*",  # 8 errors on Windows
244   "//chrome/nacl/*",
245
246   #"//chrome/notification_helper/*",  # 4 errors on Windows
247   #"//chrome/renderer/*",  # ~30 errors
248   #"//chrome/service/*",  # 2 errors
249   #"//chrome/services/*",  # ~30 errors
250   #"//chrome/test/*",  # ~1900 errors
251   "//chrome/test/chromedriver",
252   "//chrome/third_party/*",
253   "//chrome/tools/*",
254   "//chrome/utility/*",
255
256   "//chromecast/*",
257   "//chromeos/*",
258   "//cloud_print/*",
259   "//components/*",
260   "//content/*",
261   "//courgette/*",
262   "//crypto/*",
263   "//data/*",
264   "//dbus/*",
265   "//device/*",
266
267   #"//extensions/*",  # Lots of errors.
268   "//extensions:extensions_resources",
269   "//extensions:extensions_browsertests",
270   "//extensions:extensions_unittests",
271   "//extensions/browser",
272   "//extensions/browser:core_api_provider",
273   "//extensions/browser:browser_tests",
274   "//extensions/browser:test_support",
275   "//extensions/browser:unit_tests",
276   "//extensions/browser/api:api_registration",
277   "//extensions/browser/install:*",
278   "//extensions/browser/kiosk/*",
279   "//extensions/browser/guest_view/web_view/web_ui/*",
280   "//extensions/common/*",
281   "//extensions/components/javascript_dialog_extensions_client",
282   "//extensions/components/native_app_window",
283   "//extensions/renderer/*",
284   "//extensions/shell/*",
285   "//extensions/strings/*",
286   "//fuchsia/*",
287   "//gin/*",
288   "//google_apis/*",
289   "//google_update/*",
290   "//gpu/*",
291
292   "//ios/*",
293   "//ios_internal/*",
294   "//ipc/*",
295
296   #"//jingle/*",
297
298   "//libassistant/communication/*",
299   "//libinteraction/*",
300
301   "//media/*",
302   "//mojo/*",
303
304   #"//native_client/*",
305   "//net/*",
306
307   #"//pdf/*",  # Medium-hard.
308   #"//ppapi/*",  # Lots of errors.
309   "//ppapi/examples/*",
310   "//ppapi/tests/*",
311   "//printing/*",
312
313   #"//remoting/*",  # Medium-hard.
314   "//rlz/*",
315
316   #"//sandbox/*",  # Medium-hard.
317   "//services/*",
318   "//skia/*",
319   "//sql/*",
320   "//storage/*",
321   "//testing/*",
322
323   #"//third_party/*",  # May not ever want this.
324   "//third_party:freetype_harfbuzz",
325   "//third_party/Python-Markdown/*",
326   "//third_party/SPIRV-Tools/*",
327   "//third_party/abseil-cpp/*",
328   "//third_party/accessibility-audit/*",
329   "//third_party/accessibility_test_framework/*",
330   "//third_party/adobe/*",
331   "//third_party/afl/*",
332   "//third_party/android_build_tools/*",
333   "//third_party/android_crazy_linker/*",
334   "//third_party/android_data_chart/*",
335   "//third_party/android_deps/*",
336   "//third_party/android_media/*",
337   "//third_party/android_ndk/*",
338   "//third_party/android_opengl/*",
339   "//third_party/android_platform/*",
340   "//third_party/android_protobuf/*",
341   "//third_party/android_sdk/*",
342   "//third_party/android_support_test_runner/*",
343   "//third_party/android_swipe_refresh/*",
344   "//third_party/android_system_sdk/*",
345   "//third_party/android_testrunner/*",
346   "//third_party/angle/*",
347   "//third_party/apache-portable-runtime/*",
348   "//third_party/apache_velocity/*",
349   "//third_party/apache-win32/*",
350   "//third_party/apk-patch-size-estimator/*",
351   "//third_party/apple_apsl/*",
352   "//third_party/appurify-python/*",
353   "//third_party/arcore-android-sdk/*",
354   "//third_party/ashmem/*",
355   "//third_party/auto/*",
356   "//third_party/axe-core/*",
357   "//third_party/bazel/*",
358   "//third_party/binutils/*",
359   "//third_party/blanketjs/*",
360
361   # "//third_party/blink/*",  # Errors: https://crbug.com/800764
362   "//third_party/blink/public/*",
363
364   #"//third_party/breakpad/*",  # Small errors.
365   "//third_party/boringssl/*",
366   "//third_party/bouncycastle/*",
367   "//third_party/brotli/*",
368   "//third_party/bspatch/*",
369   "//third_party/byte_buddy/*",
370   "//third_party/cacheinvalidation/*",
371   "//third_party/catapult/*",
372   "//third_party/cct_dynamic_module/*",
373
374   # "//third_party/ced/*",  # 6 errors
375   "//third_party/chaijs/*",
376   "//third_party/checkstyle/*",
377   "//third_party/chromevox/*",
378   "//third_party/chromite/*",
379   "//third_party/cld_2/*",
380   "//third_party/cld_3/*",
381   "//third_party/closure_compiler/*",
382   "//third_party/colorama/*",
383
384   # "//third_party/crashpad/*", 20ish errors
385   "//third_party/crc32c/*",
386   "//third_party/cros_system_api/*",
387   "//third_party/cython/*",
388   "//third_party/d3/*",
389   "//third_party/dawn/*",
390   "//third_party/decklink/*",
391   "//third_party/depot_tools/*",
392   "//third_party/deqp/*",
393   "//third_party/devscripts/*",
394   "//third_party/devtools-node-modules/*",
395   "//third_party/dom_distiller_js/*",
396   "//third_party/elfutils/*",
397   "//third_party/errorprone/*",
398   "//third_party/espresso/*",
399   "//third_party/expat/*",
400   "//third_party/eyesfree/*",
401   "//third_party/feed/*",
402
403   # "//third_party/ffmpeg/*",  # android_cronet only https://crbug.com/898793
404   "//third_party/flac/*",
405   "//third_party/flatbuffers/*",
406   "//third_party/flot/*",
407   "//third_party/fontconfig/*",
408   "//third_party/freetype/*",
409   "//third_party/freetype2/*",
410   "//third_party/freetype-android/*",
411   "//third_party/fuchsia-sdk/*",
412   "//third_party/gestures/*",
413   "//third_party/gif_player/*",
414   "//third_party/glfw/*",
415   "//third_party/glslang/*",
416   "//third_party/google_appengine_cloudstorage/*",
417   "//third_party/google_input_tools/*",
418   "//third_party/googletest/*",
419   "//third_party/google_toolbox_for_mac/*",
420   "//third_party/google-truth/*",
421   "//third_party/gradle_wrapper/*",
422   "//third_party/gson/*",
423   "//third_party/guava/*",
424   "//third_party/gvr-android-keyboard/*",
425   "//third_party/gvr-android-sdk/*",
426   "//third_party/hamcrest/*",
427   "//third_party/harfbuzz-ng/*",
428   "//third_party/hunspell/*",
429   "//third_party/hunspell/*",
430   "//third_party/hunspell_dictionaries/*",
431   "//third_party/iaccessible2/*",
432   "//third_party/iccjpeg/*",
433
434   # "//third_party/icu/*",  # Many errors
435   "//third_party/icu4j/*",
436   "//third_party/ijar/*",
437   "//third_party/ink/*",
438   "//third_party/inspector_protocol/*",
439   "//third_party/instrumented_libraries/*",
440   "//third_party/intellij/*",
441   "//third_party/isimpledom/*",
442   "//third_party/javax_inject/*",
443   "//third_party/jinja2/*",
444   "//third_party/jsoncpp/*",
445   "//third_party/jsr-305/*",
446   "//third_party/jstemplate/*",
447   "//third_party/junit/*",
448   "//third_party/khronos/*",
449   "//third_party/lcov/*",
450   "//third_party/leakcanary/*",
451   "//third_party/leveldatabase/*",
452   "//third_party/libFuzzer/*",
453   "//third_party/libXNVCtrl/*",
454   "//third_party/libaddressinput/*",
455
456   # "//third_party/libaom/*",  # https://crbug.com/899771
457   "//third_party/libc++/*",
458   "//third_party/libc++abi/*",
459   "//third_party/libcxx-pretty-printers/*",
460   "//third_party/libdrm/*",
461   "//third_party/libevdev/*",
462   "//third_party/libexif/*",
463   "//third_party/libjingle/*",
464
465   # "//third_party/libjingle_xmpp/*",  # 30ish errors
466   "//third_party/libjpeg/*",
467
468   # "//third_party/libjpeg_turbo/*",  # 3 errors
469   # "//third_party/liblouis/*",  # Small errors
470   "//third_party/libovr/*",
471   "//third_party/libphonenumber/*",
472   "//third_party/libpng/*",
473   "//third_party/libprotobuf-mutator/*",
474   "//third_party/libsecret/*",
475   "//third_party/libsrtp/*",
476   "//third_party/libsync/*",
477   "//third_party/libudev/*",
478   "//third_party/libusb/*",
479
480   # "//third_party/libvpx/*",  # Many errors
481   "//third_party/libvpx_new/*",
482   "//third_party/libwebm/*",
483
484   #"//third_party/libwebp/*",  # Errors: https://crbug.com/800762
485   "//third_party/libxml/*",
486   "//third_party/libxslt/*",
487   "//third_party/libyuv/*",
488   "//third_party/llvm/*",
489   "//third_party/llvm-bootstrap/*",
490   "//third_party/llvm-bootstrap-install/*",
491   "//third_party/llvm-build-tools/*",
492   "//third_party/logilab/*",
493   "//third_party/lss/*",
494   "//third_party/lzma_sdk/*",
495   "//third_party/markdown/*",
496   "//third_party/markupsafe/*",
497   "//third_party/material_design_icons/*",
498   "//third_party/mesa_headers/*",
499   "//third_party/metrics_proto/*",
500   "//third_party/minigbm/*",
501   "//third_party/minizip/*",
502   "//third_party/mocha/*",
503   "//third_party/mockito/*",
504   "//third_party/modp_b64/*",
505   "//third_party/motemplate/*",
506   "//third_party/mozilla/*",
507   "//third_party/mtpd/*",
508   "//third_party/netty4/*",
509   "//third_party/netty-tcnative/*",
510   "//third_party/node/*",
511   "//third_party/nvml/*",
512   "//third_party/objenesis/*",
513   "//third_party/ocmock/*",
514   "//third_party/openh264/*",
515   "//third_party/openvr/*",
516   "//third_party/opus/*",
517   "//third_party/ots/*",
518   "//third_party/ow2_asm/*",
519
520   # "//third_party/pdfium/*",  # 3 errors
521   "//third_party/perfetto/*",
522   "//third_party/pexpect/*",
523   "//third_party/ply/*",
524   "//third_party/polymer/*",
525   "//third_party/proguard/*",
526   "//third_party/protobuf/*",
527   "//third_party/pycoverage/*",
528   "//third_party/pyelftools/*",
529   "//third_party/pyjson5/*",
530   "//third_party/pylint/*",
531   "//third_party/pymock/*",
532   "//third_party/pystache/*",
533   "//third_party/py_trace_event/*",
534   "//third_party/pywebsocket/*",
535   "//third_party/qcms/*",
536   "//third_party/quic_trace/*",
537   "//third_party/qunit/*",
538   "//third_party/r8/*",
539   "//third_party/re2/*",
540   "//third_party/requests/*",
541   "//third_party/retrolambda/*",
542   "//third_party/rnnoise/*",
543   "//third_party/robolectric/*",
544   "//third_party/s2cellid/*",
545   "//third_party/safe_browsing/*",
546   "//third_party/scan-build/*",
547
548   # "//third_party/sfntly/*",  # 20ish errors
549   "//third_party/shaderc/*",
550   "//third_party/simplejson/*",
551   "//third_party/sinonjs/*",
552   "//third_party/skia/*",
553   "//third_party/smhasher/*",
554   "//third_party/snappy/*",
555   "//third_party/speech-dispatcher/*",
556   "//third_party/spirv-cross/*",
557   "//third_party/spirv-headers/*",
558   "//third_party/sqlite/*",
559   "//third_party/sqlite4java/*",
560   "//third_party/stp/*",
561   "//third_party/sudden_motion_sensor/*",
562
563   # "//third_party/swiftshader/*",  # 1 error
564   "//third_party/swig/*",
565   "//third_party/tcmalloc/*",
566   "//third_party/test_fonts/*",
567   "//third_party/tlslite/*",
568   "//third_party/ub-uiautomator/*",
569   "//third_party/unrar/*",
570   "//third_party/usb_ids/*",
571   "//third_party/usrsctp/*",
572   "//third_party/v4l-utils/*",
573   "//third_party/valgrind/*",
574   "//third_party/vulkan/*",
575   "//third_party/vulkan-validation-layers/*",
576
577   # "//third_party/wayland/*",  # Small errors
578   "//third_party/wayland-protocols/*",
579   "//third_party/wds/*",
580   "//third_party/web-animations-js/*",
581   "//third_party/webdriver/*",
582   "//third_party/webgl/*",
583   "//third_party/webpagereplay/*",
584   "//third_party/webrtc/*",
585   "//third_party/webrtc_overrides/*",
586   "//third_party/widevine/*",
587   "//third_party/win_build_output/*",
588   "//third_party/woff2/*",
589   "//third_party/wtl/*",
590   "//third_party/xdg-utils/*",
591   "//third_party/xstream/*",
592   "//third_party/yasm/*",
593   "//third_party/zlib/*",
594   "//third_party/woff2/*",
595
596   "//tools/*",
597   "//ui/*",
598   "//url/*",
599
600   #"//v8/*",  # Errors: https://bugs.chromium.org/p/v8/issues/detail?id=7330
601 ]
602
603 # These are the list of GN files that run exec_script. This whitelist exists
604 # to force additional review for new uses of exec_script, which is strongly
605 # discouraged.
606 #
607 # PLEASE READ
608 #
609 # You should almost never need to add new exec_script calls. exec_script is
610 # slow, especially on Windows, and can cause confusing effects. Although
611 # individually each call isn't slow or necessarily very confusing, at the scale
612 # of our repo things get out of hand quickly. By strongly pushing back on all
613 # additions, we keep the build fast and clean. If you think you need to add a
614 # new call, please consider:
615 #
616 # - Do not use a script to check for the existence of a file or directory to
617 #   enable a different mode. Instead, use GN build args to enable or disable
618 #   functionality and set options. An example is checking for a file in the
619 #   src-internal repo to see if the corresponding src-internal feature should
620 #   be enabled. There are several things that can go wrong with this:
621 #
622 #    - It's mysterious what causes some things to happen. Although in many cases
623 #      such behavior can be conveniently automatic, GN optimizes for explicit
624 #      and obvious behavior so people can more easily diagnose problems.
625 #
626 #    - The user can't enable a mode for one build and not another. With GN build
627 #      args, the user can choose the exact configuration of multiple builds
628 #      using one checkout. But implicitly basing flags on the state of the
629 #      checkout, this functionality is broken.
630 #
631 #    - It's easy to get stale files. If for example the user edits the gclient
632 #      to stop checking out src-internal (or any other optional thing), it's
633 #      easy to end up with stale files still mysteriously triggering build
634 #      conditions that are no longer appropriate (yes, this happens in real
635 #      life).
636 #
637 # - Do not use a script to iterate files in a directory (glob):
638 #
639 #    - This has the same "stale file" problem as the above discussion. Various
640 #      operations can leave untracked files in the source tree which can cause
641 #      surprising effects.
642 #
643 #    - It becomes impossible to use "git grep" to find where a certain file is
644 #      referenced. This operation is very common and people really do get
645 #      confused when things aren't listed.
646 #
647 #    - It's easy to screw up. One common case is a build-time script that packs
648 #      up a directory. The author notices that the script isn't re-run when the
649 #      directory is updated, so adds a glob so all the files are listed as
650 #      inputs. This seems to work great... until a file is deleted. When a
651 #      file is deleted, all the inputs the glob lists will still be up to date
652 #      and no command-lines will have been changed. The action will not be
653 #      re-run and the build will be broken. It is possible to get this correct
654 #      using glob, and it's possible to mess it up without glob, but globs make
655 #      this situation much easier to create. if the build always lists the
656 #      files and passes them to a script, it will always be correct.
657
658 exec_script_whitelist =
659     build_dotfile_settings.exec_script_whitelist +
660     angle_dotfile_settings.exec_script_whitelist +
661     [
662       # Whitelist entries for //build should go into
663       # //build/dotfile_settings.gni instead, so that they can be shared
664       # with other repos. The entries in this list should be only for files
665       # in the Chromium repo outside of //build.
666       "//build_overrides/build.gni",
667
668       "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn",
669
670       # TODO(dgn): Layer violation but breaks the build otherwise, see
671       # https://crbug.com/474506.
672       "//clank/java/BUILD.gn",
673       "//clank/native/BUILD.gn",
674
675       "//google_apis/BUILD.gn",
676       "//printing/BUILD.gn",
677
678       "//remoting/host/installer/linux/BUILD.gn",
679       "//remoting/remoting_version.gni",
680       "//remoting/host/installer/win/generate_clsids.gni",
681
682       "//tools/grit/grit_rule.gni",
683     ]