diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-02-21 12:16:55 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-02-21 12:16:55 +0000 |
commit | 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7 (patch) | |
tree | 5d4ae202b870bd86673f596f0d424bc4b3e55ebe /build | |
parent | e862bac9c33104a29d98631d62668ae7b6676510 (diff) | |
download | chromium_org-5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7.tar.gz |
Merge from Chromium at DEPS revision 251904
This commit was generated by merge_to_master.py.
Change-Id: I1f9543259d7d2a57d81aa41a1b84f85837439d21
Diffstat (limited to 'build')
120 files changed, 3967 insertions, 2063 deletions
diff --git a/build/all.gyp b/build/all.gyp index b4bfe634bc..811af14795 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -3,6 +3,11 @@ # found in the LICENSE file. { + 'variables': { + # A hook that can be overridden in other repositories to add additional + # compilation targets to 'All'. Only used on Android. + 'android_app_targets%': [], + }, 'targets': [ { 'target_name': 'All', @@ -11,16 +16,13 @@ 'dependencies': [ 'some.gyp:*', '../base/base.gyp:*', - '../chrome/chrome.gyp:*', '../components/components.gyp:*', '../components/components_tests.gyp:*', '../content/content.gyp:*', - '../content/content_shell_and_tests.gyp:*', '../crypto/crypto.gyp:*', '../net/net.gyp:*', '../sdch/sdch.gyp:*', '../sql/sql.gyp:*', - '../sync/sync.gyp:*', '../testing/gmock.gyp:*', '../testing/gtest.gyp:*', '../third_party/icu/icu.gyp:*', @@ -33,8 +35,39 @@ '../url/url.gyp:*', ], 'conditions': [ - ['OS!="ios"', { + ['OS=="ios"', { 'dependencies': [ + '../ios/ios.gyp:*', + '../ui/gfx/gfx.gyp:gfx_unittests', + '../ui/ui_unittests.gyp:ui_unittests', + ], + }], + ['OS=="android"', { + 'dependencies': [ + '../content/content_shell_and_tests.gyp:content_shell_apk', + '../mojo/mojo.gyp:mojo_shell_apk', + '<@(android_app_targets)', + 'android_builder_tests', + '../android_webview/android_webview.gyp:android_webview_apk', + '../chrome/chrome.gyp:chromium_testshell', + '../remoting/remoting.gyp:remoting_apk', + '../tools/telemetry/telemetry.gyp:*#host', + # TODO(nyquist) This should instead by a target for sync when all of + # the sync-related code for Android has been upstreamed. + # See http://crbug.com/159203 + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib', + ], + }, { + 'dependencies': [ + '../content/content_shell_and_tests.gyp:*', + # TODO: This should build on Android and the target should move to the list above. + '../sync/sync.gyp:*', + ], + }], + ['OS!="ios" and OS!="android"', { + 'dependencies': [ + '../third_party/re2/re2.gyp:re2', + '../chrome/chrome.gyp:*', '../cc/cc_tests.gyp:*', '../device/bluetooth/bluetooth.gyp:*', '../device/device_tests.gyp:*', @@ -49,8 +82,10 @@ '../mojo/mojo.gyp:*', '../ppapi/ppapi.gyp:*', '../ppapi/ppapi_internal.gyp:*', + '../ppapi/tools/ppapi_tools.gyp:*', '../printing/printing.gyp:*', '../skia/skia.gyp:*', + '../third_party/WebKit/public/all.gyp:*', '../third_party/cacheinvalidation/cacheinvalidation.gyp:*', '../third_party/codesighs/codesighs.gyp:*', '../third_party/ffmpeg/ffmpeg.gyp:*', @@ -65,20 +100,13 @@ '../third_party/npapi/npapi.gyp:*', '../third_party/ots/ots.gyp:*', '../third_party/qcms/qcms.gyp:*', - '../third_party/re2/re2.gyp:re2', - '../third_party/WebKit/public/all.gyp:*', '../tools/gn/gn.gyp:*', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', + '../tools/telemetry/telemetry.gyp:*', '../v8/tools/gyp/v8.gyp:*', - '../webkit/glue/webkit_glue.gyp:*', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:*', '<(libjpeg_gyp_path):*', ], - }, { # 'OS=="ios"' - 'dependencies': [ - '../ios/ios.gyp:*', - '../ui/ui_unittests.gyp:ui_unittests', - ], }], ['OS!="android" and OS!="ios"', { 'dependencies': [ @@ -153,8 +181,6 @@ 'dependencies': [ # TODO(jschuh) Enable Win64 Memory Watcher. crbug.com/176877 '../tools/memory_watcher/memory_watcher.gyp:*', - # TODO(jschuh) Enable Win64 Chrome Frame. crbug.com/176875 - '../chrome_frame/chrome_frame.gyp:*', ], }], ], @@ -164,8 +190,9 @@ '../courgette/courgette.gyp:*', '../rlz/rlz.gyp:*', '../sandbox/sandbox.gyp:*', - '../third_party/angle_dx11/src/build_angle.gyp:*', + '<(angle_path)/src/build_angle.gyp:*', '../third_party/bspatch/bspatch.gyp:*', + '../tools/win/static_initializers/static_initializers.gyp:*', ], }, { 'dependencies': [ @@ -223,6 +250,8 @@ ], }, # target_name: All_syzygy { + # Note: Android uses android_builder_tests below. + # TODO: Consider merging that with this target. 'target_name': 'chromium_builder_tests', 'type': 'none', 'dependencies': [ @@ -232,11 +261,12 @@ '../net/net.gyp:net_unittests', '../sql/sql.gyp:sql_unittests', '../sync/sync.gyp:sync_unit_tests', + '../ui/gfx/gfx.gyp:gfx_unittests', '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', ], 'conditions': [ - ['OS!="ios"', { + ['OS!="ios" and OS!="android"', { 'dependencies': [ '../cc/cc_tests.gyp:cc_unittests', '../chrome/chrome.gyp:browser_tests', @@ -258,6 +288,7 @@ '../gpu/gpu.gyp:gpu_unittests', '../ipc/ipc.gyp:ipc_tests', '../jingle/jingle.gyp:jingle_unittests', + '../media/cast/cast.gyp:cast_unittests', '../media/media.gyp:media_unittests', '../mojo/mojo.gyp:mojo', '../ppapi/ppapi_internal.gyp:ppapi_unittests', @@ -266,6 +297,7 @@ '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', + '../tools/telemetry/telemetry.gyp:*', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', ], }], @@ -278,32 +310,15 @@ # defined in installer.gyp. '../chrome/installer/mini_installer.gyp:mini_installer', '../chrome_elf/chrome_elf.gyp:chrome_elf_unittests', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', + '../content/content_shell_and_tests.gyp:copy_test_netscape_plugin', '../courgette/courgette.gyp:courgette_unittests', '../sandbox/sandbox.gyp:sbox_integration_tests', '../sandbox/sandbox.gyp:sbox_unittests', '../sandbox/sandbox.gyp:sbox_validation_tests', - '../third_party/WebKit/public/blink_test_plugin.gyp:blink_test_plugin', '../ui/app_list/app_list.gyp:app_list_unittests', '../ui/views/views.gyp:views_unittests', ], 'conditions': [ - ['target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - ] - }, { # target_arch!="x64" - 'dependencies!': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - 'defines': [ - 'OMIT_CHROME_FRAME', - ], - }], # target_arch=="x64" # remoting_host_installation uses lots of non-trivial GYP that tend # to break because of differences between ninja and msbuild. Make # sure this target is built by the builders on the main waterfall. @@ -313,7 +328,7 @@ '../remoting/remoting.gyp:remoting_host_installation', ], }], - ['asan==1', { + ['syzyasan==1', { 'variables': { # Disable incremental linking for all modules. # 0: inherit, 1: disabled, 2: enabled. @@ -329,7 +344,7 @@ ], 'msvs_settings': { 'VCLinkerTool': { - # Enable profile information (necessary for asan + # Enable profile information (necessary for SyzyAsan # instrumentation). This is incompatible with incremental # linking. 'Profile': 'true', @@ -340,8 +355,8 @@ }], ['OS=="linux"', { 'dependencies': [ - '../sandbox/sandbox.gyp:sandbox_linux_unittests', '../dbus/dbus.gyp:dbus_unittests', + '../sandbox/sandbox.gyp:sandbox_linux_unittests', ], }], ['OS=="mac"', { @@ -367,6 +382,7 @@ }], ['use_aura==1', { 'dependencies': [ + '../ui/app_list/app_list.gyp:app_list_unittests', '../ui/aura/aura.gyp:aura_unittests', '../ui/compositor/compositor.gyp:compositor_unittests', '../ui/keyboard/keyboard.gyp:keyboard_unittests', @@ -400,14 +416,26 @@ 'type': 'none', 'dependencies': [ '../third_party/WebKit/public/all.gyp:all_blink', - '../content/content_shell_and_tests.gyp:content_shell', ], 'conditions': [ + ['OS=="android"', { + 'dependencies': [ + '../content/content_shell_and_tests.gyp:content_shell_apk', + '../breakpad/breakpad.gyp:dump_syms#host', + '../breakpad/breakpad.gyp:minidump_stackwalk#host', + ], + }, { # OS!="android" + 'dependencies': [ + '../content/content_shell_and_tests.gyp:content_shell', + ], + }], ['OS=="win"', { 'dependencies': [ '../content/content_shell_and_tests.gyp:content_shell_crash_service', + '../content/content_shell_and_tests.gyp:layout_test_helper', ], - }, { # OS!="win" + }], + ['OS!="win" and OS!="android"', { 'dependencies': [ '../breakpad/breakpad.gyp:minidump_stackwalk', ], @@ -415,6 +443,7 @@ ['OS=="mac"', { 'dependencies': [ '../breakpad/breakpad.gyp:dump_syms#host', + '../content/content_shell_and_tests.gyp:layout_test_helper', ], }], ['OS=="linux"', { @@ -433,6 +462,10 @@ 'blink_tests', ], }, # target_name: all_webkit + ], + }], # OS!=ios + ['OS!="ios" and OS!="android"', { + 'targets': [ { 'target_name': 'chromium_builder_nacl_win_integration', 'type': 'none', @@ -452,6 +485,7 @@ '../chrome/chrome.gyp:sync_performance_tests', '../media/media.gyp:media_perftests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', + '../tools/telemetry/telemetry.gyp:*', ], 'conditions': [ ['OS!="ios" and OS!="win"', { @@ -488,6 +522,7 @@ '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test', '../gpu/gpu.gyp:gl_tests', '../gpu/gpu.gyp:angle_unittests', + '../tools/telemetry/telemetry.gyp:*', ], 'conditions': [ ['OS!="ios" and OS!="win"', { @@ -522,6 +557,7 @@ '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test', '../gpu/gpu.gyp:gl_tests', '../gpu/gpu.gyp:angle_unittests', + '../tools/telemetry/telemetry.gyp:*', ], 'conditions': [ ['OS!="ios" and OS!="win"', { @@ -635,6 +671,16 @@ '../skia/skia.gyp:filter_fuzz_stub', ], }], + ['enable_ipc_fuzzer==1 and OS=="linux" and component!="shared_library"', { + 'dependencies': [ + '../tools/ipc_fuzzer/ipc_fuzzer.gyp:*', + ], + }], + ['chromeos==0', { + 'dependencies': [ + '../v8/src/d8.gyp:d8#host', + ], + }], ['internal_filter_fuzzer==1', { 'dependencies': [ '../skia/tools/clusterfuzz-data/fuzzers/filter_fuzzer/filter_fuzzer.gyp:filter_fuzzer', @@ -656,7 +702,138 @@ ], }, ], # targets - }], + }], #OS!=ios and OS!=android + ['OS=="android"', { + 'targets': [ + { + # The current list of tests for android. This is temporary + # until the full set supported. If adding a new test here, + # please also add it to build/android/pylib/gtest/gtest_config.py, + # else the test is not run. + # + # WARNING: + # Do not add targets here without communicating the implications + # on tryserver triggers and load. Discuss with + # chrome-infrastructure-team please. + 'target_name': 'android_builder_tests', + 'type': 'none', + 'dependencies': [ + '../android_webview/android_webview.gyp:android_webview_unittests', + '../base/android/jni_generator/jni_generator.gyp:jni_generator_tests', + '../base/base.gyp:base_unittests', + '../breakpad/breakpad.gyp:breakpad_unittests_stripped', + # Also compile the tools needed to deal with minidumps, they are + # needed to run minidump tests upstream. + '../breakpad/breakpad.gyp:dump_syms#host', + '../breakpad/breakpad.gyp:symupload#host', + '../breakpad/breakpad.gyp:minidump_dump#host', + '../breakpad/breakpad.gyp:minidump_stackwalk#host', + '../build/android/tests/multiple_proguards/multiple_proguards.gyp:multiple_proguards_test_apk', + '../cc/cc_tests.gyp:cc_perftests_apk', + '../cc/cc_tests.gyp:cc_unittests', + '../chrome/chrome.gyp:unit_tests', + '../components/components_tests.gyp:components_unittests', + '../content/content_shell_and_tests.gyp:content_browsertests', + '../content/content_shell_and_tests.gyp:content_gl_tests', + '../content/content_shell_and_tests.gyp:chromium_linker_test_apk', + '../content/content_shell_and_tests.gyp:content_shell_test_apk', + '../content/content_shell_and_tests.gyp:content_unittests', + '../gpu/gpu.gyp:gl_tests', + '../gpu/gpu.gyp:gpu_unittests', + '../ipc/ipc.gyp:ipc_tests', + '../media/media.gyp:media_perftests_apk', + '../media/media.gyp:media_unittests', + '../net/net.gyp:net_unittests', + '../sandbox/sandbox.gyp:sandbox_linux_unittests_stripped', + '../sql/sql.gyp:sql_unittests', + '../sync/sync.gyp:sync_unit_tests', + '../third_party/WebKit/public/all.gyp:*', + '../tools/android/android_tools.gyp:android_tools', + '../tools/android/android_tools.gyp:memconsumer', + '../tools/android/findbugs_plugin/findbugs_plugin.gyp:findbugs_plugin_test', + '../ui/ui_unittests.gyp:ui_unittests', + # Required by ui_unittests. + # TODO(wangxianzhu): It'd better let ui_unittests depend on it, but + # this would cause circular gyp dependency which needs refactoring the + # gyps to resolve. + '../chrome/chrome_resources.gyp:packed_resources', + ], + 'conditions': [ + ['"<(gtest_target_type)"=="shared_library"', { + 'dependencies': [ + # Unit test bundles packaged as an apk. + '../android_webview/android_webview.gyp:android_webview_unittests_apk', + '../base/base.gyp:base_unittests_apk', + '../cc/cc_tests.gyp:cc_unittests_apk', + '../chrome/chrome.gyp:unit_tests_apk', + '../components/components_tests.gyp:components_unittests_apk', + '../content/content_shell_and_tests.gyp:content_browsertests_apk', + '../content/content_shell_and_tests.gyp:content_gl_tests_apk', + '../content/content_shell_and_tests.gyp:content_unittests_apk', + '../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest_apk', + '../gpu/gpu.gyp:gl_tests_apk', + '../gpu/gpu.gyp:gpu_unittests_apk', + '../ipc/ipc.gyp:ipc_tests_apk', + '../media/media.gyp:media_unittests_apk', + '../net/net.gyp:net_unittests_apk', + '../sandbox/sandbox.gyp:sandbox_linux_jni_unittests_apk', + '../sql/sql.gyp:sql_unittests_apk', + '../sync/sync.gyp:sync_unit_tests_apk', + '../ui/ui_unittests.gyp:ui_unittests_apk', + '../android_webview/android_webview.gyp:android_webview_test_apk', + '../chrome/chrome.gyp:chromium_testshell_test_apk', + '../chrome/chrome.gyp:chromium_testshell_uiautomator_tests', + '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests_apk' + ], + }], + ], + }, + { + # WebRTC Android APK tests. + 'target_name': 'android_builder_webrtc', + 'type': 'none', + 'variables': { + # Set default value for include_tests to '0'. It is normally only + # used in WebRTC GYP files. It is set to '1' only when building + # WebRTC for Android, inside a Chromium checkout. + 'include_tests%': 0, + }, + 'conditions': [ + ['"<(gtest_target_type)"=="shared_library" and include_tests==1', { + 'dependencies': [ + '../third_party/webrtc/build/apk_tests.gyp:*', + ], + }], + ], + }, # target_name: android_builder_webrtc + { + # WebRTC Chromium tests to run on Android. + 'target_name': 'android_builder_chromium_webrtc', + 'type': 'none', + 'dependencies': [ + '../content/content_shell_and_tests.gyp:content_browsertests', + '../tools/android/android_tools.gyp:android_tools', + '../tools/android/android_tools.gyp:memconsumer', + ], + 'conditions': [ + ['"<(gtest_target_type)"=="shared_library"', { + 'dependencies': [ + # Unit test bundles packaged as an apk. + '../content/content_shell_and_tests.gyp:content_browsertests_apk', + ], + }], + ], + }, # target_name: android_builder_chromium_webrtc + { + # Build the java portions of the binary size analysis tool. + 'target_name': 'binary_size_tool', + 'type': 'none', + 'dependencies': [ + '../tools/binary_size/binary_size.gyp:binary_size_java', + ], + }, + ], # targets + }], # OS="android" ['OS=="mac"', { 'targets': [ { @@ -700,6 +877,8 @@ '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', + '../tools/telemetry/telemetry.gyp:*', + '../ui/gfx/gfx.gyp:gfx_unittests', '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', @@ -734,6 +913,8 @@ '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', + '../tools/telemetry/telemetry.gyp:*', + '../ui/gfx/gfx.gyp:gfx_unittests', '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', @@ -789,6 +970,7 @@ '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests', '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', + '../ui/gfx/gfx.gyp:gfx_unittests', '../ui/ui_unittests.gyp:ui_unittests', '../url/url.gyp:url_unittests', ], @@ -817,10 +999,10 @@ '../components/components_tests.gyp:components_unittests', '../content/content_shell_and_tests.gyp:content_browsertests', '../content/content_shell_and_tests.gyp:content_unittests', + '../content/content_shell_and_tests.gyp:copy_test_netscape_plugin', # mini_installer_tests depends on mini_installer. This should be # defined in installer.gyp. '../chrome/installer/mini_installer.gyp:mini_installer', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', '../courgette/courgette.gyp:courgette_unittests', '../device/device_tests.gyp:device_unittests', '../google_apis/gcm/gcm.gyp:gcm_unit_tests', @@ -837,47 +1019,18 @@ '../third_party/libaddressinput/libaddressinput.gyp:libaddressinput_unittests', '../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', + '../tools/telemetry/telemetry.gyp:*', '../ui/events/events.gyp:events_unittests', + '../ui/gfx/gfx.gyp:gfx_unittests', '../ui/ui_unittests.gyp:ui_unittests', '../ui/views/views.gyp:views_unittests', '../url/url.gyp:url_unittests', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', - '../third_party/WebKit/public/blink_test_plugin.gyp:blink_test_plugin', - ], - 'conditions': [ - ['target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - ] - }, { # target_arch!="x64" - 'dependencies!': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - 'defines': [ - 'OMIT_CHROME_FRAME', - ], - }], # target_arch=="x64" ], }, { 'target_name': 'chromium_builder_win_cf', 'type': 'none', - 'conditions': [ - ['target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - }], # target_arch!="x64" - ], }, { 'target_name': 'chromium_builder_dbg_tsan_win', @@ -942,16 +1095,26 @@ 'target_name': 'chrome_official_builder', 'type': 'none', 'dependencies': [ + '../base/base.gyp:base_unittests', '../chrome/chrome.gyp:crash_service', '../chrome/chrome.gyp:gcapi_dll', - '../chrome/chrome.gyp:policy_templates', - '../courgette/courgette.gyp:courgette64', + '../chrome/chrome.gyp:pack_policy_templates', '../chrome/installer/mini_installer.gyp:mini_installer', - '../courgette/courgette.gyp:courgette', '../cloud_print/cloud_print.gyp:cloud_print', + '../courgette/courgette.gyp:courgette', + '../courgette/courgette.gyp:courgette64', + '../ipc/ipc.gyp:ipc_tests', + '../media/media.gyp:media_unittests', + '../net/net.gyp:net_unittests_run', + '../printing/printing.gyp:printing_unittests', '../remoting/remoting.gyp:remoting_webapp', + '../sql/sql.gyp:sql_unittests', + '../sync/sync.gyp:sync_unit_tests', '../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmadapter', - '../chrome/chrome.gyp:pyautolib', + '../ui/gfx/gfx.gyp:gfx_unittests', + '../ui/ui_unittests.gyp:ui_unittests', + '../ui/views/views.gyp:views_unittests', + '../url/url.gyp:url_unittests', ], 'conditions': [ ['internal_pdf', { @@ -962,9 +1125,6 @@ ['target_arch=="ia32"', { 'dependencies': [ '../chrome/chrome.gyp:crash_service_win64', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - # Omitting tests from Win64 to speed up cycle times. - '../chrome/chrome.gyp:interactive_ui_tests', ], }], ['component != "shared_library" and wix_exists == "True" and \ @@ -973,11 +1133,6 @@ '../remoting/remoting.gyp:remoting_host_installation', ], }], # component != "shared_library" - ['target_arch=="x64"', { - 'defines': [ - 'OMIT_CHROME_FRAME', - ], - }], # target_arch=="x64" ] }, ], # targets @@ -999,19 +1154,21 @@ '../content/content_shell_and_tests.gyp:content_browsertests', '../content/content_shell_and_tests.gyp:content_unittests', '../device/device_tests.gyp:device_unittests', + '../google_apis/gcm/gcm.gyp:gcm_unit_tests', '../ppapi/ppapi_internal.gyp:ppapi_unittests', '../remoting/remoting.gyp:remoting_unittests', '../ui/app_list/app_list.gyp:*', '../ui/aura/aura.gyp:*', '../ui/compositor/compositor.gyp:*', '../ui/events/events.gyp:*', + '../ui/gfx/gfx.gyp:gfx_unittests', + '../ui/keyboard/keyboard.gyp:*', '../ui/message_center/message_center.gyp:*', - '../ui/ui_unittests.gyp:ui_unittests', '../ui/snapshot/snapshot.gyp:snapshot_unittests', + '../ui/ui_unittests.gyp:ui_unittests', '../ui/views/views.gyp:views', '../ui/views/views.gyp:views_examples_with_content_exe', '../ui/views/views.gyp:views_unittests', - '../ui/keyboard/keyboard.gyp:*', '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests', 'blink_tests', ], @@ -1019,24 +1176,6 @@ ['OS=="win"', { 'dependencies': [ '../chrome/chrome.gyp:crash_service', - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - }], - ['OS=="win" and target_arch!="x64"', { - 'dependencies': [ - '../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_perftests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_tests', - '../chrome_frame/chrome_frame.gyp:chrome_frame_unittests', - ], - }], - ['OS=="win" and target_arch=="x64"', { - 'dependencies!': [ - '../chrome_frame/chrome_frame.gyp:npchrome_frame', - ], - 'defines': [ - 'OMIT_CHROME_FRAME', ], }], ['OS=="win" and target_arch=="ia32"', { @@ -1067,6 +1206,21 @@ ], }, ], # targets + }, { + 'conditions': [ + ['OS=="linux"', { + # TODO(thakis): Remove this once the linux gtk bot no longer references + # it (probably after the first aura release on linux), see r249162 + 'targets': [ + { + 'target_name': 'aura_builder', + 'type': 'none', + 'dependencies': [ + '../chrome/chrome.gyp:chrome', + ], + }, + ], # targets + }]], # OS=="linux" }], # "use_aura==1" ['test_isolation_mode != "noop"', { 'targets': [ diff --git a/build/all_android.gyp b/build/all_android.gyp deleted file mode 100644 index 748571a832..0000000000 --- a/build/all_android.gyp +++ /dev/null @@ -1,187 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This is all.gyp file for Android to prevent breakage in Android and other -# platform; It will be churning a lot in the short term and eventually be merged -# into all.gyp. - -{ - 'variables': { - # A hook that can be overridden in other repositories to add additional - # compilation targets to 'All' - 'android_app_targets%': [], - }, - 'targets': [ - { - 'target_name': 'All', - 'type': 'none', - 'dependencies': [ - '../content/content_shell_and_tests.gyp:content_shell_apk', - '../mojo/mojo.gyp:mojo_shell_apk', - '<@(android_app_targets)', - 'android_builder_tests', - '../android_webview/android_webview.gyp:android_webview_apk', - '../chrome/chrome.gyp:chromium_testshell', - '../remoting/remoting.gyp:remoting_apk', - # TODO(nyquist) This should instead by a target for sync when all of - # the sync-related code for Android has been upstreamed. - # See http://crbug.com/159203 - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib', - ], - }, # target_name: All - { - 'target_name': 'blink_tests', - 'type': 'none', - 'dependencies': [ - '../third_party/WebKit/public/all.gyp:all_blink', - '../content/content_shell_and_tests.gyp:content_shell_apk', - '../breakpad/breakpad.gyp:dump_syms#host', - '../breakpad/breakpad.gyp:minidump_stackwalk#host', - ], - }, # target_name: blink_tests - { - # TODO(jochen): Eventually remove this target after everybody and the - # bots started to use blink_tests only. - 'target_name': 'all_webkit', - 'type': 'none', - 'dependencies': [ - 'blink_tests', - ], - }, # target_name: all_webkit - { - # The current list of tests for android. This is temporary - # until the full set supported. If adding a new test here, - # please also add it to build/android/pylib/gtest/gtest_config.py, - # else the test is not run. - # - # WARNING: - # Do not add targets here without communicating the implications - # on tryserver triggers and load. Discuss with jrg please. - 'target_name': 'android_builder_tests', - 'type': 'none', - 'dependencies': [ - '../android_webview/android_webview.gyp:android_webview_unittests', - '../base/android/jni_generator/jni_generator.gyp:jni_generator_tests', - '../base/base.gyp:base_unittests', - '../breakpad/breakpad.gyp:breakpad_unittests', - # Also compile the tools needed to deal with minidumps, they are - # needed to run minidump tests upstream. - '../breakpad/breakpad.gyp:dump_syms#host', - '../breakpad/breakpad.gyp:symupload#host', - '../breakpad/breakpad.gyp:minidump_dump#host', - '../breakpad/breakpad.gyp:minidump_stackwalk#host', - '../build/android/tests/multiple_proguards/multiple_proguards.gyp:multiple_proguards_test_apk', - '../cc/cc_tests.gyp:cc_perftests_apk', - '../cc/cc_tests.gyp:cc_unittests', - '../chrome/chrome.gyp:unit_tests', - '../components/components_tests.gyp:components_unittests', - '../content/content_shell_and_tests.gyp:content_browsertests', - '../content/content_shell_and_tests.gyp:content_gl_tests', - '../content/content_shell_and_tests.gyp:content_shell_test_apk', - '../content/content_shell_and_tests.gyp:content_unittests', - '../gpu/gpu.gyp:gl_tests', - '../gpu/gpu.gyp:gpu_unittests', - '../ipc/ipc.gyp:ipc_tests', - '../media/media.gyp:media_perftests_apk', - '../media/media.gyp:media_unittests', - '../net/net.gyp:net_unittests', - '../sandbox/sandbox.gyp:sandbox_linux_unittests', - '../sql/sql.gyp:sql_unittests', - '../sync/sync.gyp:sync_unit_tests', - '../third_party/WebKit/public/all.gyp:*', - '../tools/android/android_tools.gyp:android_tools', - '../tools/android/android_tools.gyp:memconsumer', - '../tools/android/findbugs_plugin/findbugs_plugin.gyp:findbugs_plugin_test', - '../ui/ui_unittests.gyp:ui_unittests', - # Required by ui_unittests. - # TODO(wangxianzhu): It'd better let ui_unittests depend on it, but - # this would cause circular gyp dependency which needs refactoring the - # gyps to resolve. - '../chrome/chrome_resources.gyp:packed_resources', - ], - 'conditions': [ - ['"<(gtest_target_type)"=="shared_library"', { - 'dependencies': [ - # Unit test bundles packaged as an apk. - '../android_webview/android_webview.gyp:android_webview_unittests_apk', - '../base/base.gyp:base_unittests_apk', - '../cc/cc_tests.gyp:cc_unittests_apk', - '../chrome/chrome.gyp:unit_tests_apk', - '../components/components_tests.gyp:components_unittests_apk', - '../content/content_shell_and_tests.gyp:content_browsertests_apk', - '../content/content_shell_and_tests.gyp:content_gl_tests_apk', - '../content/content_shell_and_tests.gyp:content_unittests_apk', - '../content/content_shell_and_tests.gyp:video_decode_accelerator_unittest_apk', - '../gpu/gpu.gyp:gl_tests_apk', - '../gpu/gpu.gyp:gpu_unittests_apk', - '../ipc/ipc.gyp:ipc_tests_apk', - '../media/media.gyp:media_unittests_apk', - '../net/net.gyp:net_unittests_apk', - '../sandbox/sandbox.gyp:sandbox_linux_jni_unittests_apk', - '../sql/sql.gyp:sql_unittests_apk', - '../sync/sync.gyp:sync_unit_tests_apk', - '../ui/ui_unittests.gyp:ui_unittests_apk', - '../android_webview/android_webview.gyp:android_webview_test_apk', - '../chrome/chrome.gyp:chromium_testshell_test_apk', - '../chrome/chrome.gyp:chromium_testshell_uiautomator_tests', - '../webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests_apk' - ], - }], - ], - }, - { - # WebRTC Android APK tests. - 'target_name': 'android_builder_webrtc', - 'type': 'none', - 'variables': { - # Set default value for include_tests to '0'. It is normally only - # used in WebRTC GYP files. It is set to '1' only when building - # WebRTC for Android, inside a Chromium checkout. - 'include_tests%': 0, - }, - 'conditions': [ - ['"<(gtest_target_type)"=="shared_library" and include_tests==1', { - 'dependencies': [ - '../third_party/webrtc/build/apk_tests.gyp:*', - ], - }], - ], - }, # target_name: android_builder_webrtc - { - # WebRTC Chromium tests to run on Android. - 'target_name': 'android_builder_chromium_webrtc', - 'type': 'none', - 'dependencies': [ - '../content/content_shell_and_tests.gyp:content_browsertests', - '../tools/android/android_tools.gyp:android_tools', - '../tools/android/android_tools.gyp:memconsumer', - ], - 'conditions': [ - ['"<(gtest_target_type)"=="shared_library"', { - 'dependencies': [ - # Unit test bundles packaged as an apk. - '../content/content_shell_and_tests.gyp:content_browsertests_apk', - ], - }], - ], - }, # target_name: android_builder_chromium_webrtc - { - # Experimental / in-progress targets that are expected to fail - # but we still try to compile them on bots (turning the stage - # orange, not red). - 'target_name': 'android_experimental', - 'type': 'none', - 'dependencies': [ - ], - }, - { - # In-progress targets that are expected to fail and are NOT run - # on any bot. - 'target_name': 'android_in_progress', - 'type': 'none', - 'dependencies': [ - ], - }, - ], # targets -} diff --git a/build/android/adb_gdb b/build/android/adb_gdb index 5d839dccfc..ee9f45f2d0 100755 --- a/build/android/adb_gdb +++ b/build/android/adb_gdb @@ -911,8 +911,16 @@ PORT=5039 HOST_PORT=$PORT TARGET_PORT=$PORT -# Pull the app_process binary from the device +# Detect AddressSanitizer setup on the device. In that case app_process is a +# script, and the real executable is app_process.real. GDBEXEC=app_process +GDBEXEC_ASAN=app_process.real +adb_shell ls /system/bin/$GDBEXEC_ASAN +if [ $? == 0 ]; then + GDBEXEC=$GDBEXEC_ASAN +fi + +# Pull the app_process binary from the device. log "Pulling $GDBEXEC from device" adb pull /system/bin/$GDBEXEC "$TMPDIR"/$GDBEXEC &>/dev/null fail_panic "Could not retrieve $GDBEXEC from the device!" diff --git a/build/android/adb_profile_chrome.py b/build/android/adb_profile_chrome.py index bb3e9d0388..19a72fef19 100755 --- a/build/android/adb_profile_chrome.py +++ b/build/android/adb_profile_chrome.py @@ -10,6 +10,7 @@ import logging import optparse import os import re +import select import shutil import sys import threading @@ -263,6 +264,10 @@ def _PrintMessage(heading, eol='\n'): sys.stdout.flush() +def _WaitForEnter(timeout): + select.select([sys.stdin], [], [], timeout) + + def _StartTracing(controllers, interval): for controller in controllers: controller.StartTracing(interval) @@ -307,14 +312,12 @@ def _CaptureAndPullTrace(controllers, interval, output, compress, write_html): try: _StartTracing(controllers, interval) if interval: - _PrintMessage('Capturing %d-second %s. Press Ctrl-C to stop early...' % \ + _PrintMessage('Capturing %d-second %s. Press Enter to stop early...' % \ (interval, trace_type), eol='') - time.sleep(interval) + _WaitForEnter(interval) else: _PrintMessage('Capturing %s. Press Enter to stop...' % trace_type, eol='') raw_input() - except KeyboardInterrupt: - _PrintMessage('\nInterrupted...', eol='') finally: _StopTracing(controllers) if interval: @@ -325,7 +328,9 @@ def _CaptureAndPullTrace(controllers, interval, output, compress, write_html): def _ComputeChromeCategories(options): categories = [] - if options.trace_cc: + if options.trace_frame_viewer: + categories.append('disabled-by-default-cc.debug') + if options.trace_ubercompositor: categories.append('disabled-by-default-cc.debug*') if options.trace_gpu: categories.append('disabled-by-default-gpu.debug*') @@ -377,8 +382,15 @@ def main(): 'available categories. Systrace is disabled by ' 'default.', metavar='SYS_CATEGORIES', dest='systrace_categories', default='') - categories.add_option('--trace-cc', help='Enable extra trace categories for ' - 'compositor frame viewer data.', action='store_true') + categories.add_option('--trace-cc', + help='Deprecated, use --trace-frame-viewer.', + action='store_true') + categories.add_option('--trace-frame-viewer', + help='Enable enough trace categories for ' + 'compositor frame viewing.', action='store_true') + categories.add_option('--trace-ubercompositor', + help='Enable enough trace categories for ' + 'ubercompositor frame data.', action='store_true') categories.add_option('--trace-gpu', help='Enable extra trace categories for ' 'GPU data.', action='store_true') parser.add_option_group(categories) @@ -401,6 +413,14 @@ def main(): parser.add_option('-z', '--compress', help='Compress the resulting trace ' 'with gzip. ', action='store_true') options, args = parser.parse_args() + if options.trace_cc: + parser.parse_error("""--trace-cc is deprecated. + +For basic jank busting uses, use --trace-frame-viewer +For detailed study of ubercompositor, pass --trace-ubercompositor. + +When in doubt, just try out --trace-frame-viewer. +""") if options.verbose: logging.getLogger().setLevel(logging.DEBUG) diff --git a/build/android/adb_run_mojo_shell b/build/android/adb_run_mojo_shell index d47270eca4..c6082d2ad8 100755 --- a/build/android/adb_run_mojo_shell +++ b/build/android/adb_run_mojo_shell @@ -12,3 +12,4 @@ adb shell am start \ -a android.intent.action.VIEW \ -n org.chromium.mojo_shell_apk/.MojoShellActivity \ $INTENT_ARGS +adb logcat -s MojoShellApplication MojoShellActivity chromium diff --git a/build/android/asan_symbolize.py b/build/android/asan_symbolize.py index 928798f5e5..0504aa23ae 100755 --- a/build/android/asan_symbolize.py +++ b/build/android/asan_symbolize.py @@ -20,16 +20,17 @@ sys.path.insert(0, import symbol -_RE_ASAN = re.compile(r'I/asanwrapper\.sh.*?(#\S*?) (\S*?) \((.*?)\+(.*?)\)') +_RE_ASAN = re.compile(r'(.*?)(#\S*?) (\S*?) \((.*?)\+(.*?)\)') def _ParseAsanLogLine(line): m = re.match(_RE_ASAN, line) if not m: return None return { - 'library': m.group(3), - 'pos': m.group(1), - 'rel_address': '%08x' % int(m.group(4), 16), + 'prefix': m.group(1), + 'library': m.group(4), + 'pos': m.group(2), + 'rel_address': '%08x' % int(m.group(5), 16), } @@ -56,7 +57,7 @@ def _Symbolize(input): asan_libs = _FindASanLibraries() libraries = collections.defaultdict(list) asan_lines = [] - for asan_log_line in [a.strip() for a in input]: + for asan_log_line in [a.rstrip() for a in input]: m = _ParseAsanLogLine(asan_log_line) if m: libraries[m['library']].append(m) @@ -81,7 +82,7 @@ def _Symbolize(input): if (m['library'] in all_symbols and m['rel_address'] in all_symbols[m['library']]['symbols']): s = all_symbols[m['library']]['symbols'][m['rel_address']][0] - print s[0], s[1], s[2] + print '%s%s %s %s' %(m['prefix'], m['pos'], s[0], s[1]) else: print asan_log_line['raw_log'] diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py index 2afb723849..7b656013f2 100755 --- a/build/android/buildbot/bb_device_status_check.py +++ b/build/android/buildbot/bb_device_status_check.py @@ -225,7 +225,7 @@ def RestartUsb(): if not os.path.isfile('/usr/bin/restart_usb'): print ('ERROR: Could not restart usb. /usr/bin/restart_usb not installed ' 'on host (see BUG=305769).') - return 1 + return False lsusb_proc = bb_utils.SpawnCmd(['lsusb'], stdout=subprocess.PIPE) lsusb_output, _ = lsusb_proc.communicate() @@ -236,7 +236,7 @@ def RestartUsb(): usb_devices = [re.findall('Bus (\d\d\d) Device (\d\d\d)', lsusb_line)[0] for lsusb_line in lsusb_output.strip().split('\n')] - failed_restart = False + all_restarted = True # Walk USB devices from leaves up (i.e reverse sorted) restarting the # connection. If a parent node (e.g. usb hub) is restarted before the # devices connected to it, the (bus, dev) for the hub can change, making the @@ -247,14 +247,11 @@ def RestartUsb(): return_code = bb_utils.RunCmd(['/usr/bin/restart_usb', bus, dev]) if return_code: print 'Error restarting USB device /dev/bus/usb/%s/%s' % (bus, dev) - failed_restart = True + all_restarted = False else: print 'Restarted USB device /dev/bus/usb/%s/%s' % (bus, dev) - if failed_restart: - return 1 - - return 0 + return all_restarted def KillAllAdb(): @@ -299,16 +296,24 @@ def main(): if options.restart_usb: expected_devices = GetLastDevices(os.path.abspath(options.out_dir)) devices = android_commands.GetAttachedDevices() - # Only restart usb if devices are missing + # Only restart usb if devices are missing. if set(expected_devices) != set(devices): KillAllAdb() - if RestartUsb(): - return 1 retries = 5 + usb_restarted = True + if not RestartUsb(): + usb_restarted = False + bb_annotations.PrintWarning() + print 'USB reset stage failed, wait for any device to come back.' while retries: time.sleep(1) devices = android_commands.GetAttachedDevices() if set(expected_devices) == set(devices): + # All devices are online, keep going. + break + if not usb_restarted and devices: + # The USB wasn't restarted, but there's at least one device online. + # No point in trying to wait for all devices. break retries -= 1 diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py index a915c5ffaf..84a668de50 100755 --- a/build/android/buildbot/bb_device_steps.py +++ b/build/android/buildbot/bb_device_steps.py @@ -402,7 +402,7 @@ def ProvisionDevices(options): adb.RestartAdbServer() RunCmd(['sleep', '1']) - if options.reboot: + if not options.no_reboot: RebootDevices() provision_cmd = ['build/android/provision_devices.py', '-t', options.target] if options.auto_reconnect: @@ -435,7 +435,7 @@ def RunInstrumentationTests(options): def RunWebkitTests(options): - RunTestSuites(options, ['webkit_unit_tests']) + RunTestSuites(options, ['webkit_unit_tests', 'blink_heap_unittests']) RunWebkitLint(options.target) @@ -451,8 +451,21 @@ def RunGPUTests(options): InstallApk(options, INSTRUMENTATION_TESTS['ContentShell'], False) bb_annotations.PrintNamedStep('gpu_tests') + revision = _GetRevision(options) RunCmd(['content/test/gpu/run_gpu_test', - '--browser=android-content-shell', 'pixel']) + 'pixel', + '--browser', + 'android-content-shell', + '--build-revision', + str(revision), + '--upload-refimg-to-cloud-storage', + '--refimg-cloud-storage-bucket', + 'chromium-gpu-archive/reference-images', + '--os-type', + 'android', + '--test-machine-name', + EscapeBuilderName( + options.build_properties.get('buildername', 'noname'))]) bb_annotations.PrintNamedStep('webgl_conformance_tests') RunCmd(['content/test/gpu/run_gpu_test', @@ -517,6 +530,23 @@ def LogcatDump(options): RunCmd(['cat', logcat_file]) +def RunStackToolSteps(options): + """Run stack tool steps. + + Stack tool is run for logcat dump, optionally for ASAN. + """ + bb_annotations.PrintNamedStep('Run stack tool with logcat dump') + logcat_file = os.path.join(CHROME_OUT_DIR, options.target, 'full_log') + RunCmd([os.path.join(CHROME_SRC_DIR, 'third_party', 'android_platform', + 'development', 'scripts', 'stack'), + '--more-info', logcat_file]) + if options.asan_symbolize: + bb_annotations.PrintNamedStep('Run stack tool for ASAN') + RunCmd([ + os.path.join(CHROME_SRC_DIR, 'build', 'android', 'asan_symbolize.py'), + '-l', logcat_file]) + + def GenerateTestReport(options): bb_annotations.PrintNamedStep('test_report') for report in glob.glob( @@ -545,6 +575,7 @@ def MainTestWrapper(options): coverage_html = GenerateJavaCoverageReport(options) UploadHTML(options, '%s/java' % options.coverage_bucket, coverage_html, 'Coverage Report') + shutil.rmtree(coverage_html, ignore_errors=True) if options.experimental: RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) @@ -552,6 +583,8 @@ def MainTestWrapper(options): finally: # Run all post test steps LogcatDump(options) + if not options.disable_stack_tool: + RunStackToolSteps(options) GenerateTestReport(options) # KillHostHeartbeat() has logic to check if heartbeat process is running, # and kills only if it finds the process is running on the host. @@ -571,8 +604,8 @@ def GetDeviceStepsOptParser(): parser.add_option('--asan', action='store_true', help='Run tests with asan.') parser.add_option('--install', metavar='<apk name>', help='Install an apk by name') - parser.add_option('--reboot', action='store_true', - help='Reboot devices before running tests') + parser.add_option('--no-reboot', action='store_true', + help='Do not reboot devices during provisioning.') parser.add_option('--coverage-bucket', help=('Bucket name to store coverage results. Coverage is ' 'only run if this is set.')) @@ -588,7 +621,10 @@ def GetDeviceStepsOptParser(): parser.add_option( '--logcat-dump-output', help='The logcat dump output will be "tee"-ed into this file') - + parser.add_option('--disable-stack-tool', action='store_true', + help='Do not run stack tool.') + parser.add_option('--asan-symbolize', action='store_true', + help='Run stack tool for ASAN') return parser diff --git a/build/android/buildbot/bb_host_steps.py b/build/android/buildbot/bb_host_steps.py index cf506aea2a..2224bdb5ed 100755 --- a/build/android/buildbot/bb_host_steps.py +++ b/build/android/buildbot/bb_host_steps.py @@ -15,7 +15,6 @@ from pylib import constants SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') VALID_HOST_TESTS = set(['check_webview_licenses', 'findbugs']) -EXPERIMENTAL_TARGETS = ['android_experimental'] DIR_BUILD_ROOT = os.path.dirname(constants.DIR_SOURCE_ROOT) @@ -57,18 +56,11 @@ def Compile(options): '--compiler=goma', '--target=%s' % options.target, '--goma-dir=%s' % bb_utils.GOMA_DIR] - build_targets = options.build_targets.split(',') bb_annotations.PrintNamedStep('compile') - for build_target in build_targets: - RunCmd(cmd + ['--build-args=%s' % build_target], - halt_on_failure=True, - cwd=DIR_BUILD_ROOT) - if options.experimental: - for compile_target in EXPERIMENTAL_TARGETS: - bb_annotations.PrintNamedStep('Experimental Compile %s' % compile_target) - RunCmd(cmd + ['--build-args=%s' % compile_target], - flunk_on_failure=False, - cwd=DIR_BUILD_ROOT) + if options.build_targets: + build_targets = options.build_targets.split(',') + cmd += ['--build-args', ' '.join(build_targets)] + RunCmd(cmd, halt_on_failure=True, cwd=DIR_BUILD_ROOT) def ZipBuild(options): @@ -119,7 +111,7 @@ def GetHostStepCmds(): def GetHostStepsOptParser(): parser = bb_utils.GetParser() parser.add_option('--steps', help='Comma separated list of host tests.') - parser.add_option('--build-targets', default='All', + parser.add_option('--build-targets', default='', help='Comma separated list of build targets.') parser.add_option('--experimental', action='store_true', help='Indicate whether to compile experimental targets.') diff --git a/build/android/buildbot/bb_run_bot.py b/build/android/buildbot/bb_run_bot.py index d26e26279f..833e3b769d 100755 --- a/build/android/buildbot/bb_run_bot.py +++ b/build/android/buildbot/bb_run_bot.py @@ -48,7 +48,6 @@ def DictDiff(d1, d2): def GetEnvironment(host_obj, testing, extra_env_vars=None): init_env = dict(os.environ) init_env['GYP_GENERATORS'] = 'ninja' - init_env['GOMA_DIR'] = bb_utils.GOMA_DIR if extra_env_vars: init_env.update(extra_env_vars) envsetup_cmd = '. build/android/envsetup.sh' @@ -70,7 +69,8 @@ def GetEnvironment(host_obj, testing, extra_env_vars=None): print >> sys.stderr, envsetup_output sys.exit(1) env = json.loads(json_env) - env['GYP_DEFINES'] = env.get('GYP_DEFINES', '') + ' fastbuild=1' + env['GYP_DEFINES'] = env.get('GYP_DEFINES', '') + \ + ' fastbuild=1 use_goma=1 gomadir=%s' % bb_utils.GOMA_DIR extra_gyp = host_obj.extra_gyp_defines if extra_gyp: env['GYP_DEFINES'] += ' %s' % extra_gyp @@ -104,7 +104,7 @@ def GetCommands(options, bot_config): test_obj = bot_config.test_obj if test_obj: - run_test_cmd = [test_obj.script, '--reboot'] + property_args + run_test_cmd = [test_obj.script] + property_args for test in test_obj.tests: run_test_cmd.extend(['-f', test]) if test_obj.extra_args: @@ -141,8 +141,9 @@ def GetBotStepMap(): B('main-tests', H(std_test_steps), T(std_tests, [flakiness_server])), # Other waterfalls - B('asan-builder-tests', H(compile_step, extra_gyp='asan=1'), - T(std_tests, ['--asan'])), + B('asan-builder-tests', H(compile_step, + extra_gyp='asan=1 component=shared_library'), + T(std_tests, ['--asan', '--asan-symbolize'])), B('blink-try-builder', H(compile_step)), B('chromedriver-fyi-tests-dbg', H(std_test_steps), T(['chromedriver'], ['--install=ChromiumTestShell'])), @@ -179,7 +180,7 @@ def GetBotStepMap(): extra_gyp='include_tests=1 enable_tracing=1')), B('webrtc-chromium-tests', H(std_test_steps), T(['webrtc_chromium'], - [flakiness_server, '--gtest-filter=Webrtc*:WebRTC*'])), + [flakiness_server, '--gtest-filter=WebRtc*'])), B('webrtc-native-tests', H(std_test_steps), T(['webrtc_native'], [flakiness_server])), diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh index c7ee7570ad..46e3a4eaec 100755 --- a/build/android/envsetup.sh +++ b/build/android/envsetup.sh @@ -34,24 +34,14 @@ if [[ "${ANDROID_SDK_BUILD}" -ne 1 ]]; then echo "Initializing for non-SDK build." fi -# Get host architecture, and abort if it is 32-bit, unless --try-32 -# is also used. +# Get host architecture, and abort if it is 32-bit. host_arch=$(uname -m) case "${host_arch}" in x86_64) # pass ;; i?86) - if [[ -z "${try_32bit_host_build}" ]]; then - echo "ERROR: Android build requires a 64-bit host build machine." - echo "If you really want to try it on this machine, use the \ ---try-32bit-host flag." - echo "Be warned that this may fail horribly at link time, due \ -very large binaries." - return 1 - else - echo "WARNING: 32-bit host build enabled. Here be dragons!" - host_arch=x86 - fi + echo "ERROR: Android build requires a 64-bit host build machine." + return 1 ;; *) echo "ERROR: Unsupported host architecture (${host_arch})." @@ -59,18 +49,6 @@ very large binaries." return 1 esac -case "${host_os}" in - "linux") - toolchain_dir="linux-${host_arch}" - ;; - "mac") - toolchain_dir="darwin-${host_arch}" - ;; - *) - echo "Host platform ${host_os} is not supported" >& 2 - return 1 -esac - CURRENT_DIR="$(readlink -f "${SCRIPT_DIR}/../../")" if [[ -z "${CHROME_SRC}" ]]; then # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. @@ -108,28 +86,9 @@ elif [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then webview_build_init fi -# Workaround for valgrind build -if [[ -n "$CHROME_ANDROID_VALGRIND_BUILD" ]]; then -# arm_thumb=0 is a workaround for https://bugs.kde.org/show_bug.cgi?id=270709 - DEFINES+=" arm_thumb=0 release_extra_cflags='-fno-inline\ - -fno-omit-frame-pointer -fno-builtin' release_valgrind_build=1\ - release_optimize=1" -fi - # Source a bunch of helper functions . ${CHROME_SRC}/build/android/adb_device_functions.sh -if [[ -d $GOMA_DIR ]]; then - num_cores="$(grep --count ^processor /proc/cpuinfo)" -# Goma is IO-ish you want more threads than you have cores. - let "goma_threads=num_cores*2" - if [ -z "${GOMA_COMPILER_PROXY_THREADS}" -a "${goma_threads}" -gt 16 ]; then -# The default is 16 threads, if the machine has many cores we crank it up a bit - GOMA_COMPILER_PROXY_THREADS="${goma_threads}" - export GOMA_COMPILER_PROXY_THREADS - fi -fi - # Declare Android are cross compile. export GYP_CROSSCOMPILE=1 @@ -137,11 +96,7 @@ export GYP_CROSSCOMPILE=1 android_gyp() { # This is just a simple wrapper of gyp_chromium, please don't add anything # in this function. - echo "GYP_GENERATORS set to '$GYP_GENERATORS'" ( "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" ) } - -# FLOCK needs to be null on system that has no flock -which flock > /dev/null || export FLOCK= diff --git a/build/android/envsetup_functions.sh b/build/android/envsetup_functions.sh index bf8abb6f50..eef1350623 100755 --- a/build/android/envsetup_functions.sh +++ b/build/android/envsetup_functions.sh @@ -10,88 +10,22 @@ # prefixed with "common_" that is common for both environment setups. ################################################################################ -# Check to make sure the toolchain exists for the NDK version. -################################################################################ -common_check_toolchain() { - if [[ ! -d "${ANDROID_TOOLCHAIN}" ]]; then - echo "Can not find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2 - echo "The NDK version might be wrong." >& 2 - return 1 - fi -} - -################################################################################ # Exports environment variables common to both sdk and non-sdk build (e.g. PATH) -# based on CHROME_SRC and ANDROID_TOOLCHAIN, along with DEFINES for GYP_DEFINES. +# based on CHROME_SRC, along with DEFINES for GYP_DEFINES. ################################################################################ common_vars_defines() { - # Set toolchain path according to product architecture. - case "${TARGET_ARCH}" in - "arm") - toolchain_arch="arm-linux-androideabi" - ;; - "x86") - toolchain_arch="x86" - ;; - "mips") - toolchain_arch="mipsel-linux-android" - ;; - *) - echo "TARGET_ARCH: ${TARGET_ARCH} is not supported." >& 2 - print_usage - return 1 - ;; - esac - - toolchain_version="4.6" - # We directly set the gcc_version since we know what we use, and it should - # be set to xx instead of x.x. Refer the output of compiler_version.py. - gcc_version="46" - toolchain_target=$(basename \ - ${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}-${toolchain_version}) - toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_target}"\ -"/prebuilt/${toolchain_dir}/bin/" - - # Set only if not already set. - # Don't override ANDROID_TOOLCHAIN if set by Android configuration env. - export ANDROID_TOOLCHAIN=${ANDROID_TOOLCHAIN:-${toolchain_path}} - - common_check_toolchain - - # Add Android SDK/NDK tools to system path. - export PATH=$PATH:${ANDROID_NDK_ROOT} + # Add Android SDK tools to system path. export PATH=$PATH:${ANDROID_SDK_ROOT}/tools export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools - export PATH=$PATH:${ANDROID_SDK_ROOT}/build-tools/\ -${ANDROID_SDK_BUILD_TOOLS_VERSION} - - # This must be set before ANDROID_TOOLCHAIN, so that clang could find the - # gold linker. - # TODO(michaelbai): Remove this path once the gold linker become the default - # linker. - export PATH=$PATH:${CHROME_SRC}/build/android/${toolchain_arch}-gold - - # Must have tools like arm-linux-androideabi-gcc on the path for ninja - export PATH=$PATH:${ANDROID_TOOLCHAIN} # Add Chromium Android development scripts to system path. # Must be after CHROME_SRC is set. export PATH=$PATH:${CHROME_SRC}/build/android - # TODO(beverloo): Remove these once all consumers updated to --strip-binary. - export OBJCOPY=$(echo ${ANDROID_TOOLCHAIN}/*-objcopy) - export STRIP=$(echo ${ANDROID_TOOLCHAIN}/*-strip) - - # The set of GYP_DEFINES to pass to gyp. Use 'readlink -e' on directories - # to canonicalize them (remove double '/', remove trailing '/', etc). + # The set of GYP_DEFINES to pass to gyp. DEFINES="OS=android" - DEFINES+=" host_os=${host_os}" - DEFINES+=" gcc_version=${gcc_version}" if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then - DEFINES+=" branding=Chrome" - DEFINES+=" buildtype=Official" - # These defines are used by various chrome build scripts to tag the binary's # version string as 'official' in linux builds (e.g. in # chrome/trunk/src/chrome/tools/build/version.py). @@ -100,32 +34,23 @@ ${ANDROID_SDK_BUILD_TOOLS_VERSION} export CHROME_BUILD_TYPE="_official" fi - # The order file specifies the order of symbols in the .text section of the - # shared library, libchromeview.so. The file is an order list of section - # names and the library is linked with option - # --section-ordering-file=<orderfile>. The order file is updated by profiling - # startup after compiling with the order_profiling=1 GYP_DEFINES flag. - ORDER_DEFINES="order_text_section=${CHROME_SRC}/orderfiles/orderfile.out" + # TODO(thakis), Jan 18 2014: Remove this after two weeks or so, after telling + # everyone to set use_goma in GYP_DEFINES instead of a GOMA_DIR env var. + if [[ -d $GOMA_DIR ]]; then + DEFINES+=" use_goma=1 gomadir=$GOMA_DIR" + fi # The following defines will affect ARM code generation of both C/C++ compiler # and V8 mksnapshot. case "${TARGET_ARCH}" in "arm") - DEFINES+=" ${ORDER_DEFINES}" DEFINES+=" target_arch=arm" ;; "x86") - # TODO(tedbo): The ia32 build fails on ffmpeg, so we disable it here. - DEFINES+=" use_libffmpeg=0" - - host_arch=$(uname -m | sed -e \ - 's/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/') - DEFINES+=" host_arch=${host_arch}" DEFINES+=" target_arch=ia32" ;; "mips") DEFINES+=" target_arch=mipsel" - DEFINES+=" mips_arch_variant=mips32r1" ;; *) echo "TARGET_ARCH: ${TARGET_ARCH} is not supported." >& 2 @@ -136,60 +61,23 @@ ${ANDROID_SDK_BUILD_TOOLS_VERSION} ################################################################################ -# Exports common GYP variables based on variable DEFINES and CHROME_SRC. -################################################################################ -common_gyp_vars() { - export GYP_DEFINES="${DEFINES}" - - # Set GYP_GENERATORS to ninja if it's currently unset or null. - if [ -z "$GYP_GENERATORS" ]; then - echo "Defaulting GYP_GENERATORS to ninja." - GYP_GENERATORS=ninja - elif [ "$GYP_GENERATORS" != "ninja" ]; then - echo "Warning: GYP_GENERATORS set to '$GYP_GENERATORS'." - echo "Only GYP_GENERATORS=ninja has continuous coverage." - fi - export GYP_GENERATORS - - # Use our All target as the default - export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" - - # We want to use our version of "all" targets. - export CHROMIUM_GYP_FILE="${CHROME_SRC}/build/all_android.gyp" -} - - -################################################################################ # Prints out help message on usage. ################################################################################ print_usage() { echo "usage: ${0##*/} [--target-arch=value] [--help]" >& 2 echo "--target-arch=value target CPU architecture (arm=default, x86)" >& 2 - echo "--host-os=value override host OS detection (linux, mac)" >&2 - echo "--try-32bit-host try building a 32-bit host architecture" >&2 echo "--help this help" >& 2 } ################################################################################ # Process command line options. -# --target-arch= Specifices target CPU architecture. Currently supported -# architectures are "arm" (default), and "x86". -# --help Prints out help message. ################################################################################ process_options() { - host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') - try_32bit_host_build= while [[ -n $1 ]]; do case "$1" in --target-arch=*) target_arch="$(echo "$1" | sed 's/^[^=]*=//')" ;; - --host-os=*) - host_os="$(echo "$1" | sed 's/^[^=]*=//')" - ;; - --try-32bit-host) - try_32bit_host_build=true - ;; --help) print_usage return 1 @@ -207,56 +95,22 @@ process_options() { } ################################################################################ -# Initializes environment variables for NDK/SDK build. Only Android NDK Revision -# 7 on Linux or Mac is offically supported. To run this script, the system -# environment ANDROID_NDK_ROOT must be set to Android NDK's root path. The -# ANDROID_SDK_ROOT only needs to be set to override the default SDK which is in -# the tree under $ROOT/src/third_party/android_tools/sdk. -# To build Chromium for Android with NDK/SDK follow the steps below: -# > export ANDROID_NDK_ROOT=<android ndk root> -# > export ANDROID_SDK_ROOT=<android sdk root> # to override the default sdk -# > . build/android/envsetup.sh -# > make +# Initializes environment variables for NDK/SDK build. ################################################################################ sdk_build_init() { - # Allow the caller to override a few environment variables. If any of them is # unset, we default to a sane value that's known to work. This allows for # experimentation with a custom SDK. - local sdk_defines="" if [[ -z "${ANDROID_NDK_ROOT}" || ! -d "${ANDROID_NDK_ROOT}" ]]; then export ANDROID_NDK_ROOT="${CHROME_SRC}/third_party/android_tools/ndk/" fi - if [[ -z "${ANDROID_SDK_VERSION}" ]]; then - export ANDROID_SDK_VERSION=19 - else - sdk_defines+=" android_sdk_version=${ANDROID_SDK_VERSION}" - fi - local sdk_suffix=platforms/android-${ANDROID_SDK_VERSION} - if [[ -z "${ANDROID_SDK_ROOT}" || \ - ! -d "${ANDROID_SDK_ROOT}/${sdk_suffix}" ]]; then + if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" - else - sdk_defines+=" android_sdk_root=${ANDROID_SDK_ROOT}" fi - if [[ -z "${ANDROID_SDK_BUILD_TOOLS_VERSION}" ]]; then - export ANDROID_SDK_BUILD_TOOLS_VERSION=19.0.0 - fi - - unset ANDROID_BUILD_TOP - - # Set default target. - export TARGET_PRODUCT="${TARGET_PRODUCT:-trygon}" - - # Unset toolchain so that it can be set based on TARGET_PRODUCT. - # This makes it easy to switch between architectures. - unset ANDROID_TOOLCHAIN common_vars_defines - DEFINES+="${sdk_defines}" - - common_gyp_vars + export GYP_DEFINES="${DEFINES}" if [[ -n "$CHROME_ANDROID_BUILD_WEBVIEW" ]]; then # Can not build WebView with NDK/SDK because it needs the Android build @@ -266,26 +120,19 @@ sdk_build_init() { echo "Try . build/android/envsetup.sh instead." >& 2 return 1 fi - - # Directory containing build-tools: aapt, aidl, dx - export ANDROID_SDK_TOOLS="${ANDROID_SDK_ROOT}/build-tools/\ -${ANDROID_SDK_BUILD_TOOLS_VERSION}" } ################################################################################ # To build WebView, we use the Android build system and build inside an Android -# source tree. This method is called from non_sdk_build_init() and adds to the -# settings specified there. +# source tree. ############################################################################# webview_build_init() { # Use the latest API in the AOSP prebuilts directory (change with AOSP roll). - export ANDROID_SDK_VERSION=18 + android_sdk_version=18 - # For the WebView build we always use the NDK and SDK in the Android tree, - # and we don't touch ANDROID_TOOLCHAIN which is already set by Android. - export ANDROID_NDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/ndk/8 + # For the WebView build we always use the SDK in the Android tree. export ANDROID_SDK_ROOT=${ANDROID_BUILD_TOP}/prebuilts/sdk/\ -${ANDROID_SDK_VERSION} +${android_sdk_version} common_vars_defines @@ -295,39 +142,22 @@ ${ANDROID_SDK_VERSION} ANDROID_SDK=$(python -c \ "import os.path; print os.path.relpath('${ANDROID_SDK_ROOT}', \ '${ANDROID_BUILD_TOP}')") - case "${host_os}" in - "linux") - ANDROID_SDK_TOOLS=$(python -c \ - "import os.path; \ - print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/linux', \ - '${ANDROID_BUILD_TOP}')") - ;; - "mac") - ANDROID_SDK_TOOLS=$(python -c \ - "import os.path; \ - print os.path.relpath('${ANDROID_SDK_ROOT}/../tools/darwin', \ - '${ANDROID_BUILD_TOP}')") - ;; - esac + ANDROID_SDK_TOOLS=$(python -c \ + "import os.path, sys; \ + print os.path.relpath( \ + '${ANDROID_SDK_ROOT}/../tools/' + sys.platform.rstrip('23'), \ + '${ANDROID_BUILD_TOP}')") DEFINES+=" android_webview_build=1" DEFINES+=" android_src=\$(PWD)" + DEFINES+=" android_ndk_root=ndk_root_unused_in_webview_build" DEFINES+=" android_sdk=\$(PWD)/${ANDROID_SDK}" DEFINES+=" android_sdk_root=\$(PWD)/${ANDROID_SDK}" DEFINES+=" android_sdk_tools=\$(PWD)/${ANDROID_SDK_TOOLS}" - DEFINES+=" android_sdk_version=${ANDROID_SDK_VERSION}" + DEFINES+=" android_sdk_version=sdk_version_unused_in_webview_build" DEFINES+=" android_toolchain=${ANDROID_TOOLCHAIN}" - if [[ -n "$CHROME_ANDROID_WEBVIEW_ENABLE_DMPROF" ]]; then - DEFINES+=" disable_debugallocation=1" - DEFINES+=" android_full_debug=1" - DEFINES+=" android_use_tcmalloc=1" + if [[ -n "$CHROME_ANDROID_WEBVIEW_OFFICIAL_BUILD" ]]; then + DEFINES+=" logging_like_official_build=1" + DEFINES+=" tracing_like_official_build=1" fi export GYP_DEFINES="${DEFINES}" - - export GYP_GENERATORS="android" - - export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} default_target=All" - export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} limit_to_target_all=1" - export GYP_GENERATOR_FLAGS="${GYP_GENERATOR_FLAGS} auto_regeneration=0" - - export CHROMIUM_GYP_FILE="${CHROME_SRC}/android_webview/all_webview.gyp" } diff --git a/build/android/findbugs_filter/findbugs_exclude.xml b/build/android/findbugs_filter/findbugs_exclude.xml index f300db1aa6..2dc7f539f2 100644 --- a/build/android/findbugs_filter/findbugs_exclude.xml +++ b/build/android/findbugs_filter/findbugs_exclude.xml @@ -19,7 +19,7 @@ In particular, ~ at the start of a string means it's a regex. </Match> <!-- Ignore bugs in NativeLibraries.java (the auto-generation confuses findbugs). --> <Match> - <Class name="~org\.chromium\.content\..*\.NativeLibraries.*?" /> + <Class name="~org\.chromium\.base\..*\.NativeLibraries.*?" /> </Match> <!-- Ignore bugs in CleanupReferenceTest.java (redundant null check) diff --git a/build/android/findbugs_filter/findbugs_known_bugs.txt b/build/android/findbugs_filter/findbugs_known_bugs.txt index 79b618b9e4..83cc380279 100644 --- a/build/android/findbugs_filter/findbugs_known_bugs.txt +++ b/build/android/findbugs_filter/findbugs_known_bugs.txt @@ -1,7 +1,6 @@ H C EC: Using pointer equality to compare a JavaBridgeCoercionTest$CustomType with a JavaBridgeCoercionTest$CustomType2 in org.chromium.content.browser.JavaBridgeCoercionTest.testPassJavaObject() At JavaBridgeCoercionTest.java -M B Nm: The method name org.chromium.base.test.util.ScalableTimeout.ScaleTimeout(long) doesn't start with a lower case letter At ScalableTimeout.java -M B RV: exceptional return value of java.io.File.delete() ignored in org.chromium.base.test.util.TestFileUtil.deleteFile(String) At TestFileUtil.java -M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At HttpAuthDatabase.java +H P Bx: Boxing/unboxing to parse a primitive org.chromium.content.browser.ViewportTest.evaluateIntegerValue(String) At ViewportTest.java +M B RV: Exceptional return value of java.io.File.delete() ignored in org.chromium.base.test.util.TestFileUtil.deleteFile(String) At TestFileUtil.java M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At JavaBridgeArrayCoercionTest.java M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At JavaBridgeArrayTest.java M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At JavaBridgeBasicsTest.java @@ -14,10 +13,7 @@ M C CSM: Shouldn't use synchronized method, please narrow down the synchronizati M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At SimpleSynchronizedMethod.java M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At SimpleSynchronizedStaticMethod.java M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At TraceEvent.java -M C CST: Shouldn't use synchronized(this), please narrow down the synchronization scope. At HttpAuthDatabase.java M C CST: Shouldn't use synchronized(this), please narrow down the synchronization scope. At SimpleSynchronizedThis.java -M C RCN: Nullcheck of GestureDetector.mVelocityTracker at line 639 of value previously dereferenced in org.chromium.content.browser.third_party.GestureDetector.onTouchEvent(MotionEvent) At GestureDetector.java -M C USELESS_STRING: Invocation of toString on certChain in org.chromium.net.X509Util.verifyServerCertificates(byte[][], String) At X509Util.java M D DMI: Hard coded reference to an absolute pathname in org.chromium.android_webview.test.ArchiveTest.testAutoBadPath() At ArchiveTest.java M D DMI: Hard coded reference to an absolute pathname in org.chromium.android_webview.test.ArchiveTest.testExplicitBadPath() At ArchiveTest.java M D SF: Switch statement found in org.chromium.chrome.browser.ChromeBrowserProvider.insert(Uri, ContentValues) where one case falls through to the next case At ChromeBrowserProvider.java @@ -25,20 +21,20 @@ M D SF: Switch statement found in org.chromium.chrome.browser.database.SQLiteCur M D SF: Switch statement found in org.chromium.content.browser.third_party.GestureDetector.onTouchEvent(MotionEvent) where default case is missing At GestureDetector.java M M UG: org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.getBooleanValue() is unsynchronized, org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.setBooleanValue(boolean) is synchronized At JavaBridgeReturnValuesTest.java M M UG: org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.getStringValue() is unsynchronized, org.chromium.content.browser.JavaBridgeReturnValuesTest$TestObject.setStringValue(String) is synchronized At JavaBridgeReturnValuesTest.java -M M UW: Unconditional wait in org.chromium.media.AudioManagerAndroid.init() At AudioManagerAndroid.java -M M Wa: Wait not in loop in org.chromium.media.AudioManagerAndroid.init() At AudioManagerAndroid.java M V EI2: new org.chromium.chrome.browser.FindMatchRectsDetails(int, RectF[], RectF) may expose internal representation by storing an externally mutable object into FindMatchRectsDetails.rects At FindMatchRectsDetails.java M V EI2: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.setFavicon(byte[]) may expose internal representation by storing an externally mutable object into ChromeBrowserProvider$BookmarkNode.mFavicon At ChromeBrowserProvider.java M V EI2: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.setThumbnail(byte[]) may expose internal representation by storing an externally mutable object into ChromeBrowserProvider$BookmarkNode.mThumbnail At ChromeBrowserProvider.java M V EI2: org.chromium.content.browser.LoadUrlParams.setPostData(byte[]) may expose internal representation by storing an externally mutable object into LoadUrlParams.mPostData At LoadUrlParams.java M V EI: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.favicon() may expose internal representation by returning ChromeBrowserProvider$BookmarkNode.mFavicon At ChromeBrowserProvider.java M V EI: org.chromium.chrome.browser.ChromeBrowserProvider$BookmarkNode.thumbnail() may expose internal representation by returning ChromeBrowserProvider$BookmarkNode.mThumbnail At ChromeBrowserProvider.java -M V MS: org.chromium.android_webview.AwResource.RAW_LOAD_ERROR isn't final and can't be protected from malicious code In AwResource.java -M V MS: org.chromium.android_webview.AwResource.RAW_NO_DOMAIN isn't final and can't be protected from malicious code In AwResource.java -M V MS: org.chromium.android_webview.AwResource.STRING_DEFAULT_TEXT_ENCODING isn't final and can't be protected from malicious code In AwResource.java M V MS: org.chromium.content.browser.LoadUrlParams.LOAD_TYPE_BROWSER_INITIATED_HTTP_POST should be package protected In LoadUrlParams.java M V MS: org.chromium.content.browser.LoadUrlParams.LOAD_TYPE_DATA isn't final and can't be protected from malicious code In LoadUrlParams.java M V MS: org.chromium.content.browser.LoadUrlParams.LOAD_TYPE_DEFAULT should be package protected In LoadUrlParams.java M V MS: org.chromium.content.browser.LoadUrlParams.UA_OVERRIDE_INHERIT should be package protected In LoadUrlParams.java M V MS: org.chromium.content.browser.LoadUrlParams.UA_OVERRIDE_TRUE isn't final and can't be protected from malicious code In LoadUrlParams.java M M LI: Incorrect lazy initialization of static field org.chromium.chrome.browser.sync.ProfileSyncService.sSyncSetupManager in org.chromium.chrome.browser.sync.ProfileSyncService.get(Context) At ProfileSyncService.java +M B OS: org.chromium.tools.binary_size.Addr2LineWorkerPool$Addr2LineWorker$Addr2LineTask.run() may fail to close stream At Addr2LineWorkerPool.java +M B RV: Exceptional return value of java.io.File.mkdirs() ignored in new org.chromium.tools.binary_size.NmDumper$Output(NmDumper) At NmDumper.java +M C CSM: Shouldn't use synchronized method, please narrow down the synchronization scope. At NmDumper.java +M D REC: Exception is caught when Exception is not thrown in org.chromium.tools.binary_size.Addr2LineWorkerPool$Addr2LineWorker$Addr2LineTask.run() At Addr2LineWorkerPool.java +M C RCN: Nullcheck of GestureDetector.mVelocityTracker at line 641 of value previously dereferenced in org.chromium.content.browser.third_party.GestureDetector.onTouchEvent(MotionEvent) At GestureDetector.java diff --git a/build/android/gyp/emma_instr.py b/build/android/gyp/emma_instr.py index 86ee177e1d..8d97ed38ae 100755 --- a/build/android/gyp/emma_instr.py +++ b/build/android/gyp/emma_instr.py @@ -152,6 +152,8 @@ def _RunInstrumentCommand(command, options, args, option_parser): options.coverage_file) sources_file = os.path.join(os.path.dirname(options.output_path), options.sources_file) + if os.path.exists(coverage_file): + os.remove(coverage_file) temp_dir = tempfile.mkdtemp() try: cmd = ['java', '-cp', options.emma_jar, diff --git a/build/android/gyp/jar_toc.py b/build/android/gyp/jar_toc.py index c05a42ac20..9baa8e5749 100755 --- a/build/android/gyp/jar_toc.py +++ b/build/android/gyp/jar_toc.py @@ -7,8 +7,10 @@ """Creates a TOC file from a Java jar. The TOC file contains the non-package API of the jar. This includes all -public/protected classes/functions/members and the values of static final -variables. Some other information (major/minor javac version) is also included. +public/protected/package classes/functions/members and the values of static +final variables (members with package access are kept because in some cases we +have multiple libraries with the same package, particularly test+non-test). Some +other information (major/minor javac version) is also included. This TOC file then can be used to determine if a dependent library should be rebuilt when this jar changes. I.e. any change to the jar that would require a @@ -38,7 +40,7 @@ def GetClassesInZipFile(zip_file): def CallJavap(classpath, classes): javap_cmd = [ 'javap', - '-protected', # In reality both public & protected. + '-package', # Show public/protected/package. # -verbose is required to get constant values (which can be inlined in # dependents). '-verbose', diff --git a/build/android/gyp/lint.py b/build/android/gyp/lint.py index 631ceaff53..339d98fd6e 100755 --- a/build/android/gyp/lint.py +++ b/build/android/gyp/lint.py @@ -110,7 +110,8 @@ def _RunLint(lint_path, config_path, processed_config_path, manifest_path, 'lint', 'suppress.py')), _RelativizePath(result_path))) print >> sys.stderr, msg - return 1 + # Lint errors do not fail the build. + return 0 return 0 diff --git a/build/android/install_emulator_deps.py b/build/android/install_emulator_deps.py index ec923dfc8a..fcb0954117 100755 --- a/build/android/install_emulator_deps.py +++ b/build/android/install_emulator_deps.py @@ -38,7 +38,8 @@ X86_IMG_URLS = { 15: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-15_r01.zip', 16: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-16_r01.zip', 17: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-17_r01.zip', - 18: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-18_r01.zip'} + 18: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-18_r01.zip', + 19: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-19_r01.zip'} def CheckSDK(): """Check if SDK is already installed. @@ -94,13 +95,26 @@ def CheckX86Image(api_level=DEFAULT_ANDROID_API_LEVEL): def CheckKVM(): - """Check if KVM is enabled. + """Quickly check whether KVM is enabled. Returns: - True if kvm-ok returns 0 (already enabled) + True iff /dev/kvm exists (Linux only). + """ + return os.path.exists('/dev/kvm') + + +def RunKvmOk(): + """Run kvm-ok as root to check that KVM is properly enabled after installation + of the required packages. + + Returns: + True iff KVM is enabled (/dev/kvm exists). On failure, returns False + but also print detailed information explaining why KVM isn't enabled + (e.g. CPU doesn't support it, or BIOS disabled it). """ try: - return not cmd_helper.RunCmd(['kvm-ok']) + # Note: kvm-ok is in /usr/sbin, so always use 'sudo' to run it. + return not cmd_helper.RunCmd(['sudo', 'kvm-ok']) except OSError: logging.info('kvm-ok not installed') return False @@ -135,11 +149,10 @@ def InstallKVM(): # TODO(navabi): Use modprobe kvm-amd on AMD processors. rc = cmd_helper.RunCmd(['sudo', 'modprobe', 'kvm-intel']) if rc: - logging.critical('ERROR: Did not add KVM module to Linux Kernal. Make sure ' + logging.critical('ERROR: Did not add KVM module to Linux Kernel. Make sure ' 'hardware virtualization is enabled in BIOS.') # Now check to ensure KVM acceleration can be used. - rc = cmd_helper.RunCmd(['kvm-ok']) - if rc: + if not RunKvmOk(): logging.critical('ERROR: Can not use KVM acceleration. Make sure hardware ' 'virtualization is enabled in BIOS (i.e. Intel VT-x or ' 'AMD SVM).') diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml index 3980f9732d..fd6f704939 100644 --- a/build/android/lint/suppressions.xml +++ b/build/android/lint/suppressions.xml @@ -29,8 +29,6 @@ Still reading? </issue> <issue id="DefaultLocale"> <ignore path="PRODUCT_DIR/content_shell_test_apk/classes/org/chromium/content/browser/ViewportTest.class"/> - <ignore path="android_webview/javatests/src/org/chromium/android_webview/test/AwViewportTest.java"/> - <ignore path="android_webview/javatests/src/org/chromium/android_webview/test/LoadUrlTest.java"/> <ignore path="chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java"/> <ignore path="chrome/android/testshell/javatests/src/org/chromium/chrome/testshell/ChromiumTestShellUrlTest.java"/> <ignore path="chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/sync/SyncTestUtil.java"/> @@ -48,7 +46,6 @@ Still reading? <ignore path="AndroidManifest.xml"/> </issue> <issue id="HandlerLeak"> - <ignore path="content/public/android/java/src/org/chromium/content/browser/LongPressDetector.java"/> <ignore path="content/public/android/java/src/org/chromium/content/browser/third_party/GestureDetector.java"/> <ignore path="remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java"/> </issue> @@ -76,8 +73,8 @@ Still reading? <ignore path="AndroidManifest.xml"/> </issue> <issue id="NewApi"> - <ignore path="PRODUCT_DIR/android_webview_apk/classes/org/chromium/android_webview/test/AwTestContainerView.class"/> <ignore path="PRODUCT_DIR/chromium_testshell_test_apk/classes/org/chromium/printing/PrintingControllerTest$6.class"/> + <ignore path="PRODUCT_DIR/chromium_testshell_test_apk/classes/org/chromium/printing/PrintingControllerTest$7.class"/> <ignore path="PRODUCT_DIR/chromium_testshell_test_apk/classes/org/chromium/printing/PrintingControllerTest.class"/> <ignore path="PRODUCT_DIR/content_shell_test_apk/classes/org/chromium/content/browser/ClipboardTest.class"/> <ignore path="android_webview/java/src/org/chromium/android_webview/AwPdfExporter.java"/> @@ -112,26 +109,19 @@ Still reading? <ignore path="ui/android/java/src/org/chromium/ui/ColorPickerAdvancedComponent.java"/> <ignore path="ui/android/java/src/org/chromium/ui/base/Clipboard.java"/> <ignore path="ui/android/java/src/org/chromium/ui/base/LocalizationUtils.java"/> + <ignore path="ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java"/> <ignore path="ui/android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java"/> </issue> <issue id="OldTargetApi"> <ignore path="AndroidManifest.xml"/> </issue> - <issue id="Recycle" severity="Error"> - <ignore path="PRODUCT_DIR/content_shell_test_apk/classes/org/chromium/content/browser/ContentViewGestureHandlerTest.class"/> - <ignore path="android_webview/javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java"/> - <ignore path="android_webview/javatests/src/org/chromium/android_webview/test/util/AwTestTouchUtils.java"/> - <ignore path="chrome/android/javatests/src/org/chromium/chrome/browser/test/ProviderBookmarkNodeTest.java"/> - <ignore path="content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java"/> - <ignore path="content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TouchCommon.java"/> - </issue> + <issue id="Recycle" severity="ignore"/> <issue id="Registered" severity="ignore"/> <issue id="SdCardPath"> <ignore path="content/public/android/java/src/org/chromium/content/browser/MediaResourceGetter.java"/> </issue> <issue id="SetJavaScriptEnabled" severity="ignore"/> <issue id="UseSparseArrays"> - <ignore path="android_webview/java/src/org/chromium/android_webview/AwQuotaManagerBridge.java"/> <ignore path="android_webview/java/src/org/chromium/android_webview/AwResource.java"/> <ignore path="remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java"/> <ignore path="ui/android/java/src/org/chromium/ui/base/WindowAndroid.java"/> diff --git a/build/android/pylib/OWNERS b/build/android/pylib/OWNERS index e463404ccf..30f6a78f3d 100644 --- a/build/android/pylib/OWNERS +++ b/build/android/pylib/OWNERS @@ -1,3 +1,4 @@ bulach@chromium.org craigdh@chromium.org frankf@chromium.org +pliard@chromium.org diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py index 6bb9933655..1099eb0992 100644 --- a/build/android/pylib/android_commands.py +++ b/build/android/pylib/android_commands.py @@ -25,8 +25,6 @@ import constants import screenshot import system_properties -from utils import host_path_finder - try: from pylib import pexpect except: @@ -100,7 +98,8 @@ def GetAttachedDevices(hardware=True, emulator=True, offline=False): Returns: List of devices. """ - adb_devices_output = cmd_helper.GetCmdOutput([constants.ADB_PATH, 'devices']) + adb_devices_output = cmd_helper.GetCmdOutput([constants.GetAdbPath(), + 'devices']) re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE) online_devices = re_device.findall(adb_devices_output) @@ -241,7 +240,7 @@ class AndroidCommands(object): api_strict_mode: A boolean indicating whether fatal errors should be raised if this API is used improperly. """ - adb_dir = os.path.dirname(constants.ADB_PATH) + adb_dir = os.path.dirname(constants.GetAdbPath()) if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep): # Required by third_party/android_testrunner to call directly 'adb'. os.environ['PATH'] += os.pathsep + adb_dir @@ -495,7 +494,7 @@ class AndroidCommands(object): self._adb.SendCommand('wait-for-device') new_adb_pids = self.ExtractPid('adbd') if new_adb_pids == adb_pids: - logging.error('adbd on the device may not have been restarted.') + logging.warning('adbd on the device may not have been restarted.') except Exception as e: logging.error('Exception when trying to kill adbd on the device [%s]', e) @@ -511,11 +510,11 @@ class AndroidCommands(object): def KillAdbServer(self): """Kill adb server.""" - adb_cmd = [constants.ADB_PATH, 'kill-server'] + adb_cmd = [constants.GetAdbPath(), 'kill-server'] ret = cmd_helper.RunCmd(adb_cmd) retry = 0 while retry < 3: - ret = cmd_helper.RunCmd(['pgrep', 'adb']) + ret, _ = cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']) if ret != 0: # pgrep didn't find adb, kill-server succeeded. return 0 @@ -525,11 +524,11 @@ class AndroidCommands(object): def StartAdbServer(self): """Start adb server.""" - adb_cmd = ['taskset', '-c', '0', constants.ADB_PATH, 'start-server'] - ret = cmd_helper.RunCmd(adb_cmd) + adb_cmd = ['taskset', '-c', '0', constants.GetAdbPath(), 'start-server'] + ret, _ = cmd_helper.GetCmdStatusAndOutput(adb_cmd) retry = 0 while retry < 3: - ret = cmd_helper.RunCmd(['pgrep', 'adb']) + ret, _ = cmd_helper.GetCmdStatusAndOutput(['pgrep', 'adb']) if ret == 0: # pgrep found adb, start-server succeeded. # Waiting for device to reconnect before returning success. @@ -642,6 +641,9 @@ class AndroidCommands(object): if "'" in command: logging.warning(command + " contains ' quotes") result = self._adb.SendShellCommand( "'%s'" % command, timeout_time).splitlines() + # TODO(b.kelemen): we should really be able to drop the stderr of the + # command or raise an exception based on what the caller wants. + result = [ l for l in result if not l.startswith('WARNING') ] if ['error: device not found'] == result: raise errors.DeviceUnresponsiveError('device not found') if log_result: @@ -1261,7 +1263,7 @@ class AndroidCommands(object): # Spawn logcat and synchronize with it. for _ in range(4): - self._logcat = pexpect.spawn(constants.ADB_PATH, args, timeout=10, + self._logcat = pexpect.spawn(constants.GetAdbPath(), args, timeout=10, logfile=logfile) if not clear or self.SyncLogCat(): break @@ -1343,7 +1345,7 @@ class AndroidCommands(object): logging.critical('Found EOF in adb logcat. Restarting...') # Rerun spawn with original arguments. Note that self._logcat.args[0] is # the path of adb, so we don't want it in the arguments. - self._logcat = pexpect.spawn(constants.ADB_PATH, + self._logcat = pexpect.spawn(constants.GetAdbPath(), self._logcat.args[1:], timeout=self._logcat.timeout, logfile=self._logcat.logfile) @@ -1501,20 +1503,6 @@ class AndroidCommands(object): logging.warning('Could not find disk IO stats.') return None - def PurgeUnpinnedAshmem(self): - """Purges the unpinned ashmem memory for the whole system. - - This can be used to make memory measurements more stable in particular. - """ - host_path = host_path_finder.GetMostRecentHostPath('purge_ashmem') - if not host_path: - raise Exception('Could not find the purge_ashmem binary.') - device_path = os.path.join(constants.TEST_EXECUTABLE_DIR, 'purge_ashmem') - self.PushIfNeeded(host_path, device_path) - if self.RunShellCommand(device_path, log_result=True): - return - raise Exception('Error while purging ashmem.') - def GetMemoryUsageForPid(self, pid): """Returns the memory usage for given pid. @@ -1757,6 +1745,36 @@ class AndroidCommands(object): 'no test results... device setup correctly?') return test_results[0] + def DismissCrashDialogIfNeeded(self): + """Dismiss the error/ANR dialog if present. + + Returns: Name of the crashed package if a dialog is focused, + None otherwise. + """ + re_focus = re.compile( + r'\s*mCurrentFocus.*Application (Error|Not Responding): (\S+)}') + + def _FindFocusedWindow(): + match = None + for line in self.RunShellCommand('dumpsys window windows'): + match = re.match(re_focus, line) + if match: + break + return match + + match = _FindFocusedWindow() + if not match: + return + package = match.group(2) + logging.warning('Trying to dismiss %s dialog for %s' % match.groups()) + self.SendKeyEvent(KEYCODE_DPAD_RIGHT) + self.SendKeyEvent(KEYCODE_DPAD_RIGHT) + self.SendKeyEvent(KEYCODE_ENTER) + match = _FindFocusedWindow() + if match: + logging.error('Still showing a %s dialog for %s' % match.groups()) + return package + class NewLineNormalizer(object): """A file-like object to normalize EOLs to '\n'. diff --git a/build/android/pylib/base/base_test_result_unittest.py b/build/android/pylib/base/base_test_result_unittest.py index f038b31992..591b8f3868 100644 --- a/build/android/pylib/base/base_test_result_unittest.py +++ b/build/android/pylib/base/base_test_result_unittest.py @@ -6,9 +6,9 @@ import unittest -from base_test_result import BaseTestResult -from base_test_result import TestRunResults -from base_test_result import ResultType +from pylib.base.base_test_result import BaseTestResult +from pylib.base.base_test_result import TestRunResults +from pylib.base.base_test_result import ResultType class TestTestRunResults(unittest.TestCase): diff --git a/build/android/pylib/base/base_test_runner.py b/build/android/pylib/base/base_test_runner.py index 2688a6fbfd..44a457bffe 100644 --- a/build/android/pylib/base/base_test_runner.py +++ b/build/android/pylib/base/base_test_runner.py @@ -4,15 +4,10 @@ """Base class for running tests on a single device.""" -import contextlib -import httplib import logging -import os -import tempfile import time from pylib import android_commands -from pylib import constants from pylib import ports from pylib.chrome_test_server_spawner import SpawningServer from pylib.forwarder import Forwarder @@ -181,7 +176,7 @@ class BaseTestRunner(object): # well as IsHttpServerConnectable(). spawning_server.Start() should also # block until the server is ready. # Try 3 times to launch test spawner server. - for i in xrange(0, 3): + for _ in xrange(0, 3): self.test_server_spawner_port = ports.AllocateTestServerPort() self._ForwardPorts( [(self.test_server_spawner_port, self.test_server_spawner_port)]) diff --git a/build/android/pylib/base/test_dispatcher.py b/build/android/pylib/base/test_dispatcher.py index 11374bbf45..5f68a7ff46 100644 --- a/build/android/pylib/base/test_dispatcher.py +++ b/build/android/pylib/base/test_dispatcher.py @@ -20,11 +20,10 @@ import threading from pylib import android_commands from pylib import constants +from pylib.base import base_test_result from pylib.utils import reraiser_thread from pylib.utils import watchdog_timer -import base_test_result - DEFAULT_TIMEOUT = 7 * 60 # seven minutes @@ -69,7 +68,9 @@ class _TestCollection(object): tests: List of tests to put in the collection. """ - def __init__(self, tests=[]): + def __init__(self, tests=None): + if not tests: + tests = [] self._lock = threading.Lock() self._tests = [] self._tests_in_progress = 0 diff --git a/build/android/pylib/base/test_dispatcher_unittest.py b/build/android/pylib/base/test_dispatcher_unittest.py index c6078dbdfc..1409b5bbc8 100644 --- a/build/android/pylib/base/test_dispatcher_unittest.py +++ b/build/android/pylib/base/test_dispatcher_unittest.py @@ -3,6 +3,8 @@ # found in the LICENSE file. """Unittests for test_dispatcher.py.""" +# pylint: disable=R0201 +# pylint: disable=W0212 import os import sys @@ -15,10 +17,10 @@ sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), from pylib import android_commands android_commands.GetAttachedDevices = lambda: ['0', '1'] from pylib import constants +from pylib.base import base_test_result +from pylib.base import test_dispatcher from pylib.utils import watchdog_timer -import base_test_result -import test_dispatcher class TestException(Exception): @@ -191,7 +193,7 @@ class TestShard(unittest.TestCase): android_commands.GetAttachedDevices = lambda: [] try: with self.assertRaises(AssertionError): - results, exit_code = TestShard._RunShard(MockRunner) + _results, _exit_code = TestShard._RunShard(MockRunner) finally: android_commands.GetAttachedDevices = attached_devices diff --git a/build/android/pylib/constants.py b/build/android/pylib/constants.py index 9ae9878ebd..d3bf734bbb 100644 --- a/build/android/pylib/constants.py +++ b/build/android/pylib/constants.py @@ -5,6 +5,7 @@ """Defines a set of constants shared by test runners and other scripts.""" import collections +import logging import os import subprocess import sys @@ -125,12 +126,17 @@ DEVICE_PERF_OUTPUT_DIR = ( SCREENSHOTS_DIR = os.path.join(DIR_SOURCE_ROOT, 'out_screenshots') ANDROID_SDK_VERSION = 19 +ANDROID_SDK_BUILD_TOOLS_VERSION = '19.0.0' ANDROID_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party/android_tools/sdk') +ANDROID_SDK_TOOLS = os.path.join(ANDROID_SDK_ROOT, + 'build-tools', ANDROID_SDK_BUILD_TOOLS_VERSION) ANDROID_NDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party/android_tools/ndk') -EMULATOR_SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'android_emulator_sdk') +EMULATOR_SDK_ROOT = os.environ.get('ANDROID_EMULATOR_SDK_ROOT', + os.path.join(DIR_SOURCE_ROOT, + 'android_emulator_sdk')) UPSTREAM_FLAKINESS_SERVER = 'test-results.appspot.com' @@ -158,7 +164,18 @@ def GetOutDirectory(build_type=None): GetBuildType() if build_type is None else build_type)) -def _GetADBPath(): +def _Memoize(func): + def Wrapper(): + try: + return func._result + except AttributeError: + func._result = func() + return func._result + return Wrapper + + +@_Memoize +def GetAdbPath(): if os.environ.get('ANDROID_SDK_ROOT'): return 'adb' # If envsetup.sh hasn't been sourced and there's no adb in the path, @@ -168,12 +185,10 @@ def _GetADBPath(): subprocess.call(['adb', 'version'], stdout=devnull, stderr=devnull) return 'adb' except OSError: - print >> sys.stderr, 'No adb found in $PATH, fallback to checked in binary.' + logging.debug('No adb found in $PATH, fallback to checked in binary.') return os.path.join(ANDROID_SDK_ROOT, 'platform-tools', 'adb') -ADB_PATH = _GetADBPath() - # Exit codes ERROR_EXIT_CODE = 1 WARNING_EXIT_CODE = 88 diff --git a/build/android/pylib/flag_changer.py b/build/android/pylib/flag_changer.py index 7e5d091166..898037f3dc 100644 --- a/build/android/pylib/flag_changer.py +++ b/build/android/pylib/flag_changer.py @@ -17,8 +17,7 @@ class FlagChanger(object): once the tests have completed. """ - def __init__(self, adb, - cmdline_file=constants.PACKAGE_INFO['chrome'].cmdline_file): + def __init__(self, adb, cmdline_file): """Initializes the FlagChanger and records the original arguments. Args: diff --git a/build/android/pylib/gtest/filter/blink_heap_unittests_disabled b/build/android/pylib/gtest/filter/blink_heap_unittests_disabled new file mode 100644 index 0000000000..7a43fb1d5b --- /dev/null +++ b/build/android/pylib/gtest/filter/blink_heap_unittests_disabled @@ -0,0 +1,2 @@ +# List of suppressions + diff --git a/build/android/pylib/gtest/filter/content_browsertests_disabled b/build/android/pylib/gtest/filter/content_browsertests_disabled index 4fd78804d3..0ddcc8602b 100644 --- a/build/android/pylib/gtest/filter/content_browsertests_disabled +++ b/build/android/pylib/gtest/filter/content_browsertests_disabled @@ -4,6 +4,7 @@ Http/MediaTest.* File/MediaTest.* WorkerTest.* MediaTest.* +MediaSourceTest.ConfigChangeVideo WebGLConformanceTest.* MessagePortTest.Tests CrossPlatformAccessibilityBrowserTest.* @@ -12,6 +13,8 @@ ResourceDispatcherHostBrowserTest.SyncXMLHttpRequest_DuringUnload # Crashes ResourceDispatcherHostBrowserTest.CrossSiteAfterCrash +RenderFrameHostManagerTest.IgnoreRendererDebugURLsWhenCrashed +RenderFrameHostManagerTest.ProcessExitWithSwappedOutViews # Failures RenderViewHostTest.BaseURLParam @@ -26,6 +29,7 @@ ChildProcessSecurityPolicyInProcessBrowserTest.NoLeak SecurityExploitBrowserTest.SetWebUIProperty # Plugins are not supported. +BrowserPluginThreadedCompositorPixelTest.* BrowserPluginHostTest.* BrowserPluginTest.* PluginTest.* @@ -35,6 +39,10 @@ PluginTest.* DomSerializerTests.* # http://crbug.com/297230 +DumpAccessibilityTreeTest.AccessibilityAriaLevel +DumpAccessibilityTreeTest.AccessibilityAriaProgressbar +DumpAccessibilityTreeTest.AccessibilityListMarkers +DumpAccessibilityTreeTest.AccessibilityUl DumpAccessibilityTreeTest.AccessibilityCanvas RendererAccessibilityTest.DetachAccessibilityObject RendererAccessibilityTest.EditableTextModeFocusEvents @@ -52,9 +60,6 @@ RenderWidgetTest.OnMsgPaintAtSize PasswordFormConversionUtilsTest.ValidWebFormElementToPasswordForm PasswordFormConversionUtilsTest.InvalidWebFormElementToPasswordForm -# Multiple test servers support: http://crbug/187570 -RenderFrameHostManagerTest.* - # http://crbug.com/215894 DownloadContentTest.CancelInterruptedDownload DownloadContentTest.CancelResumingDownload @@ -67,29 +72,32 @@ DownloadContentTest.ResumeInterruptedDownloadBadPrecondition DownloadContentTest.ResumeWithDeletedFile # http://crbug.com/181069 -WebrtcBrowserTest.CanForwardRemoteStream -WebrtcBrowserTest.CanForwardRemoteStream720p -WebrtcBrowserTest.CanSetupVideoCall -WebrtcBrowserTest.CanSetupAudioAndVideoCall -WebrtcBrowserTest.CanSetupAudioAndVideoCallWithoutMsidAndBundle -WebrtcBrowserTest.CanSetupLegacyCall -WebrtcBrowserTest.CallWithDataOnly -WebrtcBrowserTest.CallWithDataAndMedia -WebrtcBrowserTest.CanMakeEmptyCallThenAddStreamsAndRenegotiate -WebrtcBrowserTest.CallWithNewVideoMediaStream -WebrtcBrowserTest.GetAudioAndVideoStreamAndClone -WebrtcBrowserTest.GetAudioAndVideoStreamAndStop -WebrtcBrowserTest.GetVideoStreamAndStop +WebRtcBrowserTest.CanSetupLegacyCall +WebRtcBrowserTest.CallWithDataOnly +WebRtcBrowserTest.CallWithDataAndMedia +WebRtcBrowserTest.CanMakeEmptyCallThenAddStreamsAndRenegotiate WebRTCInternalsBrowserTest.WithRealPeerConnectionCall WebRTCInternalsBrowserTest.NegotiateUnsupportedVideoCodec WebRTCInternalsBrowserTest.NegotiateNonCryptoCall +WebRtcAecDumpBrowserTest.CallWithAecDump +WebRtcBrowserTest.CallAndVerifyVideoMutingWorks +WebRtcBrowserTest.CallWithAecDump +WebRtcBrowserTest.CallWithAecDumpEnabledThenDisabled +WebRtcBrowserTest.CallWithNewVideoMediaStream +WebRtcBrowserTest.CallWithSctpDataAndMedia +WebRtcBrowserTest.CallWithSctpDataOnly +WebRtcBrowserTest.CanForwardRemoteStream +WebRtcBrowserTest.CanForwardRemoteStream720p +WebRtcBrowserTest.CanSetupAudioAndVideoCall +WebRtcBrowserTest.CanSetupAudioAndVideoCallWithoutMsidAndBundle +WebRtcBrowserTest.CanSetupVideoCall +WebRtcBrowserTest.EstablishAudioVideoCallAndMeasureOutputLevel +WebRtcBrowserTest.EstablishAudioVideoCallAndVerifyMutingWorks +WebRtcBrowserTest.NegotiateOfferWithBLine +WebRtcGetUserMediaBrowserTest.TraceVideoCaptureDeviceAndroidPerformanceDuringGetUserMedia # http://crbug.com/175683 -WebrtcBrowserTest.CallWithDataAndLaterAddMedia - -# http://crbug.com/311348 -WebrtcBrowserTest.CallWithSctpDataOnly -WebrtcBrowserTest.CallWithSctpDataAndMedia +WebRtcBrowserTest.CallWithDataAndLaterAddMedia # http://crbug.com/224134 RenderWidgetHostBrowserTest.GetSnapshotFromRendererTest @@ -106,12 +114,6 @@ IndexedDBBrowserTestWithCorruptLevelDB.DestroyTest BookmarkletTest.NonEmptyResult -# http://crbug.com/248796 -ResourceFetcherTests.ResourceFetcher404 -ResourceFetcherTests.ResourceFetcherDeletedInCallback -ResourceFetcherTests.ResourceFetcherTimeout -ResourceFetcherTests.ResourceFetcherDownload - # http://crbug.com/256238 SignalTest.* @@ -120,3 +122,32 @@ BrowserGpuChannelHostFactoryTest.AlreadyEstablished BrowserGpuChannelHostFactoryTest.Basic BrowserGpuChannelHostFactoryTest.CrashAndRecover BrowserGpuChannelHostFactoryTest.EstablishAndTerminate + +# http://crbug.com/338011 +WithInputHandlerProxy/TouchInputBrowserTest.MultiPointTouchPress/0 +WithInputHandlerProxy/TouchInputBrowserTest.TouchHandlerConsume/0 +WithInputHandlerProxy/TouchInputBrowserTest.TouchHandlerNoConsume/0 +WithInputHandlerProxy/TouchInputBrowserTest.TouchNoHandler/0 +WithoutInputHandlerProxy/TouchInputBrowserTest.MultiPointTouchPress/0 +WithoutInputHandlerProxy/TouchInputBrowserTest.TouchHandlerConsume/0 +WithoutInputHandlerProxy/TouchInputBrowserTest.TouchHandlerNoConsume/0 +WithoutInputHandlerProxy/TouchInputBrowserTest.TouchNoHandler/0 + +# http://crbug.com/338408 +TracingControllerTest.EnableCaptureAndDisableMonitoring + +# http://crbug.com/338023 +SecurityExploitBrowserTest.AttemptDuplicateRenderViewHost +SecurityExploitBrowserTest.AttemptDuplicateRenderWidgetHost + +# http://crbug.com/338411 +FrameTreeBrowserTest.NavigateWithLeftoverFrames + +# http://crbug.com/338421 +GinBrowserTest.GinAndGarbageCollection + +# http://crbug.com/341995 +TracingControllerTest.EnableCaptureAndDisableMonitoringWithFilePath + +# http://crbug.com/343604 +MSE_ClearKey/EncryptedMediaTest.ConfigChangeVideo/0 diff --git a/build/android/pylib/gtest/filter/ipc_tests_disabled b/build/android/pylib/gtest/filter/ipc_tests_disabled index fcd5e73463..e8d069113d 100644 --- a/build/android/pylib/gtest/filter/ipc_tests_disabled +++ b/build/android/pylib/gtest/filter/ipc_tests_disabled @@ -9,6 +9,9 @@ IPCFuzzingTest.SanityTest IPCFuzzingTest.MsgBadPayloadArgs IPCFuzzingTest.MsgBadPayloadShort IPCSendFdsTest.DescriptorTest +IPCChannelProxyTest.MessageClassFilters +IPCChannelProxyTest.GlobalAndMessageClassFilters +IPCChannelProxyTest.FilterRemoval IPCChannelTest.ChannelTest IPCChannelTest.ChannelProxyTest IPCChannelTest.SendMessageInChannelConnected diff --git a/build/android/pylib/gtest/filter/net_unittests_disabled b/build/android/pylib/gtest/filter/net_unittests_disabled index 18e4fc9498..da727afc45 100644 --- a/build/android/pylib/gtest/filter/net_unittests_disabled +++ b/build/android/pylib/gtest/filter/net_unittests_disabled @@ -1,9 +1,5 @@ # List of suppressions. -CertVerifyProcTest.PublicKeyHashes -CertVerifyProcTest.VerifyReturnChainBasic -CertVerifyProcTest.VerifyReturnChainFiltersUnrelatedCerts -CertVerifyProcTest.VerifyReturnChainProperlyOrdered # Bug: 171812 MultiThreadedCertVerifierTest.CancelRequest diff --git a/build/android/pylib/gtest/filter/ui_unittests_disabled b/build/android/pylib/gtest/filter/ui_unittests_disabled index a6255630ad..de04dbaaef 100644 --- a/build/android/pylib/gtest/filter/ui_unittests_disabled +++ b/build/android/pylib/gtest/filter/ui_unittests_disabled @@ -3,14 +3,13 @@ CanvasTest.StringSizeEmptyString CanvasTest.StringWidth ClipboardTest.RTFTest +FontListTest.FontDescString_Derive FontListTest.FontDescString_FromFont FontListTest.FontDescString_FromFontNamesStyleAndSize FontListTest.FontDescString_FromFontVector FontListTest.FontDescString_FromFontWithNonNormalStyle -FontListTest.Fonts_DeriveFontList -FontListTest.Fonts_DeriveFontListWithSize -FontListTest.Fonts_DeriveFontListWithSizeDelta -FontListTest.Fonts_DeriveFontListWithSizeDeltaAndStyle +FontListTest.Fonts_Derive +FontListTest.Fonts_DeriveWithSizeDelta FontListTest.Fonts_DescStringWithStyleInFlexibleFormat_RoundTrip FontListTest.Fonts_FontVector_RoundTrip FontListTest.Fonts_FromDescString @@ -22,27 +21,11 @@ FontListTest.Fonts_FromFontWithNonNormalStyle FontListTest.Fonts_GetHeight_GetBaseline FontListTest.Fonts_GetStyle FontTest.Ascent -FontTest.AvgCharWidth FontTest.AvgWidths FontTest.CapHeight FontTest.GetActualFontNameForTesting FontTest.Height FontTest.LoadArial FontTest.LoadArialBold -FontTest.Widths ResourceBundleTest.DelegateGetFontList -TextEliderTest.ElideEmail -TextEliderTest.ElideEmailMoreSpace -TextEliderTest.ElideRectangleText -TextEliderTest.ElideRectangleTextCheckLineWidth -TextEliderTest.ElideRectangleTextLongWords -TextEliderTest.ElideRectangleTextPunctuation -TextEliderTest.ElideTextEllipsis -TextEliderTest.ElideTextLongStrings -TextEliderTest.ElideTextSurrogatePairs -TextEliderTest.ElideTextTruncate -TextEliderTest.TestFileURLEliding -TextEliderTest.TestFilenameEliding -TextEliderTest.TestGeneralEliding -TextEliderTest.TestMoreEliding -TextEliderTest.TestTrailingEllipsisSlashEllipsisHack +TextUtilsTest.GetStringWidth diff --git a/build/android/pylib/gtest/gtest_config.py b/build/android/pylib/gtest/gtest_config.py index c373ed9dd6..21b9872fbf 100644 --- a/build/android/pylib/gtest/gtest_config.py +++ b/build/android/pylib/gtest/gtest_config.py @@ -6,7 +6,7 @@ # Add new suites here before upgrading them to the stable list below. EXPERIMENTAL_TEST_SUITES = [ - 'content_browsertests', + 'content_gl_tests', ] # Do not modify this list without approval of an android owner. @@ -15,22 +15,23 @@ EXPERIMENTAL_TEST_SUITES = [ STABLE_TEST_SUITES = [ 'android_webview_unittests', 'base_unittests', + 'breakpad_unittests', 'cc_unittests', 'components_unittests', + 'content_browsertests', 'content_unittests', 'gl_tests', 'gpu_unittests', 'ipc_tests', 'media_unittests', 'net_unittests', + 'sandbox_linux_unittests', 'sql_unittests', 'sync_unit_tests', 'ui_unittests', 'unit_tests', 'webkit_compositor_bindings_unittests', 'webkit_unit_tests', - 'breakpad_unittests', - 'sandbox_linux_unittests', ] WEBRTC_CHROMIUM_TEST_SUITES = [ @@ -41,7 +42,6 @@ WEBRTC_NATIVE_TEST_SUITES = [ 'audio_decoder_unittests', 'common_audio_unittests', 'common_video_unittests', - 'metrics_unittests', 'modules_tests', 'modules_unittests', 'neteq_unittests', diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py index d85656e0cd..3f2340f88a 100644 --- a/build/android/pylib/gtest/setup.py +++ b/build/android/pylib/gtest/setup.py @@ -3,6 +3,7 @@ # found in the LICENSE file. """Generates test runner factory and tests for GTests.""" +# pylint: disable=W0212 import fnmatch import glob @@ -14,20 +15,20 @@ import sys from pylib import android_commands from pylib import cmd_helper from pylib import constants -from pylib import ports - -import test_package_apk -import test_package_exe -import test_runner +from pylib.gtest import test_package_apk +from pylib.gtest import test_package_exe +from pylib.gtest import test_runner sys.path.insert(0, os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) -import unittest_util +import unittest_util # pylint: disable=F0401 _ISOLATE_FILE_PATHS = { 'base_unittests': 'base/base_unittests.isolate', + 'blink_heap_unittests': + 'third_party/WebKit/Source/heap/BlinkHeapUnitTests.isolate', 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate', 'cc_perftests': 'cc/cc_perftests.isolate', 'components_unittests': 'components/components_unittests.isolate', @@ -48,7 +49,6 @@ _WEBRTC_ISOLATE_FILE_PATHS = { 'modules/audio_coding/neteq4/audio_decoder_unittests.isolate', 'common_audio_unittests': 'common_audio/common_audio_unittests.isolate', 'common_video_unittests': 'common_video/common_video_unittests.isolate', - 'metrics_unittests': 'test/metrics_unittests.isolate', 'modules_tests': 'modules/modules_tests.isolate', 'modules_unittests': 'modules/modules_unittests.isolate', 'neteq_unittests': 'modules/audio_coding/neteq/neteq_unittests.isolate', @@ -62,8 +62,8 @@ _WEBRTC_ISOLATE_FILE_PATHS = { } # Append the WebRTC tests with the full path from Chromium's src/ root. -for test, isolate_path in _WEBRTC_ISOLATE_FILE_PATHS.items(): - _ISOLATE_FILE_PATHS[test] = 'third_party/webrtc/%s' % isolate_path +for webrtc_test, isolate_path in _WEBRTC_ISOLATE_FILE_PATHS.items(): + _ISOLATE_FILE_PATHS[webrtc_test] = 'third_party/webrtc/%s' % isolate_path # Used for filtering large data deps at a finer grain than what's allowed in # isolate files since pushing deps to devices is expensive. @@ -109,14 +109,22 @@ def _GenerateDepsDirUsingIsolate(suite_name): isolated_abs_path = os.path.join( constants.GetOutDirectory(), '%s.isolated' % suite_name) assert os.path.exists(isolate_abs_path) + # This needs to be kept in sync with the cmd line options for isolate.py + # in src/build/isolate.gypi. isolate_cmd = [ 'python', _ISOLATE_SCRIPT, 'remap', '--isolate', isolate_abs_path, '--isolated', isolated_abs_path, - '-V', 'PRODUCT_DIR=%s' % constants.GetOutDirectory(), - '-V', 'OS=android', '--outdir', constants.ISOLATE_DEPS_DIR, + + '--path-variable', 'PRODUCT_DIR', constants.GetOutDirectory(), + + '--config-variable', 'OS', 'android', + '--config-variable', 'chromeos', '0', + '--config-variable', 'component', 'static_library', + '--config-variable', 'icu_use_data_file_flag', '0', + '--config-variable', 'use_openssl', '0', ] assert not cmd_helper.RunCmd(isolate_cmd) @@ -291,7 +299,7 @@ def Setup(test_options, devices): _GenerateDepsDirUsingIsolate(test_options.suite_name) # Constructs a new TestRunner with the current options. - def TestRunnerFactory(device, shard_index): + def TestRunnerFactory(device, _shard_index): return test_runner.TestRunner( test_options, device, diff --git a/build/android/pylib/gtest/test_package.py b/build/android/pylib/gtest/test_package.py index ce07f4fb97..f82d029758 100644 --- a/build/android/pylib/gtest/test_package.py +++ b/build/android/pylib/gtest/test_package.py @@ -3,8 +3,7 @@ # found in the LICENSE file. """Base class representing GTest test packages.""" - -import logging +# pylint: disable=R0201 class TestPackage(object): @@ -43,7 +42,7 @@ class TestPackage(object): """ raise NotImplementedError('Method must be overriden.') - def GetGTestReturnCode(self, adb): + def GetGTestReturnCode(self, _adb): return None def SpawnTestProcess(self, adb): @@ -65,7 +64,8 @@ class TestPackage(object): """ raise NotImplementedError('Method must be overriden.') - def _ParseGTestListTests(self, raw_list): + @staticmethod + def _ParseGTestListTests(raw_list): """Parses a raw test list as provided by --gtest_list_tests. Args: diff --git a/build/android/pylib/gtest/test_package_apk.py b/build/android/pylib/gtest/test_package_apk.py index 5aa473eca4..1d39e4dc4c 100644 --- a/build/android/pylib/gtest/test_package_apk.py +++ b/build/android/pylib/gtest/test_package_apk.py @@ -3,6 +3,7 @@ # found in the LICENSE file. """Defines TestPackageApk to help run APK-based native tests.""" +# pylint: disable=W0212 import logging import os @@ -12,12 +13,10 @@ import tempfile import time from pylib import android_commands -from pylib import cmd_helper from pylib import constants from pylib import pexpect from pylib.android_commands import errors - -from test_package import TestPackage +from pylib.gtest.test_package import TestPackage class TestPackageApk(TestPackage): diff --git a/build/android/pylib/gtest/test_package_exe.py b/build/android/pylib/gtest/test_package_exe.py index 5da86ba4c2..2fc1005d5b 100644 --- a/build/android/pylib/gtest/test_package_exe.py +++ b/build/android/pylib/gtest/test_package_exe.py @@ -6,15 +6,13 @@ import logging import os -import shutil import sys import tempfile from pylib import cmd_helper from pylib import constants from pylib import pexpect - -from test_package import TestPackage +from pylib.gtest.test_package import TestPackage class TestPackageExecutable(TestPackage): @@ -53,7 +51,8 @@ class TestPackageExecutable(TestPackage): ret = 1 return ret - def _AddNativeCoverageExports(self, adb): + @staticmethod + def _AddNativeCoverageExports(adb): # export GCOV_PREFIX set the path for native coverage results # export GCOV_PREFIX_STRIP indicates how many initial directory # names to strip off the hardwired absolute paths. @@ -122,26 +121,19 @@ class TestPackageExecutable(TestPackage): if self.tool.NeedsDebugInfo(): target_name = self.suite_path else: - target_name = self.suite_path + '_' + adb.GetDevice() + '_stripped' - should_strip = True - if os.path.isfile(target_name): - logging.info('Found target file %s' % target_name) - target_mtime = os.stat(target_name).st_mtime - source_mtime = os.stat(self.suite_path).st_mtime - if target_mtime > source_mtime: - logging.info('Target mtime (%d) is newer than source (%d), assuming ' - 'no change.' % (target_mtime, source_mtime)) - should_strip = False - - if should_strip: - logging.info('Did not find up-to-date stripped binary. Generating a ' - 'new one (%s).' % target_name) - # Whenever we generate a stripped binary, copy to the symbols dir. If we - # aren't stripping a new binary, assume it's there. - if not os.path.exists(self._symbols_dir): - os.makedirs(self._symbols_dir) - shutil.copy(self.suite_path, self._symbols_dir) - strip = os.environ['STRIP'] - cmd_helper.RunCmd([strip, self.suite_path, '-o', target_name]) + target_name = self.suite_path + '_stripped' + if not os.path.isfile(target_name): + raise Exception('Did not find %s, build target %s' % + (target_name, self.suite_name + '_stripped')) + + target_mtime = os.stat(target_name).st_mtime + source_mtime = os.stat(self.suite_path).st_mtime + if target_mtime < source_mtime: + raise Exception( + 'stripped binary (%s, timestamp %d) older than ' + 'source binary (%s, timestamp %d), build target %s' % + (target_name, target_mtime, self.suite_path, source_mtime, + self.suite_name + '_stripped')) + test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name adb.PushIfNeeded(target_name, test_binary) diff --git a/build/android/pylib/host_driven/setup.py b/build/android/pylib/host_driven/setup.py index a087bf1484..d48f90862a 100644 --- a/build/android/pylib/host_driven/setup.py +++ b/build/android/pylib/host_driven/setup.py @@ -9,9 +9,9 @@ import os import sys import types -import test_case -import test_info_collection -import test_runner +from pylib.host_driven import test_case +from pylib.host_driven import test_info_collection +from pylib.host_driven import test_runner def _GetPythonFiles(root, files): diff --git a/build/android/pylib/host_driven/test_case.py b/build/android/pylib/host_driven/test_case.py index 8ff94083a3..5824a6642b 100644 --- a/build/android/pylib/host_driven/test_case.py +++ b/build/android/pylib/host_driven/test_case.py @@ -25,7 +25,6 @@ import os import time from pylib import android_commands -from pylib import constants from pylib import forwarder from pylib import valgrind_tools from pylib.base import base_test_result @@ -49,21 +48,28 @@ class HostDrivenTestCase(object): test_name: The name of the method to run as the test. instrumentation_options: An InstrumentationOptions object. """ - self.test_name = test_name class_name = self.__class__.__name__ - self.qualified_name = '%s.%s' % (class_name, self.test_name) + self.adb = None + self.cleanup_test_files = False + self.device_id = '' + self.has_forwarded_ports = False + self.instrumentation_options = instrumentation_options + self.ports_to_forward = [] + self.push_deps = False + self.shard_index = 0 + # Use tagged_name when creating results, so that we can identify host-driven # tests in the overall results. + self.test_name = test_name + self.qualified_name = '%s.%s' % (class_name, self.test_name) self.tagged_name = '%s_%s' % (self._HOST_DRIVEN_TAG, self.qualified_name) - self.instrumentation_options = instrumentation_options - self.ports_to_forward = [] - self.has_forwarded_ports = False - # TODO(bulach): make ports_to_forward not optional and move the Forwarder # mapping here. def SetUp(self, device, shard_index, push_deps, - cleanup_test_files, ports_to_forward=[]): + cleanup_test_files, ports_to_forward=None): + if not ports_to_forward: + ports_to_forward = [] self.device_id = device self.shard_index = shard_index self.adb = android_commands.AndroidCommands(self.device_id) @@ -85,7 +91,8 @@ class HostDrivenTestCase(object): # Get the test method on the derived class and execute it return getattr(self, self.test_name)() - def __GetHostForwarderLog(self): + @staticmethod + def __GetHostForwarderLog(): return ('-- Begin Full HostForwarder log\n' '%s\n' '--End Full HostForwarder log\n' % forwarder.Forwarder.GetHostLog()) @@ -151,7 +158,7 @@ class HostDrivenTestCase(object): start_ms = int(time.time()) * 1000 done = False for test_filter in test_filters: - tests = test_pkg._GetAllMatchingTests(None, None, test_filter) + tests = test_pkg.GetAllMatchingTests(None, None, test_filter) # Filters should always result in >= 1 test. if len(tests) == 0: raise Exception('Java test filter "%s" returned no tests.' diff --git a/build/android/pylib/host_driven/test_info_collection.py b/build/android/pylib/host_driven/test_info_collection.py index a857d3c1cd..b0b76a9819 100644 --- a/build/android/pylib/host_driven/test_info_collection.py +++ b/build/android/pylib/host_driven/test_info_collection.py @@ -7,7 +7,7 @@ import logging import os -import tests_annotations +from pylib.host_driven import tests_annotations class TestInfo(object): @@ -22,7 +22,8 @@ class TestInfo(object): self.set_up = set_up self.tear_down = tear_down - def _GetQualifiedName(self, runnable): + @staticmethod + def _GetQualifiedName(runnable): """Helper method to infer a runnable's name and module name. Many filters and lists presuppose a format of module_name.testMethodName. @@ -102,7 +103,8 @@ class TestInfoCollection(object): return available_tests - def _AnnotationIncludesTest(self, test_info, annotation_filter_list): + @staticmethod + def _AnnotationIncludesTest(test_info, annotation_filter_list): """Checks whether a given test represented by test_info matches annotation. Args: @@ -128,7 +130,8 @@ class TestInfoCollection(object): return True return False - def _NameFilterIncludesTest(self, test_info, name_filter): + @staticmethod + def _NameFilterIncludesTest(test_info, name_filter): """Checks whether a name filter matches a given test_info's method name. This is a case-sensitive, substring comparison: 'Foo' will match methods diff --git a/build/android/pylib/host_driven/test_runner.py b/build/android/pylib/host_driven/test_runner.py index 53fd70f3da..c7d6ed1ba5 100644 --- a/build/android/pylib/host_driven/test_runner.py +++ b/build/android/pylib/host_driven/test_runner.py @@ -11,10 +11,9 @@ import traceback from pylib.base import base_test_result from pylib.base import base_test_runner +from pylib.host_driven import test_case from pylib.instrumentation import test_result -import test_case - class HostDrivenExceptionTestResult(test_result.InstrumentationTestResult): """Test result corresponding to a python exception in a host-driven test.""" diff --git a/build/android/pylib/host_driven/tests_annotations.py b/build/android/pylib/host_driven/tests_annotations.py index d5f557de8e..533114065e 100644 --- a/build/android/pylib/host_driven/tests_annotations.py +++ b/build/android/pylib/host_driven/tests_annotations.py @@ -3,6 +3,7 @@ # found in the LICENSE file. """Annotations for host-driven tests.""" +# pylint: disable=W0212 import os diff --git a/build/android/pylib/instrumentation/json_perf_parser.py b/build/android/pylib/instrumentation/json_perf_parser.py index e5e9d57600..ffdfbe7c54 100644 --- a/build/android/pylib/instrumentation/json_perf_parser.py +++ b/build/android/pylib/instrumentation/json_perf_parser.py @@ -125,7 +125,8 @@ def GetAverageRunInfo(json_data, name): if entry['ph'] == 'I': result['type'] = 'Instant' last_val = val - if result['count'] > 0: result['average'] = total_sum / result['count'] + if result['count'] > 0: + result['average'] = total_sum / result['count'] return result diff --git a/build/android/pylib/instrumentation/setup.py b/build/android/pylib/instrumentation/setup.py index dff7a50e74..dd066fb5d5 100644 --- a/build/android/pylib/instrumentation/setup.py +++ b/build/android/pylib/instrumentation/setup.py @@ -7,8 +7,8 @@ import logging import os -import test_package -import test_runner +from pylib.instrumentation import test_package +from pylib.instrumentation import test_runner def Setup(test_options): @@ -26,7 +26,7 @@ def Setup(test_options): test_pkg = test_package.TestPackage(test_options.test_apk_path, test_options.test_apk_jar_path) - tests = test_pkg._GetAllMatchingTests( + tests = test_pkg.GetAllMatchingTests( test_options.annotations, test_options.exclude_annotations, test_options.test_filter) diff --git a/build/android/pylib/instrumentation/test_jar.py b/build/android/pylib/instrumentation/test_jar.py index 21ce8402b1..9df90fcb7c 100644 --- a/build/android/pylib/instrumentation/test_jar.py +++ b/build/android/pylib/instrumentation/test_jar.py @@ -3,6 +3,7 @@ # found in the LICENSE file. """Helper class for instrumenation test jar.""" +# pylint: disable=W0702 import collections import logging @@ -127,7 +128,8 @@ class TestJar(object): def _GetAnnotationMap(self): return self._annotation_map - def _IsTestMethod(self, test): + @staticmethod + def _IsTestMethod(test): class_name, method = test.split('#') return class_name.endswith('Test') and method.startswith('test') @@ -137,7 +139,8 @@ class TestJar(object): return [] return self._GetAnnotationMap()[test] - def _AnnotationsMatchFilters(self, annotation_filter_list, annotations): + @staticmethod + def _AnnotationsMatchFilters(annotation_filter_list, annotations): """Checks if annotations match any of the filters.""" if not annotation_filter_list: return True @@ -173,7 +176,7 @@ class TestJar(object): tests_missing_annotations.append(test_method) return sorted(tests_missing_annotations) - def _GetAllMatchingTests(self, annotation_filter_list, + def GetAllMatchingTests(self, annotation_filter_list, exclude_annotation_list, test_filter): """Get a list of tests matching any of the annotations and the filter. diff --git a/build/android/pylib/instrumentation/test_package.py b/build/android/pylib/instrumentation/test_package.py index 34f9fe867a..79b2fc9737 100644 --- a/build/android/pylib/instrumentation/test_package.py +++ b/build/android/pylib/instrumentation/test_package.py @@ -6,10 +6,9 @@ import os +from pylib.instrumentation import test_jar from pylib.utils import apk_helper -import test_jar - class TestPackage(test_jar.TestJar): def __init__(self, apk_path, jar_path): diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py index 9c0896455a..6bb77e669e 100644 --- a/build/android/pylib/instrumentation/test_runner.py +++ b/build/android/pylib/instrumentation/test_runner.py @@ -10,12 +10,6 @@ import re import sys import time - -sys.path.append(os.path.join(sys.path[0], - os.pardir, os.pardir, 'build', 'util', 'lib', - 'common')) -import perf_tests_results_helper - from pylib import android_commands from pylib import constants from pylib import flag_changer @@ -23,8 +17,12 @@ from pylib import valgrind_tools from pylib.base import base_test_result from pylib.base import base_test_runner from pylib.instrumentation import json_perf_parser +from pylib.instrumentation import test_result -import test_result +sys.path.append(os.path.join(sys.path[0], + os.pardir, os.pardir, 'build', 'util', 'lib', + 'common')) +import perf_tests_results_helper # pylint: disable=F0401 _PERF_TEST_ANNOTATION = 'PerfTest' @@ -73,19 +71,21 @@ class TestRunner(base_test_runner.BaseTestRunner): test_options.cleanup_test_files) self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index + self.coverage_device_file = None + self.coverage_dir = test_options.coverage_dir + self.coverage_host_file = None self.options = test_options self.test_pkg = test_pkg - self.coverage_dir = test_options.coverage_dir # Use the correct command line file for the package under test. cmdline_file = [a.cmdline_file for a in constants.PACKAGE_INFO.itervalues() if a.test_package == self.test_pkg.GetPackageName()] assert len(cmdline_file) < 2, 'Multiple packages have the same test package' if len(cmdline_file) and cmdline_file[0]: self.flags = flag_changer.FlagChanger(self.adb, cmdline_file[0]) + if additional_flags: + self.flags.AddFlags(additional_flags) else: - self.flags = flag_changer.FlagChanger(self.adb) - if additional_flags: - self.flags.AddFlags(additional_flags) + self.flags = None #override def InstallTestPackage(self): @@ -112,7 +112,7 @@ class TestRunner(base_test_runner.BaseTestRunner): # TODO(frankf): Specify test data in this file as opposed to passing # as command-line. for dest_host_pair in self.options.test_data: - dst_src = dest_host_pair.split(':',1) + dst_src = dest_host_pair.split(':', 1) dst_layer = dst_src[0] host_src = dst_src[1] host_test_files_path = '%s/%s' % (constants.DIR_SOURCE_ROOT, host_src) @@ -152,13 +152,15 @@ class TestRunner(base_test_runner.BaseTestRunner): # We give different default value to launch HTTP server based on shard index # because it may have race condition when multiple processes are trying to # launch lighttpd with same port at same time. - http_server_ports = self.LaunchTestHttpServer( + self.LaunchTestHttpServer( os.path.join(constants.DIR_SOURCE_ROOT), self._lighttp_port) - self.flags.AddFlags(['--disable-fre', '--enable-test-intents']) + if self.flags: + self.flags.AddFlags(['--disable-fre', '--enable-test-intents']) def TearDown(self): """Cleans up the test harness and saves outstanding data from test run.""" - self.flags.Restore() + if self.flags: + self.flags.Restore() super(TestRunner, self).TearDown() def TestSetup(self, test): @@ -330,9 +332,9 @@ class TestRunner(base_test_runner.BaseTestRunner): raw_result = None start_date_ms = None results = base_test_result.TestRunResults() - timeout=(self._GetIndividualTestTimeoutSecs(test) * - self._GetIndividualTestTimeoutScale(test) * - self.tool.GetTimeoutScale()) + timeout = (self._GetIndividualTestTimeoutSecs(test) * + self._GetIndividualTestTimeoutScale(test) * + self.tool.GetTimeoutScale()) try: self.TestSetup(test) start_date_ms = int(time.time()) * 1000 @@ -340,15 +342,18 @@ class TestRunner(base_test_runner.BaseTestRunner): duration_ms = int(time.time()) * 1000 - start_date_ms status_code = raw_result.GetStatusCode() if status_code: + if self.options.screenshot_failures: + self._TakeScreenshot(test) log = raw_result.GetFailureReason() if not log: log = 'No information.' - if (self.options.screenshot_failures or - log.find('INJECT_EVENTS perm') >= 0): - self._TakeScreenshot(test) + result_type = base_test_result.ResultType.FAIL + package = self.adb.DismissCrashDialogIfNeeded() + # Assume test package convention of ".test" suffix + if package and package in self.test_pkg.GetPackageName(): + result_type = base_test_result.ResultType.CRASH result = test_result.InstrumentationTestResult( - test, base_test_result.ResultType.FAIL, start_date_ms, duration_ms, - log=log) + test, result_type, start_date_ms, duration_ms, log=log) else: result = test_result.InstrumentationTestResult( test, base_test_result.ResultType.PASS, start_date_ms, duration_ms) diff --git a/build/android/pylib/linker/test_case.py b/build/android/pylib/linker/test_case.py index b4bddc727c..7a2a010c0f 100644 --- a/build/android/pylib/linker/test_case.py +++ b/build/android/pylib/linker/test_case.py @@ -29,7 +29,7 @@ To build and run the linker tests, do the following: - ninja -C out/Debug content_linker_test_apk + ninja -C out/Debug chromium_linker_test_apk build/android/test_runner.py linker """ @@ -49,13 +49,13 @@ from pylib.base import base_test_result ResultType = base_test_result.ResultType -_PACKAGE_NAME='org.chromium.content_linker_test_apk' -_ACTIVITY_NAME='.ContentLinkerTestActivity' -_COMMAND_LINE_FILE='/data/local/tmp/content-linker-test-command-line' +_PACKAGE_NAME='org.chromium.chromium_linker_test_apk' +_ACTIVITY_NAME='.ChromiumLinkerTestActivity' +_COMMAND_LINE_FILE='/data/local/tmp/chromium-linker-test-command-line' # Path to the Linker.java source file. _LINKER_JAVA_SOURCE_PATH = \ - 'content/public/android/java/src/org/chromium/content/app/Linker.java' + 'base/android/java/src/org/chromium/base/library_loader/Linker.java' # A regular expression used to extract the browser shared RELRO configuration # from the Java source file above. @@ -66,9 +66,9 @@ _RE_LINKER_BROWSER_CONFIG = \ # Logcat filters used during each test. Only the 'chromium' one is really # needed, but the logs are added to the TestResult in case of error, and -# it is handy to have the 'content_android_linker' ones as well when +# it is handy to have the 'chromium_android_linker' ones as well when # troubleshooting. -_LOGCAT_FILTERS = [ '*:s', 'chromium:v', 'content_android_linker:v' ] +_LOGCAT_FILTERS = [ '*:s', 'chromium:v', 'chromium_android_linker:v' ] #_LOGCAT_FILTERS = [ '*:v' ] ## DEBUG # Regular expression used to match status lines in logcat. diff --git a/build/android/pylib/linker/test_runner.py b/build/android/pylib/linker/test_runner.py index 3b4ee5cb3d..f64cb257a5 100644 --- a/build/android/pylib/linker/test_runner.py +++ b/build/android/pylib/linker/test_runner.py @@ -19,7 +19,7 @@ import test_case # Name of the Android package to install for this to work. -_PACKAGE_NAME = 'ContentLinkerTest' +_PACKAGE_NAME = 'ChromiumLinkerTest' class LinkerExceptionTestResult(base_test_result.BaseTestResult): diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py index 6f0d39b95f..65ea2617d3 100644 --- a/build/android/pylib/perf/test_runner.py +++ b/build/android/pylib/perf/test_runner.py @@ -81,6 +81,24 @@ def PrintTestOutput(test_name): return persisted_result['exit_code'] +def PrintSummary(test_names): + logging.info('*' * 80) + logging.info('Sharding summary') + total_time = 0 + for test_name in test_names: + file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) + if not os.path.exists(file_name): + logging.info('%s : No status file found', test_name) + continue + with file(file_name, 'r') as f: + result = pickle.loads(f.read()) + logging.info('%s : exit_code=%d in %d secs at %s', + result['name'], result['exit_code'], result['total_time'], + result['device']) + total_time += result['total_time'] + logging.info('Total steps time: %d secs', total_time) + + class _HeartBeatLogger(object): # How often to print the heartbeat on flush(). _PRINT_INTERVAL = 30.0 diff --git a/build/android/pylib/uiautomator/setup.py b/build/android/pylib/uiautomator/setup.py index 3b56239a9e..7a0e4afe3f 100644 --- a/build/android/pylib/uiautomator/setup.py +++ b/build/android/pylib/uiautomator/setup.py @@ -21,9 +21,9 @@ def Setup(test_options): """ test_pkg = test_package.TestPackage(test_options.uiautomator_jar, test_options.uiautomator_info_jar) - tests = test_pkg._GetAllMatchingTests(test_options.annotations, - test_options.exclude_annotations, - test_options.test_filter) + tests = test_pkg.GetAllMatchingTests(test_options.annotations, + test_options.exclude_annotations, + test_options.test_filter) if not tests: logging.error('No uiautomator tests to run with current args.') diff --git a/build/android/pylib/uiautomator/test_runner.py b/build/android/pylib/uiautomator/test_runner.py index edb6dc93de..91676bc404 100644 --- a/build/android/pylib/uiautomator/test_runner.py +++ b/build/android/pylib/uiautomator/test_runner.py @@ -5,6 +5,7 @@ """Class for running uiautomator tests on a single device.""" from pylib import constants +from pylib import flag_changer from pylib.instrumentation import test_options as instr_test_options from pylib.instrumentation import test_runner as instr_test_runner @@ -40,6 +41,10 @@ class TestRunner(instr_test_runner.TestRunner): super(TestRunner, self).__init__(instrumentation_options, device, shard_index, test_pkg) + cmdline_file = constants.PACKAGE_INFO[test_options.package].cmdline_file + self.flags = None + if cmdline_file: + self.flags = flag_changer.FlagChanger(self.adb, cmdline_file) self._package = constants.PACKAGE_INFO[test_options.package].package self._activity = constants.PACKAGE_INFO[test_options.package].activity @@ -54,10 +59,11 @@ class TestRunner(instr_test_runner.TestRunner): #override def _RunTest(self, test, timeout): self.adb.ClearApplicationState(self._package) - if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): - self.flags.RemoveFlags(['--disable-fre']) - else: - self.flags.AddFlags(['--disable-fre']) + if self.flags: + if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): + self.flags.RemoveFlags(['--disable-fre']) + else: + self.flags.AddFlags(['--disable-fre']) self.adb.StartActivity(self._package, self._activity, wait_for_completion=True, diff --git a/build/android/pylib/utils/apk_helper.py b/build/android/pylib/utils/apk_helper.py index fbcc595738..4d8506e2e0 100644 --- a/build/android/pylib/utils/apk_helper.py +++ b/build/android/pylib/utils/apk_helper.py @@ -4,15 +4,18 @@ """Module containing utilities for apk packages.""" +import os.path import re from pylib import cmd_helper +from pylib import constants def GetPackageName(apk_path): """Returns the package name of the apk.""" + aapt = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt') aapt_output = cmd_helper.GetCmdOutput( - ['aapt', 'dump', 'badging', apk_path]).split('\n') + [aapt, 'dump', 'badging', apk_path]).split('\n') package_name_re = re.compile(r'package: .*name=\'(\S*)\'') for line in aapt_output: m = package_name_re.match(line) diff --git a/build/android/pylib/valgrind_tools.py b/build/android/pylib/valgrind_tools.py index c0eff12317..95ae2b9797 100644 --- a/build/android/pylib/valgrind_tools.py +++ b/build/android/pylib/valgrind_tools.py @@ -22,6 +22,7 @@ Call tool.CleanUpEnvironment(). """ import os.path +import subprocess import sys from glob import glob @@ -85,16 +86,14 @@ class BaseTool(object): class AddressSanitizerTool(BaseTool): """AddressSanitizer tool.""" - TMP_DIR = '/data/local/tmp/asan' - WRAPPER_NAME = 'asanwrapper.sh' + WRAPPER_NAME = '/system/bin/asanwrapper' + # Disable memcmp overlap check.There are blobs (gl drivers) + # on some android devices that use memcmp on overlapping regions, + # nothing we can do about that. + EXTRA_OPTIONS = 'strict_memcmp=0' def __init__(self, adb): self._adb = adb - self._wrap_properties = ['wrap.com.google.android.apps.ch', - 'wrap.org.chromium.native_test', - 'wrap.org.chromium.content_shell', - 'wrap.org.chromium.chrome.testsh', - 'wrap.org.chromium.android_webvi'] # Configure AndroidCommands to run utils (such as md5sum_bin) under ASan. # This is required because ASan is a compiler-based tool, and md5sum # includes instrumented code from base. @@ -102,17 +101,14 @@ class AddressSanitizerTool(BaseTool): def CopyFiles(self): """Copies ASan tools to the device.""" - files = (['tools/android/asan/asanwrapper.sh'] + - glob('third_party/llvm-build/Release+Asserts/lib/clang/*/lib/' - 'linux/libclang_rt.asan-arm-android.so')) - for f in files: - self._adb.PushIfNeeded(os.path.join(DIR_SOURCE_ROOT, f), - os.path.join(AddressSanitizerTool.TMP_DIR, - os.path.basename(f))) + subprocess.call([os.path.join(DIR_SOURCE_ROOT, + 'tools/android/asan/asan_device_setup.sh'), + '--device', self._adb.GetDevice(), + '--extra-options', AddressSanitizerTool.EXTRA_OPTIONS]) + self._adb.WaitForDevicePm() def GetTestWrapper(self): - return os.path.join(AddressSanitizerTool.TMP_DIR, - AddressSanitizerTool.WRAPPER_NAME) + return AddressSanitizerTool.WRAPPER_NAME def GetUtilWrapper(self): """Returns the wrapper for utilities, such as forwarder. @@ -124,14 +120,9 @@ class AddressSanitizerTool(BaseTool): def SetupEnvironment(self): self._adb.EnableAdbRoot() - for prop in self._wrap_properties: - self._adb.RunShellCommand('setprop %s "logwrapper %s"' % ( - prop, self.GetTestWrapper())) SetChromeTimeoutScale(self._adb, self.GetTimeoutScale()) def CleanUpEnvironment(self): - for prop in self._wrap_properties: - self._adb.RunShellCommand('setprop %s ""' % (prop,)) SetChromeTimeoutScale(self._adb, None) def GetTimeoutScale(self): @@ -167,6 +158,7 @@ class ValgrindTool(BaseTool): def SetupEnvironment(self): """Sets up device environment.""" self._adb.RunShellCommand('chmod 777 /data/local/tmp') + self._adb.RunShellCommand('setenforce 0') for prop in self._wrap_properties: self._adb.RunShellCommand('setprop %s "logwrapper %s"' % ( prop, self.GetTestWrapper())) diff --git a/build/android/test_runner.py b/build/android/test_runner.py index a87474c054..2221e45b70 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py @@ -539,7 +539,7 @@ def _RunLinkerTests(options, error_func, devices): report_results.LogFull( results=results, test_type='Linker test', - test_package='ContentLinkerTest') + test_package='ChromiumLinkerTest') return exit_code @@ -649,6 +649,8 @@ def _RunPerfTests(options, args, error_func, devices): if perf_options.single_step: return perf_test_runner.PrintTestOutput('single_step') + perf_test_runner.PrintSummary(tests) + # Always return 0 on the sharding stage. Individual tests exit_code # will be returned on the print_step stage. return 0 diff --git a/build/android/tests/multiple_proguards/src/dummy/NativeLibraries.java b/build/android/tests/multiple_proguards/src/dummy/NativeLibraries.java new file mode 100644 index 0000000000..edf71d7d5a --- /dev/null +++ b/build/android/tests/multiple_proguards/src/dummy/NativeLibraries.java @@ -0,0 +1,16 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.base.library_loader; + +/** + * This is a complete dummy, required because base now requires a version of + * NativeLibraries to build, but doesn't include it in its jar file. + */ +public class NativeLibraries { + public static boolean USE_LINKER = false; + public static boolean ENABLE_LINKER_TESTS = false; + static final String[] LIBRARIES = {}; + static String VERSION_NUMBER = ""; +} diff --git a/build/apk_test.gypi b/build/apk_test.gypi index f774831584..8ec23a21fd 100644 --- a/build/apk_test.gypi +++ b/build/apk_test.gypi @@ -31,7 +31,6 @@ 'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk', 'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk', 'java_in_dir': '<(DEPTH)/testing/android/java', - 'android_manifest_path': '<(DEPTH)/testing/android/AndroidManifest.xml', 'native_lib_target': 'lib<(test_suite_name)', # TODO(yfriedman, cjhopman): Support managed installs for gtests. 'gyp_managed_install': 0, diff --git a/build/build_config.h b/build/build_config.h index 143cf3e5b4..2a4837bf14 100644 --- a/build/build_config.h +++ b/build/build_config.h @@ -50,6 +50,8 @@ #elif defined(__sun) #define OS_SOLARIS 1 #define TOOLKIT_GTK +#elif defined(__QNXNTO__) +#define OS_QNX 1 #else #error Please add support for your platform in build/build_config.h #endif @@ -68,7 +70,7 @@ // more specific macro. #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \ defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \ - defined(OS_NACL) + defined(OS_NACL) || defined(OS_QNX) #define OS_POSIX 1 #endif @@ -106,6 +108,11 @@ #define ARCH_CPU_ARMEL 1 #define ARCH_CPU_32_BITS 1 #define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__arm64__) +#define ARCH_CPU_ARM_FAMILY 1 +#define ARCH_CPU_ARM64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 #elif defined(__pnacl__) #define ARCH_CPU_32_BITS 1 #define ARCH_CPU_LITTLE_ENDIAN 1 diff --git a/build/chrome_settings.gypi b/build/chrome_settings.gypi new file mode 100644 index 0000000000..e9c753554d --- /dev/null +++ b/build/chrome_settings.gypi @@ -0,0 +1,30 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file contains settings for ../chrome/chrome.gyp that other gyp files +# also use. +{ + 'variables': { + # TODO: remove this helper when we have loops in GYP + 'apply_locales_cmd': ['python', '<(DEPTH)/build/apply_locales.py'], + + 'conditions': [ + ['OS=="mac"', { + 'conditions': [ + ['branding=="Chrome"', { + 'mac_bundle_id': 'com.google.Chrome', + 'mac_creator': 'rimZ', + # The policy .grd file also needs the bundle id. + 'grit_defines': ['-D', 'mac_bundle_id=com.google.Chrome'], + }, { # else: branding!="Chrome" + 'mac_bundle_id': 'org.chromium.Chromium', + 'mac_creator': 'Cr24', + # The policy .grd file also needs the bundle id. + 'grit_defines': ['-D', 'mac_bundle_id=org.chromium.Chromium'], + }], # branding + ], # conditions + }], # OS=="mac" + ], # conditions + }, # variables +} diff --git a/build/common.gypi b/build/common.gypi index 99b336a99c..1bd4d51e2e 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -56,9 +56,6 @@ # Enable HiDPI support. 'enable_hidpi%': 0, - # Enable touch optimized art assets and metrics. - 'enable_touch_ui%': 0, - # Override buildtype to select the desired build flavor. # Dev - everyday build for development/testing # Official - release build (generally implies additional processing) @@ -84,6 +81,14 @@ 'use_aura%': 1, }], + # ToT Linux should be aura. + # + # TODO(erg): Merge this into the previous block once compiling with + # aura safely implies including ash capabilities. + ['OS=="linux"', { + 'use_aura%': 1, + }], + # Whether we're a traditional desktop unix. ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', { 'desktop_linux%': 1, @@ -95,12 +100,7 @@ ['OS=="win" or OS=="mac" or OS=="ios"', { 'host_arch%': 'ia32', }, { - # This handles the Unix platforms for which there is some support. - # Anything else gets passed through, which probably won't work - # very well; such hosts should pass an explicit target_arch to - # gyp. - 'host_arch%': - '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/i86pc/ia32/")', + 'host_arch%': '<!(python <(DEPTH)/build/linux/detect_host_arch.py)', }], # Embedded implies ozone. @@ -108,10 +108,10 @@ 'use_ozone%': 1, }], - ['OS=="android"', { - 'android_goma_dir%': '<!(echo "${GOMA_DIR}")', + ['embedded==1', { + 'use_system_fontconfig%': 0, }, { - 'android_goma_dir%': '' + 'use_system_fontconfig%': 1, }], ], }, @@ -124,16 +124,17 @@ 'use_ozone%': '<(use_ozone)', 'embedded%': '<(embedded)', 'use_openssl%': '<(use_openssl)', + 'use_system_fontconfig%': '<(use_system_fontconfig)', 'enable_viewport%': '<(enable_viewport)', 'enable_hidpi%': '<(enable_hidpi)', - 'enable_touch_ui%': '<(enable_touch_ui)', 'buildtype%': '<(buildtype)', 'branding%': '<(branding)', 'host_arch%': '<(host_arch)', # Default architecture we're building for is the architecture we're - # building on. + # building on, and possibly sub-architecture (for iOS builds). 'target_arch%': '<(host_arch)', + 'target_subarch%': '', # This is set when building the Android WebView inside the Android # build system, using the 'android' gyp backend. The WebView code is @@ -141,12 +142,12 @@ # build system. 'android_webview_build%': 0, - # Sets whether chrome is built for google tv device. - 'google_tv%': 0, - # Set ARM architecture version. 'arm_version%': 7, + # Use aurax11 for clipboard implementation. This is true on linux_aura. + 'use_clipboard_aurax11%': 0, + # goma settings. # 1 to use goma. # If no gomadir is set, it uses the default gomadir. @@ -185,11 +186,6 @@ 'enable_hidpi%': 1, }], - # Enable touch UI on Metro. - ['OS=="win"', { - 'enable_touch_ui%': 1, - }], - # Enable App Launcher on ChromeOS, Windows and OSX. # On Linux, enable App Launcher for the Aura build. ['use_ash==1 or OS=="win" or OS=="mac" or (desktop_linux==1 and use_aura==1)', { @@ -213,14 +209,21 @@ # Set default gomadir. ['OS=="win"', { 'gomadir': 'c:\\goma\\goma-win', - }], - ['android_goma_dir!=""', { - 'use_goma': 1, - 'gomadir': '<(android_goma_dir)', - }], - ['OS!="win" and android_goma_dir==""', { + }, { 'gomadir': '<!(/bin/echo -n ${HOME}/goma)', }], + + # Set the default "target_subarch" on iOS. Valid values are "arm32", + # "arm64" and "both" (meaning a fat binary). + # + # TODO(sdefresne): change the default from "arm32" to "both" for + # "target_subarch" once http://crbug.com/339477 is fixed. + # + # TODO(sdefresne): set the "target_arch" to "arm" once compilation + # of skia has been fixed for simulator. http://crbug.com/342377 + ['OS=="ios"', { + 'target_subarch%': 'arm32', + }], ], }, @@ -228,6 +231,7 @@ 'chromeos%': '<(chromeos)', 'host_arch%': '<(host_arch)', 'target_arch%': '<(target_arch)', + 'target_subarch%': '<(target_subarch)', 'toolkit_views%': '<(toolkit_views)', 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)', 'desktop_linux%': '<(desktop_linux)', @@ -236,13 +240,13 @@ 'use_cras%': '<(use_cras)', 'use_ozone%': '<(use_ozone)', 'use_ozone_evdev%': '<(use_ozone_evdev)', + 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)', 'embedded%': '<(embedded)', 'use_openssl%': '<(use_openssl)', + 'use_system_fontconfig%': '<(use_system_fontconfig)', 'enable_viewport%': '<(enable_viewport)', 'enable_hidpi%': '<(enable_hidpi)', - 'enable_touch_ui%': '<(enable_touch_ui)', 'android_webview_build%': '<(android_webview_build)', - 'google_tv%': '<(google_tv)', 'use_goma%': '<(use_goma)', 'gomadir%': '<(gomadir)', 'enable_app_list%': '<(enable_app_list)', @@ -269,9 +273,6 @@ # Note: this setting is ignored if buildtype=="Official". 'tracing_like_official_build%': 0, - # Disable file manager component extension by default. - 'file_manager_extension%': 0, - # Disable image loader component extension by default. 'image_loader_extension%': 0, @@ -286,6 +287,7 @@ # The system root for cross-compiles. Default: none. 'sysroot%': '', + 'chroot_cmd%': '', # The system libdir used for this ABI. 'system_libdir%': 'lib', @@ -345,6 +347,13 @@ # -fsanitize=address only works with clang, but asan=1 implies clang=1 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer 'asan%': 0, + # Enable coverage gathering instrumentation in ASan. This flag also + # controls coverage granularity (experimental). + 'asan_coverage%': 0, + + # Enable building with SyzyAsan. + # See https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo + 'syzyasan%': 0, # Enable building with LSan (Clang's -fsanitize=leak option). # -fsanitize=leak only works with clang, but lsan=1 implies clang=1 @@ -361,11 +370,17 @@ # MemorySanitizer only works with clang, but msan=1 implies clang=1 # See http://clang.llvm.org/docs/MemorySanitizer.html 'msan%': 0, + 'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt', # Use the dynamic libraries instrumented by one of the sanitizers # instead of the standard system libraries. 'use_instrumented_libraries%': 0, + # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of + # stdlibc++ as standard library. This is intended to use for instrumented + # builds. + 'use_custom_libcxx%': 0, + # Use a modified version of Clang to intercept allocated types and sizes # for allocated objects. clang_type_profiler=1 implies clang=1. # See http://dev.chromium.org/developers/deep-memory-profiler/cpp-object-type-identifier @@ -496,12 +511,14 @@ 'native_memory_pressure_signals%': 0, 'data_reduction_fallback_host%' : '', + 'data_reduction_dev_host%' : '', 'spdy_proxy_auth_origin%' : '', 'spdy_proxy_auth_property%' : '', 'spdy_proxy_auth_value%' : '', 'data_reduction_proxy_probe_url%' : '', 'enable_mdns%' : 0, 'enable_enhanced_bookmarks%': 0, + 'enable_hangout_services_extension%': 0, 'conditions': [ # A flag for POSIX platforms @@ -518,15 +535,6 @@ 'os_bsd%': 0, }], - # Set armv7 for backward compatibility. - # TODO(mostynb@opera.com): remove armv7 once all uses are - # removed http://crbug.com/234135 - ['arm_version==7', { - 'armv7': 1, - }, { - 'armv7': 0, - }], - # NSS usage. ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', { 'use_nss%': 1, @@ -593,12 +601,10 @@ 'use_titlecase_in_grd_files%': 1, }], - # Enable file manager and image loader extensions on Chrome OS. + # Enable loader extensions on Chrome OS. ['chromeos==1', { - 'file_manager_extension%': 1, 'image_loader_extension%': 1, }, { - 'file_manager_extension%': 0, 'image_loader_extension%': 0, }], @@ -619,6 +625,10 @@ 'native_discardable_memory%': 1, 'native_memory_pressure_signals%': 1, 'enable_printing%': 2, + 'enable_task_manager%':0, + # Set to 1 once we have a notification system for Android. + # http://crbug.com/115320 + 'notifications%': 0, }], # Android OS includes support for proprietary codecs regardless of @@ -630,7 +640,7 @@ 'proprietary_codecs%': 0, }], - ['OS=="mac"', { + ['OS=="mac" or OS=="ios"', { 'native_discardable_memory%': 1, 'native_memory_pressure_signals%': 1, }], @@ -652,7 +662,6 @@ }], ['OS=="ios"', { - 'configuration_policy%': 0, 'disable_ftp_support%': 1, 'enable_automation%': 0, 'enable_extensions%': 0, @@ -666,6 +675,7 @@ 'remoting%': 0, 'safe_browsing%': 0, 'enable_managed_users%': 0, + 'enable_task_manager%': 0, }], # Use GPU accelerated cross process image transport by default @@ -687,7 +697,7 @@ 'enable_plugin_installation%': 1, }], - ['(OS=="android" and google_tv!=1) or OS=="ios" or embedded==1', { + ['OS=="android" or OS=="ios" or embedded==1', { 'enable_plugins%': 0, }, { 'enable_plugins%': 1, @@ -776,12 +786,10 @@ # overriden with GYP_DEFINES. # TODO(maruel): Remove the conditions as more configurations are # supported. - # TODO(csharp): Remove OS!="mac" once xcode can run the isolate code - # again. # NOTE: The check for disable_nacl==0 and component=="static_library" # can't be used here because these variables are not defined yet, but it # is still not supported. - ['OS!="mac" and OS!="ios" and OS!="android" and chromeos==0', { + ['OS!="ios" and OS!="android" and chromeos==0', { 'test_isolation_mode%': 'check', }, { 'test_isolation_mode%': 'noop', @@ -871,6 +879,7 @@ 'branding%': '<(branding)', 'buildtype%': '<(buildtype)', 'target_arch%': '<(target_arch)', + 'target_subarch%': '<(target_subarch)', 'host_arch%': '<(host_arch)', 'toolkit_views%': '<(toolkit_views)', 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)', @@ -888,6 +897,8 @@ 'use_cairo%': '<(use_cairo)', 'use_ozone%': '<(use_ozone)', 'use_ozone_evdev%': '<(use_ozone_evdev)', + 'use_clipboard_aurax11%': '<(use_clipboard_aurax11)', + 'use_system_fontconfig%': '<(use_system_fontconfig)', 'toolkit_uses_gtk%': '<(toolkit_uses_gtk)', 'desktop_linux%': '<(desktop_linux)', 'use_x11%': '<(use_x11)', @@ -896,9 +907,7 @@ 'chromeos%': '<(chromeos)', 'enable_viewport%': '<(enable_viewport)', 'enable_hidpi%': '<(enable_hidpi)', - 'enable_touch_ui%': '<(enable_touch_ui)', 'use_xi2_mt%':'<(use_xi2_mt)', - 'file_manager_extension%': '<(file_manager_extension)', 'image_loader_extension%': '<(image_loader_extension)', 'fastbuild%': '<(fastbuild)', 'dcheck_always_on%': '<(dcheck_always_on)', @@ -906,10 +915,10 @@ 'tracing_like_official_build%': '<(tracing_like_official_build)', 'python_ver%': '<(python_ver)', 'arm_version%': '<(arm_version)', - 'armv7%': '<(armv7)', 'arm_neon%': '<(arm_neon)', 'arm_neon_optional%': '<(arm_neon_optional)', 'sysroot%': '<(sysroot)', + 'chroot_cmd%': '<(chroot_cmd)', 'system_libdir%': '<(system_libdir)', 'component%': '<(component)', 'use_titlecase_in_grd_files%': '<(use_titlecase_in_grd_files)', @@ -925,11 +934,15 @@ 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)', 'mac_want_real_dsym%': '<(mac_want_real_dsym)', 'asan%': '<(asan)', + 'asan_coverage%': '<(asan_coverage)', + 'syzyasan%': '<(syzyasan)', 'lsan%': '<(lsan)', 'msan%': '<(msan)', + 'msan_blacklist%': '<(msan_blacklist)', 'tsan%': '<(tsan)', 'tsan_blacklist%': '<(tsan_blacklist)', 'use_instrumented_libraries%': '<(use_instrumented_libraries)', + 'use_custom_libcxx%': '<(use_custom_libcxx)', 'clang_type_profiler%': '<(clang_type_profiler)', 'order_profiling%': '<(order_profiling)', 'order_text_section%': '<(order_text_section)', @@ -961,7 +974,6 @@ 'android_webview_build%': '<(android_webview_build)', 'gyp_managed_install%': 0, 'create_standalone_apk%': 1, - 'google_tv%': '<(google_tv)', 'enable_app_list%': '<(enable_app_list)', 'use_default_render_theme%': '<(use_default_render_theme)', 'enable_settings_app%': '<(enable_settings_app)', @@ -972,20 +984,19 @@ 'native_discardable_memory%': '<(native_discardable_memory)', 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)', 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)', + 'data_reduction_dev_host%': '<(data_reduction_dev_host)', 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)', 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)', 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)', 'data_reduction_proxy_probe_url%': '<(data_reduction_proxy_probe_url)', 'enable_mdns%' : '<(enable_mdns)', 'enable_enhanced_bookmarks%' : '<(enable_enhanced_bookmarks)', + 'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)', 'v8_optimized_debug%': '<(v8_optimized_debug)', 'proprietary_codecs%': '<(proprietary_codecs)', 'use_goma%': '<(use_goma)', 'gomadir%': '<(gomadir)', - # Use system nspr instead of the bundled one. - 'use_system_nspr%': 0, - # Use system protobuf instead of bundled one. 'use_system_protobuf%': 0, @@ -1084,6 +1095,13 @@ 'clang%': '<(clang)', 'make_clang_dir%': 'third_party/llvm-build/Release+Asserts', + # Control which version of clang to use when 'clang' is set to 1 when + # building for iOS (Apple has not yet open-sourced support for "arm64" + # so when building for that 'target_arch' we have to use clang shipped + # with Xcode that does not supports some flags). + # TODO(sdefresne): remove this once http://crbug.com/341453 is fixed. + 'clang_xcode%': 0, + # These two variables can be set in GYP_DEFINES while running # |gclient runhooks| to let clang run a plugin in every compilation. # Only has an effect if 'clang=1' is in GYP_DEFINES as well. @@ -1093,6 +1111,11 @@ 'clang_load%': '', 'clang_add_plugin%': '', + # Tell ld64 to write map files describing binary layout. Useful + # for looking at what contributes to binary size, e.g. with + # https://github.com/nico/bloat + 'mac_write_linker_maps%': 0, + # The default type of gtest. 'gtest_target_type%': 'executable', @@ -1108,25 +1131,21 @@ 'linux_strip_binary%': 0, # Strip the test binaries needed for Linux reliability tests. 'linux_strip_reliability_tests%': 0, + # If we want stack unwind support for backtrace(). + 'debug_unwind_tables%': 1, + 'release_unwind_tables%': 1, # Enable TCMalloc. 'linux_use_tcmalloc%': 1, 'android_use_tcmalloc%': 0, - # Disable TCMalloc's heapchecker. - 'linux_use_heapchecker%': 0, - - # Disable shadow stack keeping used by heapcheck to unwind the stacks - # better. - 'linux_keep_shadow_stacks%': 0, - # Set to 1 to link against libgnome-keyring instead of using dlopen(). 'linux_link_gnome_keyring%': 0, # Set to 1 to link against gsettings APIs instead of using dlopen(). 'linux_link_gsettings%': 0, # Default arch variant for MIPS. - 'mips_arch_variant%': 'mips32r2', + 'mips_arch_variant%': 'mips32r1', # Enable use of OpenMAX DL FFT routines. 'use_openmax_dl_fft%': '<(use_openmax_dl_fft)', @@ -1148,6 +1167,9 @@ # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 'enable_wexit_time_destructors%': 0, + # Build libpeerconnection as a static library by default. + 'libpeer_target_type%': 'static_library', + # Set to 1 to compile with the built in pdf viewer. 'internal_pdf%': 0, @@ -1197,9 +1219,6 @@ # Disable Dart by default. 'enable_dart%': 0, - # The desired version of Windows SDK can be set in ~/.gyp/include.gypi. - 'msbuild_toolset%': '', - # Native Client is enabled by default. 'disable_nacl%': 0, @@ -1233,6 +1252,9 @@ # Turns on the i18n support in V8. 'v8_enable_i18n_support': 1, + # Compile d8 for the host toolset. + 'v8_toolset_for_d8': 'host', + # Use the chromium skia by default. 'use_system_skia%': '0', @@ -1249,6 +1271,9 @@ # Do not use it by default. 'icu_use_data_file_flag%': 0, + # Force disable libstdc++ debug mode. + 'disable_glibcxx_debug%': 0, + 'conditions': [ # The version of GCC in use, set later in platforms that use GCC and have # not explicitly chosen to build with clang. Currently, this means all @@ -1256,7 +1281,14 @@ # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that # it takes effect here. ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', { - 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)', + 'conditions': [ + ['OS=="android"', { + # We directly set the gcc_version since we know what we use. + 'gcc_version%': 46, + }, { + 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)', + }], + ], }, { 'gcc_version%': 0, }], @@ -1272,13 +1304,9 @@ }], ['OS=="win"', { 'windows_driver_kit_path%': '$(WDK_DIR)', - # Set the python arch to prevent conflicts with pyauto on Win64 build. - # TODO(jschuh): crbug.com/177664 Investigate Win64 pyauto build. - 'python_arch%': 'ia32', + 'icu_use_data_file_flag%': 1, }], ['os_posix==1 and OS!="mac" and OS!="ios"', { - # Figure out the python architecture to decide if we build pyauto. - 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/<(system_libdir)/libpython<(python_ver).so.1.0)', 'conditions': [ ['target_arch=="mipsel"', { 'werror%': '', @@ -1294,13 +1322,25 @@ # symbols from official builds. ['(branding=="Chrome" and buildtype=="Official")', { 'linux_dump_symbols%': 1, + + # Omit unwind support in official release builds to save space. We + # can use breakpad for these builds. + 'release_unwind_tables%': 0, + }], + # TODO(jungshik): Turn this on on Android. + # For ChromeOS, this should be turned on in chromeos-chrome.ebuild + # file as well by adding icu_use_data_file_flag=1 to BUILD_DEFINES. + ['OS!="android"', { + 'icu_use_data_file_flag%': 1, }], ], }], # os_posix==1 and OS!="mac" and OS!="ios" + ['OS=="mac"', { + 'icu_use_data_file_flag%': 1, + }], # os=="mac" ['OS=="ios"', { 'disable_nacl%': 1, 'enable_background%': 0, - 'enable_task_manager%': 0, 'icu_use_data_file_flag%': 1, 'use_system_libxml%': 1, 'use_system_sqlite%': 1, @@ -1351,18 +1391,20 @@ 'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/', 'android_host_arch%': '<!(uname -m)', # Android API-level of the SDK used for compilation. - 'android_sdk_version%': '<!(/bin/echo -n ${ANDROID_SDK_VERSION})', - # Android SDK build tools (e.g. dx, aapt, aidl) - 'android_sdk_tools%': '<!(/bin/echo -n ${ANDROID_SDK_TOOLS})', + 'android_sdk_version%': '19', + 'android_sdk_build_tools_version%': '19.0.0', + 'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')", }, # Copy conditionally-set variables out one scope. 'android_ndk_root%': '<(android_ndk_root)', 'android_sdk_root%': '<(android_sdk_root)', 'android_sdk_version%': '<(android_sdk_version)', - 'android_sdk_tools%': '<(android_sdk_tools)', 'android_stlport_root': '<(android_ndk_root)/sources/cxx-stl/stlport', + 'host_os%': '<(host_os)', 'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)', + # Android SDK build tools (e.g. dx, aapt, aidl) + 'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)', # Android API level 14 is ICS (Android 4.0) which is the minimum # platform requirement for Chrome on Android, we use it for native @@ -1412,6 +1454,7 @@ 'android_stlport_root': '<(android_stlport_root)', 'android_stlport_include': '<(android_stlport_root)/stlport', 'android_stlport_libs_dir': '<(android_stlport_root)/libs/<(android_app_abi)', + 'host_os%': '<(host_os)', # Location of the "strip" binary, used by both gyp and scripts. 'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)', @@ -1429,7 +1472,6 @@ 'use_openssl%': 1, 'proprietary_codecs%': '<(proprietary_codecs)', - 'enable_task_manager%': 0, 'safe_browsing%': 2, 'input_speech%': 0, 'enable_automation%': 0, @@ -1446,10 +1488,6 @@ # Sessions are store separately in the Java side. 'enable_session_service%': 0, - # Set to 1 once we have a notification system for Android. - # http://crbug.com/115320 - 'notifications%': 0, - 'p2p_apis%' : 0, 'gtest_target_type%': 'shared_library', @@ -1577,7 +1615,7 @@ },{ 'msvs_large_module_debug_link_mode%': '2', # Yes }], - ['MSVS_VERSION=="2012e" or MSVS_VERSION=="2010e"', { + ['MSVS_VERSION=="2013e" or MSVS_VERSION=="2012e" or MSVS_VERSION=="2010e"', { 'msvs_express%': 1, 'secure_atl%': 0, },{ @@ -1598,7 +1636,7 @@ 'use_cups%': 0, }], - ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win" or google_tv==1)', { + ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win")', { 'enable_pepper_cdms%': 1, }, { 'enable_pepper_cdms%': 0, @@ -1657,6 +1695,9 @@ ['toolkit_views==1', { 'grit_defines': ['-D', 'toolkit_views'], }], + ['toolkit_uses_gtk==1', { + 'grit_defines': ['-D', 'toolkit_uses_gtk'], + }], ['use_aura==1', { 'grit_defines': ['-D', 'use_aura'], }], @@ -1669,9 +1710,6 @@ ['use_ozone==1', { 'grit_defines': ['-D', 'use_ozone'], }], - ['file_manager_extension==1', { - 'grit_defines': ['-D', 'file_manager_extension'], - }], ['image_loader_extension==1', { 'grit_defines': ['-D', 'image_loader_extension'], }], @@ -1696,11 +1734,6 @@ ['OS=="android"', { 'grit_defines': ['-t', 'android', '-E', 'ANDROID_JAVA_TAGGED_ONLY=true'], - 'conditions': [ - ['google_tv==1', { - 'grit_defines': ['-D', 'google_tv'], - }], - ], }], ['OS=="mac" or OS=="ios"', { 'grit_defines': ['-D', 'scale_factors=2x'], @@ -1717,19 +1750,27 @@ ['"<(GENERATOR)"=="ninja"', { 'clang%': 1, 'host_os%': "mac", - }] + }], + # Apple has not upstreamed the support for "arm64" yet, so when + # building for "arm64" or "both", we need to use the clang that + # is provided with Xcode. + ['target_subarch!="arm32"', { + 'clang_xcode%': 1, + }], ], }], ['enable_extensions==1', { 'grit_defines': ['-D', 'enable_extensions'], }], ['enable_plugins!=0', { - 'grit_defines': ['-D', 'enable_plugins'], }], ['enable_printing!=0', { 'grit_defines': ['-D', 'enable_printing'], }], + ['enable_printing==1', { + 'grit_defines': ['-D', 'enable_full_printing'], + }], ['enable_themes==1', { 'grit_defines': ['-D', 'enable_themes'], }], @@ -1754,13 +1795,27 @@ ['enable_enhanced_bookmarks==1', { 'grit_defines': ['-D', 'enable_enhanced_bookmarks'], }], + ['enable_hangout_services_extension==1', { + 'grit_defines': ['-D', 'enable_hangout_services_extension'], + }], + ['enable_task_manager==1', { + 'grit_defines': ['-D', 'enable_task_manager'], + }], + ['notifications==1', { + 'grit_defines': ['-D', 'enable_notifications'], + }], ['clang_use_chrome_plugins==1 and OS!="win"', { 'clang_chrome_plugins_flags': [ '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)' ], }], + ['asan==1 and OS=="win"', { + # TODO(hans): Remove once users set syzyasan (crbug.com/343960). + 'syzyasan%': 1, + }], ['asan==1 and OS!="win"', { + # TODO(hans): Windows should use Clang-based ASan (crbug.com/343960). 'clang%': 1, }], ['asan==1 and OS=="mac"', { @@ -1857,13 +1912,13 @@ ['arm_version==6 and android_webview_build==0', { 'arm_arch%': 'armv6', 'arm_tune%': '', - 'arm_fpu%': '', - 'arm_float_abi%': 'soft', + 'arm_fpu%': 'vfp', + 'arm_float_abi%': 'softfp', 'arm_thumb%': 0, }], ['arm_version==7 and android_webview_build==0', { 'arm_arch%': 'armv7-a', - 'arm_tune%': 'cortex-a8', + 'arm_tune%': '', 'conditions': [ ['arm_neon==1', { 'arm_fpu%': 'neon', @@ -1901,6 +1956,11 @@ 'ozone_platform_dri%': 0, 'ozone_platform_test%': 0, }], + + ['desktop_linux==1 and use_aura==1 and use_x11==1', { + 'use_clipboard_aurax11%': 1, + }], + ['OS=="win" and use_goma==1', { # goma doesn't support pch yet. 'chromium_win_pch': 0, @@ -1911,13 +1971,26 @@ }], ], }], - ], + ['OS=="win" and clang==1', { + 'chromium_win_pch': 0, + }], - # The path to the ANGLE library. TODO(apatrick): This is to help - # transition to a new version of ANGLE at a new location. After the - # transition is complete, this can be removed. - 'angle_path': '<(DEPTH)/third_party/angle_dx11', + # The seccomp-bpf sandbox is only supported on three architectures + # currently. + # Do not disable seccomp_bpf anywhere without talking to + # security@chromium.org! + ['((OS=="linux" or OS=="android") and ' + '(target_arch=="ia32" or target_arch=="x64" or ' + 'target_arch=="arm"))', { + 'use_seccomp_bpf%': 1, + }, { + 'use_seccomp_bpf%': 0, + }], + ], + + # The path to the ANGLE library. + 'angle_path': '<(DEPTH)/third_party/angle', # List of default apps to install in new profiles. The first list contains # the source files as found in svn. The second list, used only for linux, @@ -2039,13 +2112,12 @@ 'mac_release_optimization%': '3', # Use -O3 unless overridden 'mac_debug_optimization%': '0', # Use -O0 unless overridden }], + ['OS=="android"', { + 'host_os%': '<(host_os)', # See comment above chromium_code. + }], ], }, 'defines': [ - # Set this to use the new DX11 version of ANGLE. - # TODO(apatrick): Remove this when the transition is complete. - 'ANGLE_DX11', - # Don't use deprecated V8 APIs anywhere. 'V8_DEPRECATION_WARNINGS', ], @@ -2072,9 +2144,6 @@ # See http://crbug.com/162818. 'cflags+': ['-Wno-sentinel'], }], - ['OS=="win" and "<(msbuild_toolset)"!=""', { - 'msbuild_toolset': '<(msbuild_toolset)', - }], ['branding=="Chrome"', { 'defines': ['GOOGLE_CHROME_BUILD'], }, { # else: branding!="Chrome" @@ -2133,6 +2202,9 @@ ['use_x11==1', { 'defines': ['USE_X11=1'], }], + ['use_clipboard_aurax11==1', { + 'defines': ['USE_CLIPBOARD_AURAX11=1'], + }], ['enable_one_click_signin==1', { 'defines': ['ENABLE_ONE_CLICK_SIGNIN'], }], @@ -2144,15 +2216,9 @@ ['chromeos==1', { 'defines': ['OS_CHROMEOS=1'], }], - ['google_tv==1', { - 'defines': ['GOOGLE_TV=1'], - }], ['use_xi2_mt!=0 and use_x11==1', { 'defines': ['USE_XI2_MT=<(use_xi2_mt)'], }], - ['file_manager_extension==1', { - 'defines': ['FILE_MANAGER_EXTENSION=1'], - }], ['image_loader_extension==1', { 'defines': ['IMAGE_LOADER_EXTENSION=1'], }], @@ -2195,17 +2261,6 @@ ['use_udev==1', { 'defines': ['USE_UDEV'], }], - ['icu_use_data_file_flag==1', { - 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], - }, { # else icu_use_data_file_flag !=1 - 'conditions': [ - ['OS=="win"', { - 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], - }, { - 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], - }], - ], - }], ['fastbuild!=0', { 'xcode_settings': { 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', @@ -2307,9 +2362,8 @@ 'ENABLE_EGLIMAGE=1', ], }], - ['asan==1 and OS=="win"', { - # Since asan on windows uses Syzygy, we need /PROFILE turned on to - # produce appropriate pdbs. + ['syzyasan==1', { + # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs. 'msvs_settings': { 'VCLinkerTool': { 'Profile': 'true', @@ -2319,7 +2373,7 @@ 'ADDRESS_SANITIZER', 'MEMORY_TOOL_REPLACES_ALLOCATOR', ], - }], # asan==1 and OS=="win" + }], ['OS=="win"', { 'defines': [ '__STD_C', @@ -2347,16 +2401,6 @@ } } }], - ['"<(GENERATOR)"=="msvs"', { - 'msvs_settings': { - 'VCLinkerTool': { - # Make the pdb name sane. Otherwise foo.exe and foo.dll both - # have foo.pdb. The ninja generator already defaults to this and - # can't handle the $(TargetPath) macro. - 'ProgramDatabaseFile': '$(TargetPath).pdb', - } - }, - }], ], # win_z7!=0 }], # OS==win ['enable_task_manager==1', { @@ -2430,6 +2474,10 @@ 'defines': [ 'DATA_REDUCTION_FALLBACK_HOST="<(data_reduction_fallback_host)"'], }], + ['data_reduction_dev_host != ""', { + 'defines': [ + 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'], + }], ['spdy_proxy_auth_origin != ""', { 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'], }], @@ -2449,9 +2497,19 @@ ['enable_enhanced_bookmarks==1', { 'defines': ['ENABLE_ENHANCED_BOOKMARKS=1'], }], + ['enable_hangout_services_extension==1', { + 'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'], + }], ['enable_ipc_fuzzer==1', { 'defines': ['ENABLE_IPC_FUZZER=1'], }], + ['OS=="win" and component=="shared_library"', { + 'dependencies': [ + # All targets in a component build must depend on chrome_redirects, + # to ensure that certain calls go through it. + '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_redirects', + ], + }], ], # conditions for 'target_defaults' 'target_conditions': [ ['enable_wexit_time_destructors==1', { @@ -2527,6 +2585,11 @@ 'VCCLCompilerTool': { 'WarnAsError': 'false' }, } }], + ['clang==1', { + 'msvs_settings': { + 'VCCLCompilerTool': { 'WarnAsError': 'false' }, + } + }], ], }], # TODO(darin): Unfortunately, some third_party code depends on base. @@ -2632,6 +2695,7 @@ 'abstract': 1, 'msvs_settings': { 'VCLinkerTool': { + 'MinimumRequiredVersion': '5.01', # XP. 'TargetMachine': '1', }, 'VCLibrarianTool': { @@ -2737,7 +2801,7 @@ }], ], }], - ['OS=="linux" and target_arch!="ia32"', { + ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', { # Enable libstdc++ debugging facilities to help catch problems # early, see http://crbug.com/65151 . # TODO(phajdan.jr): Should we enable this for all of POSIX? @@ -2834,7 +2898,11 @@ ['win_use_allocator_shim==0', { 'defines': ['NO_TCMALLOC'], }], - ['os_posix==1', { + # _FORTIFY_SOURCE isn't really supported by Clang now, see + # http://llvm.org/bugs/show_bug.cgi?id=16821. + # TODO(glider): once the bug is fixed, disable source fortification + # under the sanitizer tools only. + ['os_posix==1 and (OS!="linux" or clang!=1)', { 'target_conditions': [ ['chromium_code==1', { # Non-chromium code is not guaranteed to compile cleanly @@ -2996,6 +3064,11 @@ '-Wl,--no-as-needed', ], }], + ['debug_unwind_tables==1', { + 'cflags': ['-funwind-tables'], + }, { + 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'], + }], ], }, 'Release_Base': { @@ -3067,13 +3140,10 @@ }], ], }], - # Can be omitted to reduce output size. Does not seem to affect - # crash reporting. - ['target_arch=="ia32"', { - 'cflags': [ - '-fno-unwind-tables', - '-fno-asynchronous-unwind-tables', - ], + ['release_unwind_tables==1', { + 'cflags': ['-funwind-tables'], + }, { + 'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'], }], ], }, @@ -3242,10 +3312,26 @@ '-fuse-ld=gold', '-Wno-psabi', ], + 'cflags': [ + # TODO(hans) Enable integrated-as (crbug.com/124610). + '-no-integrated-as', + '-B<(android_toolchain)', # Else /usr/bin/as gets picked up. + ], + 'ldflags!': [ # Clang does not support the following options. '-fuse-ld=gold', ], + 'ldflags': [ + # As long as -fuse-ld=gold doesn't work, add a dummy directory + # with an 'ld' that redirects to gold, so that clang uses gold. + '-B<(PRODUCT_DIR)/../../build/android/arm-linux-androideabi-gold', + ], + }], + ['asan==1', { + 'cflags': [ + '-marm', # Required for frame pointer based stack traces. + ], }], ], }], @@ -3390,6 +3476,9 @@ '-fno-omit-frame-pointer', '-gline-tables-only', ], + 'cflags!': [ + '-fomit-frame-pointer', + ], 'ldflags!': [ # Functions interposed by the sanitizers can make ld think # that some libraries aren't needed when they actually are, @@ -3400,12 +3489,6 @@ 'MEMORY_TOOL_REPLACES_ALLOCATOR', ], }], - ['_toolset=="target" and OS=="linux"', { - 'ldflags': [ - # http://crbug.com/234010. - '-lrt', - ], - }], ], }], ['asan==1', { @@ -3424,6 +3507,15 @@ }], ], }], + ['asan_coverage!=0', { + 'target_conditions': [ + ['_toolset=="target"', { + 'cflags': [ + '-mllvm -asan-coverage=<(asan_coverage)', + ], + }], + ], + }], ['lsan==1', { 'target_conditions': [ ['_toolset=="target"', { @@ -3473,6 +3565,7 @@ '-fsanitize=memory', '-fsanitize-memory-track-origins', '-fPIC', + '-fsanitize-blacklist=<(msan_blacklist)', ], 'ldflags': [ '-fsanitize=memory', @@ -3518,6 +3611,12 @@ }], ], }], + ['use_custom_libcxx==1', { + 'dependencies': [ + '<(DEPTH)/third_party/libc++/libc++.gyp:libc++', + '<(DEPTH)/third_party/libc++abi/libc++abi.gyp:libc++abi', + ], + }], ['order_profiling!=0 and (chromeos==1 or OS=="linux" or OS=="android")', { 'target_conditions' : [ ['_toolset=="target"', { @@ -3552,32 +3651,9 @@ }], ], }], - ['linux_use_heapchecker==1', { - 'variables': {'linux_use_tcmalloc%': 1}, - 'defines': [ - 'USE_HEAPCHECKER', - 'MEMORY_TOOL_REPLACES_ALLOCATOR', - ], - 'conditions': [ - ['component=="shared_library"', { - # See crbug.com/112389 - # TODO(glider): replace with --dynamic-list or something - 'ldflags': ['-rdynamic'], - }], - ], - }], ['linux_use_tcmalloc==0 and android_use_tcmalloc==0', { 'defines': ['NO_TCMALLOC'], }], - ['linux_keep_shadow_stacks==1', { - 'defines': ['KEEP_SHADOW_STACKS'], - 'cflags': [ - '-finstrument-functions', - # Allow mmx intrinsics to inline, so that the compiler can expand - # the intrinsics. - '-finstrument-functions-exclude-file-list=mmintrin.h', - ], - }], ['linux_use_gold_flags==1', { 'target_conditions': [ ['_toolset=="target"', { @@ -3587,8 +3663,10 @@ # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 # Only apply this to the target linker, since the host # linker might not be gold, but isn't used much anyway. - '-Wl,--threads', - '-Wl,--thread-count=4', + # TODO(raymes): Disable threading because gold is frequently + # crashing on the bots: crbug.com/161942. + # '-Wl,--threads', + # '-Wl,--thread-count=4', ], }], ], @@ -3828,13 +3906,9 @@ '-Wno-extra', # Enabled by -Wextra, but no specific flag '-Wno-ignored-qualifiers', '-Wno-type-limits', + '-Wno-unused-but-set-variable', ], 'cflags_cc': [ - # Disabling c++0x-compat should be handled in WebKit, but - # this currently doesn't work because gcc_version is not set - # correctly when building with the Android build system. - # TODO(torne): Fix this in WebKit. - '-Wno-error=c++0x-compat', # Other things unrelated to -Wextra: '-Wno-non-virtual-dtor', '-Wno-sign-promo', @@ -3939,14 +4013,6 @@ }], ], }], - # ndk-build copies .a's around the filesystem, breaking - # relative paths in thin archives. Disable using thin - # archives to avoid problems until one of these is fixed: - # http://code.google.com/p/android/issues/detail?id=40302 - # http://code.google.com/p/android/issues/detail?id=40303 - ['_type=="static_library"', { - 'standalone_static_library': 1, - }], ], }], # Settings for building host targets using the system toolchain. @@ -4021,9 +4087,6 @@ # Note that the prebuilt Clang binaries should not be used for iOS # development except for ASan builds. ['clang==1', { - 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang', - 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++', - # gnu++11 instead of c++11 is needed because some code uses # typeof() (a GNU extension). # TODO(thakis): Eventually switch this to c++11 instead of @@ -4058,24 +4121,37 @@ # Warns when a const char[] is converted to bool. '-Wstring-conversion', + ], - # Clang considers the `register` keyword as deprecated, but e.g. - # code generated by flex (used in angle) contains that keyword. - # http://crbug.com/255186 - '-Wno-deprecated-register', + 'conditions': [ + ['clang_xcode==0', { + 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang', + 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++', + + 'WARNING_CFLAGS': [ + # Clang considers the `register` keyword as deprecated, but + # e.g. code generated by flex (used in angle) contains that + # keyword. http://crbug.com/255186 + # + # Note: clang as shipped with Xcode is older and does not + # treat the `register` as deprecated and does not define + # this flag, so don't enable it if "clang_xcode" is "1". + '-Wno-deprecated-register', + ], + }], ], }], - ['clang==1 and clang_use_chrome_plugins==1', { + ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', { 'OTHER_CFLAGS': [ '<@(clang_chrome_plugins_flags)', ], }], - ['clang==1 and clang_load!=""', { + ['clang==1 and clang_xcode==0 and clang_load!=""', { 'OTHER_CFLAGS': [ '-Xclang', '-load', '-Xclang', '<(clang_load)', ], }], - ['clang==1 and clang_add_plugin!=""', { + ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', { 'OTHER_CFLAGS': [ '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', ], @@ -4106,6 +4182,15 @@ 'MEMORY_TOOL_REPLACES_ALLOCATOR', ], }], + ['asan_coverage!=0', { + 'target_conditions': [ + ['_toolset=="target"', { + 'cflags': [ + '-mllvm -asan-coverage=<(asan_coverage)', + ], + }], + ], + }], ], 'target_conditions': [ ['_type!="static_library"', { @@ -4118,6 +4203,13 @@ ], }, }], + ['mac_write_linker_maps==1', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-map,>(_target_name).map', + ], + }, + }], ], }], ['_mac_bundle', { @@ -4340,14 +4432,32 @@ # Match OS X clang C++11 warning settings. '-Wno-c++11-narrowing', ], + + # Limit the valid architectures depending on "target_subarch". + # This need to include the "arm" architectures but also the "x86" + # ones (they are used when building for the simulator). + 'conditions': [ + ['target_subarch=="arm32"', { + 'VALID_ARCHS': ['armv7', 'i386'], + }], + ['target_subarch=="arm64"', { + 'VALID_ARCHS': ['arm64', 'x86_64'], + }], + ['target_subarch=="both"', { + 'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'], + }], + ], }, 'target_conditions': [ ['_toolset=="host"', { 'xcode_settings': { 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)', + 'VALID_ARCHS': [ + 'x86_64', + ], 'ARCHS': [ - 'x86_64' + 'x86_64', ], }, }], @@ -4357,6 +4467,7 @@ # since we can't negate the iphone deployment target above, we # instead set it here for target only. 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)', + 'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'], }, }], ['_type=="executable"', { @@ -4511,12 +4622,14 @@ '<(windows_driver_kit_path)/inc/mfc42', ], 'target_conditions': [ - ['chromium_code', { + ['chromium_code and MSVS_VERSION=="2010e"', { # Workaround for intsafe in 2010 Express + WDK. # ATL code uses intsafe.h and both intsafe.h and stdint.h # define INT8_MIN et al. # We can't use this workaround in third_party code because # it has various levels of intolerance for including stdint.h. + # This is not necessary in 2013e, and should be removed once + # mainline is switched: http://crbug.com/340358. 'msvs_system_include_dirs': [ '<(DEPTH)/build', ], @@ -4535,7 +4648,6 @@ '<(windows_sdk_path)/Include/winrt', '$(VSInstallDir)/VC/atlmfc/include', ], - 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'], 'msvs_cygwin_shell': 0, 'msvs_disabled_warnings': [4351, 4355, 4396, 4503, 4819, # TODO(maruel): These warnings are level 4. They will be slowly @@ -4631,6 +4743,75 @@ } }], ], + 'conditions': [ + ['clang==1', { + # Building with Clang on Windows is a work in progress and very + # experimental. See crbug.com/82385. + 'VCCLCompilerTool': { + 'WarnAsError': 'false', + 'RuntimeTypeInfo': 'false', + 'AdditionalOptions': [ + '/fallback', + + # Many files use intrinsics without including this header. + # TODO(hans): Fix those files, or move this to sub-GYPs. + '/FIIntrin.h', + + # TODO(hans): Make this list shorter eventually. + '-Qunused-arguments', + '-Wno-c++11-compat-deprecated-writable-strings', + '-Wno-char-subscripts', + '-Wno-deprecated-declarations', + '-Wno-deprecated-register', + '-Wno-empty-body', + '-Wno-enum-conversion', + '-Wno-extra-tokens', + '-Wno-ignored-attributes', + '-Wno-incompatible-pointer-types', + '-Wno-int-to-void-pointer-cast', + '-Wno-invalid-noreturn', + '-Wno-logical-op-parentheses', + '-Wno-microsoft', + '-Wno-missing-braces', + '-Wno-missing-declarations', + '-Wno-msvc-include', + '-Wno-null-dereference', + '-Wno-overloaded-virtual', + '-Wno-parentheses', + '-Wno-pointer-sign', + '-Wno-reorder', + '-Wno-return-type-c-linkage', + '-Wno-self-assign', + '-Wno-sometimes-uninitialized', + '-Wno-switch', + '-Wno-tautological-compare', + '-Wno-unknown-pragmas', + '-Wno-unsequenced', + '-Wno-unused-function', + '-Wno-unused-private-field', + '-Wno-unused-value', + '-Wno-unused-variable', + '-ferror-limit=1', + ], + }, + 'conditions': [ + ['MSVS_VERSION=="2013" or MSVS_VERSION=="2013e"', { + 'VCCLCompilerTool': { + 'AdditionalOptions': [ + '-fmsc-version=1800', + ], + }, + }], + ['MSVS_VERSION=="2010" or MSVS_VERSION=="2010e"', { + 'VCCLCompilerTool': { + 'AdditionalOptions': [ + '-fmsc-version=1600', + ], + }, + }], + ], + }], + ], }, }, }], @@ -4665,7 +4846,7 @@ '/nxcompat', ], 'conditions': [ - ['asan==0', { + ['syzyasan==0', { 'AdditionalOptions': ['/largeaddressaware'], }], ], @@ -4705,7 +4886,8 @@ ], }, }], - ['clang==1', { + ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) ' + 'and OS!="win"', { 'make_global_settings': [ ['CC', '<(make_clang_dir)/bin/clang'], ['CXX', '<(make_clang_dir)/bin/clang++'], @@ -4713,6 +4895,12 @@ ['CXX.host', '$(CXX)'], ], }], + ['clang==1 and OS=="win"', { + 'make_global_settings': [ + # On Windows, gyp's ninja generator only looks at CC. + ['CC', '<(make_clang_dir)/bin/clang-cl'], + ], + }], ['OS=="android" and clang==0', { # Hardcode the compiler names in the Makefile so that # it won't depend on the environment at make time. @@ -4735,7 +4923,8 @@ # TODO(yyanagisawa): supports GENERATOR==make # make generator doesn't support CC_wrapper without CC # in make_global_settings yet. - ['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', { + ['use_goma==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) and ' + '("<(GENERATOR)"=="ninja" or clang==1)', { 'make_global_settings': [ ['CC_wrapper', '<(gomadir)/gomacc'], ['CXX_wrapper', '<(gomadir)/gomacc'], @@ -4783,7 +4972,6 @@ ['OS=="ios"', { # Target both iPhone and iPad. 'TARGETED_DEVICE_FAMILY': '1,2', - 'VALID_ARCHS': 'armv7 i386', }, { # OS!="ios" 'conditions': [ ['target_arch=="x64"', { diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 37572d9377..462008c2a1 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -2,10 +2,26 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -config("my_msvs") { +import("//build/config/ui.gni") + +declare_args() { + # When set, turns off the (normally-on) iterator debugging and related stuff + # that is normall turned on for Debug builds. These are generally useful for + # catching bugs but in some cases may cause conflicts or excessive slowness. + disable_iterator_debugging = false +} + +# TODO(brettw) Most of these should be removed. Instead of global feature +# flags, we should have more modular flags that apply only to a target and its +# dependents. For example, depending on the "x11" meta-target should define +# USE_X11 for all dependents so that everything that could use X11 gets the +# define, but anything that doesn't depend on X11 doesn't see it. +# +# For now we define these globally to match the current GYP build. +config("feature_flags") { + # TODO(brettw) most of these need to be parameterized. defines = [ "CHROMIUM_BUILD", - "TOOLKIT_VIEWS=1", "USE_LIBJPEG_TURBO=1", "ENABLE_ONE_CLICK_SIGNIN", "ENABLE_REMOTING=1", @@ -31,20 +47,121 @@ config("my_msvs") { "ENABLE_SETTINGS_APP=1", "ENABLE_MANAGED_USERS=1", ] -} -config("feature_flags") { - #defines = + if (toolkit_views) { + defines += [ "TOOLKIT_VIEWS=1" ] + } + if (use_ash) { + defines += [ "USE_ASH=1" ] + } + if (use_aura) { + defines += [ "USE_AURA=1" ] + } + if (use_glib) { + defines += [ "USE_GLIB=1" ] + } + if (use_ozone) { + defines += [ "USE_OZONE=1" ] + } + if (use_x11) { + defines += [ "USE_X11=1" ] + } } +# Debug/release ---------------------------------------------------------------- + config("debug") { defines = [ "_DEBUG", "DYNAMIC_ANNOTATIONS_ENABLED=1", "WTF_USE_DYNAMIC_ANNOTATIONS=1", ] + + if (is_win) { + if (disable_iterator_debugging) { + # Iterator debugging is enabled by the compiler on debug builds, and we + # have to tell it to turn it off. + defines += [ "_HAS_ITERATOR_DEBUGGING=0" ] + } + } else if (is_linux && !is_android && cpu_arch == "x64" && + !disable_iterator_debugging) { + # Enable libstdc++ debugging facilities to help catch problems early, see + # http://crbug.com/65151 . + # TODO(phajdan.jr): Should we enable this for all of POSIX? + defines += [ "_GLIBCXX_DEBUG=1" ] + } } config("release") { +} + +# Default libraries ------------------------------------------------------------ +# This config defines the default libraries applied to all targets. +config("default_libs") { + if (is_win) { + # TODO(brettw) this list of defaults should probably be smaller, and + # instead the targets that use the less common ones (e.g. wininet or + # winspool) should include those explicitly. + libs = [ + "advapi32.lib", + "comdlg32.lib", + "dbghelp.lib", + "delayimp.lib", + "dnsapi.lib", + "gdi32.lib", + "kernel32.lib", + "msimg32.lib", + "odbc32.lib", + "odbccp32.lib", + "ole32.lib", + "oleaut32.lib", + "psapi.lib", + "shell32.lib", + "shlwapi.lib", + "user32.lib", + "usp10.lib", + "uuid.lib", + "version.lib", + "wininet.lib", + "winmm.lib", + "winspool.lib", + "ws2_32.lib", + ] + } else if (is_android) { + # Android uses -nostdlib so we need to add even libc here. + libs = [ + # TODO(brettw) write a version of this, hopefully we can express this + # without forking out to GCC just to get the library name. The android + # toolchain directory should probably be extracted into a .gni file that + # this file and the android toolchain .gn file can share. + # # Manually link the libgcc.a that the cross compiler uses. + # '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', + "c", + "dl", + "m" + ] + } else if (is_mac) { + libs = [ + "AppKit.framework", + "ApplicationServices.framework", + "Carbon.framework", + "CoreFoundation.framework", + "Foundation.framework", + "IOKit.framework", + "Security.framework", + ] + } else if (is_ios) { + libs = [ + "CoreFoundation.framework", + "CoreGraphics.framework", + "CoreText.framework", + "Foundation.framework", + "UIKit.framework", + ] + } else if (is_linux) { + libs = [ + "dl", + ] + } } diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index de1ee08b5b..d061f0b066 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -33,16 +33,6 @@ declare_args() { # to configure warnings. is_clang = false - # ASH is enabled. - # TODO(brettw) this should be moved out of the main build config file. - use_ash = false - # Aura is enabled. - # TODO(brettw) this should be moved out of the main build config file. - use_aura = false - # Ozone is enabled. - # TODO(brettw) this should be moved out of the main build config file. - use_ozone = false - # Forces a 64-bit build on Windows. Does nothing on other platforms. Normally # we build 32-bit on Windows regardless of the current host OS bit depth. # Setting this flag will override this logic and generate 64-bit toolchains. @@ -55,6 +45,35 @@ declare_args() { # Set to true on the command line when invoked by GYP. Build files can key # off of this to make any GYP-output-specific changes to the build. is_gyp = false + + # Selects the desired build flavor. Official builds get additional + # processing to prepare for release. Normally you will want to develop and + # test with this flag off. + is_official_build = false + + # Select the desired branding flavor. False means normal Chromium branding, + # true means official Google Chrome branding (requires extra Google-internal + # resources). + is_chrome_branded = false + + # Compile for Address Sanitizer to find memory bugs. + is_asan = false + + # Compile for Leak Sanitizer to find leaks. + is_lsan = false + + # Compile for Memory Sanitizer to find uninitialized reads. + is_msan = false + + # Compile for Thread Sanitizer to find threading bugs. + is_tsan = false + + # When running in gyp-generating mode, this is the root of the build tree. + gyp_output_dir = "out" + + # When running in gyp-generating mode, this flag indicates if the current GYP + # generator is xcode. Can only be true when building for iOS). + is_gyp_xcode_generator = false } # ============================================================================= @@ -68,7 +87,8 @@ declare_args() { # - is_mac is set only for desktop Mac. It is not set on iOS. # - is_posix is true for mac and any Unix-like system (basically everything # except Windows). -# - is_linux is true for any Linux variant including Android and ChromeOS. +# - is_linux is true for desktop Linux and ChromeOS, but not Android (which is +# generally too different despite being based on the Linux kernel). # # Do not add more is_* variants here for random lesser-used Unix systems like # aix or one of the BSDs. If you need to check these, just check the os value @@ -92,12 +112,14 @@ if (os == "win") { is_nacl = false is_posix = true is_win = false - is_clang = true # Always use clang on Mac. + if (!is_clang) { + is_clang = true # Always use clang on Mac. + } } else if (os == "android") { - is_android = false + is_android = true is_chromeos = false is_ios = false - is_linux = true + is_linux = false is_mac = false is_nacl = false is_posix = true @@ -131,6 +153,10 @@ if (os == "win") { is_nacl = false is_posix = true is_win = false + if (!is_gyp_xcode_generator) { + # Always use clang on iOS when using ninja + is_clang = true + } } else if (os == "linux") { is_android = false is_chromeos = false @@ -268,7 +294,11 @@ if (is_component_build) { component_mode = "static_library" } -toolkit_uses_gtk = is_linux +# These Sanitizers all imply using the Clang compiler. On Windows they either +# don't work or work differently. +if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) { + is_clang = true +} # ============================================================================= # TARGET DEFAULTS @@ -282,7 +312,7 @@ toolkit_uses_gtk = is_linux # Holds all configs used for making native executables and libraries, to avoid # duplication in each target below. native_compiler_configs = [ - "//build/config:my_msvs", # TODO(brettw) eraseme + "//build/config:feature_flags", "//build/config/compiler:compiler", "//build/config/compiler:chromium_code", @@ -291,22 +321,27 @@ native_compiler_configs = [ "//build/config/compiler:runtime_library", ] if (is_win) { - native_compiler_configs += [ - "//build/config/win:sdk", - ] -} else if (is_clang) { - native_compiler_configs += "//build/config/clang:find_bad_constructs" + native_compiler_configs += [ "//build/config/win:sdk", ] +} else if (is_linux) { + native_compiler_configs += [ "//build/config/linux:sdk", ] +} else if (is_mac) { + native_compiler_configs += [ "//build/config/mac:sdk", ] +} else if (is_ios) { + native_compiler_configs += [ "//build/config/ios:sdk", ] +} +if (is_clang) { + native_compiler_configs += [ "//build/config/clang:find_bad_constructs" ] } # Optimizations and debug checking. if (is_debug) { - native_compiler_configs += "//build/config:debug" + native_compiler_configs += [ "//build/config:debug" ] default_optimization_config = "//build/config/compiler:no_optimize" } else { - native_compiler_configs += "//build/config:release" + native_compiler_configs += [ "//build/config:release" ] default_optimization_config = "//build/config/compiler:optimize" } -native_compiler_configs += default_optimization_config +native_compiler_configs += [ default_optimization_config ] # Symbol setup. if (is_clang && (is_linux || is_android)) { @@ -324,7 +359,7 @@ if (is_clang && (is_linux || is_android)) { } else { assert(false, "Bad value for symbol_level.") } -native_compiler_configs += default_symbols_config +native_compiler_configs += [ default_symbols_config ] # Windows linker setup for EXEs and DLLs. if (is_win) { @@ -346,13 +381,15 @@ if (is_win) { } set_defaults("executable") { - configs = native_compiler_configs + configs = native_compiler_configs + [ + "//build/config:default_libs", + ] if (is_win) { configs += windows_linker_configs } else if (is_mac) { - configs += "//build/config/mac:mac_dynamic_flags" - } else if (is_linux) { - configs += "//build/config/linux:executable_ldconfig" + configs += [ "//build/config/mac:mac_dynamic_flags" ] + } else if (is_linux || is_android) { + configs += [ "//build/config/linux:executable_ldconfig" ] } } @@ -361,11 +398,13 @@ set_defaults("static_library") { } set_defaults("shared_library") { - configs = native_compiler_configs + configs = native_compiler_configs + [ + "//build/config:default_libs", + ] if (is_win) { configs += windows_linker_configs } else if (is_mac) { - configs += "//build/config/mac:mac_dynamic_flags" + configs += [ "//build/config/mac:mac_dynamic_flags" ] } } @@ -383,6 +422,8 @@ set_defaults("source_set") { # default toolchain. if (is_win) { + # TODO(brettw) name the toolchains the same as cpu_arch as with Linux below + # to eliminate these conditionals. if (build_cpu_arch == "x64") { host_toolchain = "//build/toolchain/win:64" } else if (build_cpu_arch == "x86") { @@ -394,23 +435,16 @@ if (is_win) { } else if (cpu_arch == "x86") { set_default_toolchain("//build/toolchain/win:32") } +} else if (is_android) { + host_toolchain = "//build/toolchain/linux:$build_cpu_arch" + set_default_toolchain("//build/toolchain/android:$cpu_arch") } else if (is_linux) { - if (build_cpu_arch == "arm") { - host_toolchain = "//build/toolchain/linux:arm" - } else if (build_cpu_arch == "x86") { - host_toolchain = "//build/toolchain/linux:32" - } else if (build_cpu_arch == "x64") { - host_toolchain = "//build/toolchain/linux:64" - } - - if (build_cpu_arch == "arm") { - set_default_toolchain("//build/toolchain/linux:arm") - } else if (build_cpu_arch == "x86") { - set_default_toolchain("//build/toolchain/linux:32") - } else if (build_cpu_arch == "x64") { - set_default_toolchain("//build/toolchain/linux:64") - } + host_toolchain = "//build/toolchain/linux:$build_cpu_arch" + set_default_toolchain("//build/toolchain/linux:$cpu_arch") } else if (is_mac) { host_toolchain = "//build/toolchain/mac:clang" set_default_toolchain(host_toolchain) +} else if (is_ios) { + host_toolchain = "//build/toolchain/mac:host_clang" + set_default_toolchain("//build/toolchain/mac:clang") } diff --git a/build/config/android/config.gni b/build/config/android/config.gni new file mode 100644 index 0000000000..c740812727 --- /dev/null +++ b/build/config/android/config.gni @@ -0,0 +1,65 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file contains common system config stuff for the Android build. + +# TODO(brettw) bug 341772 put this into the is_android block when the toolchain +# stuff is fixed in the GYP generator. The problem is that when we redo the +# build in host mode, the OS is not android and the declarations are never +# seen, which throws an error because these arguments are specified. +declare_args() { + android_src = "" + + # This is set when building the Android WebView inside the Android build + # system, using the 'android' gyp backend. The WebView code is still built + # when this is unset, but builds using the normal chromium build system. + is_android_webview_build = false +} + +if (is_android) { + if (is_android_webview_build) { + assert(android_src != "", + "You must specify android_src for an Android WebView build.") + } + + # android_ndk_root ----------------------------------------------------------- + + # Full system path to the Android NDK. + android_ndk_root = + rebase_path("//third_party/android_tools/ndk", ".", "") + + # stlport stuff -------------------------------------------------------------- + + use_system_stlport = is_android_webview_build + + if (use_system_stlport) { + android_stlport_library = "stlport" + } else if (component_mode == "shared_library") { + android_stlport_library = "stlport_shared" + } else { + android_stlport_library = "stlport_static" + } + + # ABI ------------------------------------------------------------------------ + + if (cpu_arch == "x86") { + android_app_abi = "x86" + } else if (cpu_arch == "arm") { + import("//build/config/arm.gni") + if (arm_version < 7) { + android_app_abi = "armeabi" + } else { + android_app_abi = "armeabi-v7a" + } + } else if (cpu_arch == "mipsel") { + android_app_abi = "mips" + } else { + assert(false, "Unknown Android ABI") + } +} else { + if (!defined(is_android_webview_build)) { + is_android_webview_build = false + } + use_system_stlport = false +} diff --git a/build/config/arm.gni b/build/config/arm.gni new file mode 100644 index 0000000000..b71ce3dad3 --- /dev/null +++ b/build/config/arm.gni @@ -0,0 +1,54 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Version of the ARM processor when compiling on ARM. Ignored on non-ARM + # platforms. + arm_version = 7 + + # The ARM floating point mode. This is either the string "hard", "soft", or + # "softfp". An empty string means to use the default one for the arm_version. + arm_float_abi = "" +} + +assert(arm_float_abi == "" || + arm_float_abi == "hard" || + arm_float_abi == "soft" || + arm_float_abi == "softfp") + +if (is_android) { + arm_use_neon = false + # Our version of arm_neon_optional from common.gypi. This is not used in the + # current build so is commented out for now. + #arm_optionally_use_neon = false +} else { + arm_use_neon = true + #arm_optionally_use_neon = true +} + +if (arm_version == 6) { + arm_arch = "armv6" + arm_tune = "" + if (arm_float_abi == "") { + arm_float_abi = "softfp" + } + arm_fpu = "vfp" + # Thumb is a reduced instruction set available on some ARM processors that + # has increased code density. + arm_use_thumb = false + +} else if (arm_version == 7) { + arm_arch = "armv7-a" + arm_tune = "" + if (arm_float_abi == "") { + arm_float_abi = "softfp" + } + arm_use_thumb = true + + if (arm_use_neon) { + arm_fpu = "neon" + } else { + arm_fpu = "vfpv3-d16" + } +} diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn index d083e86c11..c3ee5da72d 100644 --- a/build/config/clang/BUILD.gn +++ b/build/config/clang/BUILD.gn @@ -2,17 +2,32 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +declare_args() { + # Indicates if the build should use the Chrome-specific plugins for enforcing + # coding guidelines, etc. + clang_use_chrome_plugins = true +} + config("find_bad_constructs") { - cflags = [ - "-Xclang", "-load", - "-Xclang", + if (clang_use_chrome_plugins) { + cflags = [ + "-Xclang", "-load", + "-Xclang", + ] - # TODO(brettw) express this in terms of a relative dir from the output. - # for now, assume the output dir is two levels deep under the source - # (like "out/Debug"). - "../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib", + if (is_mac || is_ios) { + cflags += [ rebase_path( + "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib", + ".", root_build_dir) ] + } else if (is_linux) { + cflags += [ rebase_path( + "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so", + ".", root_build_dir) ] + } - "-Xclang", "-add-plugin", - "-Xclang", "find-bad-constructs", - ] + cflags += [ + "-Xclang", "-add-plugin", + "-Xclang", "find-bad-constructs", + ] + } } diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 2ded34ed00..e1b73eec83 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -2,11 +2,36 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/android/config.gni") +if (cpu_arch == "arm") { + import("//build/config/arm.gni") +} + +# compiler --------------------------------------------------------------------- +# # Base compiler configuration. +# +# See also "runtime_library" below for related stuff and a discusison about +# where stuff should go. Put warning related stuff in the "warnings" config. + config("compiler") { - include_dirs = [ "//", root_gen_dir ] + cflags = [] + cflags_c = [] + cflags_cc = [] + ldflags = [] + defines = [] + include_dirs = [] + + include_dirs += [ "//", root_gen_dir ] + + # In general, Windows is totally different, but all the other builds share + # some common GCC configuration. This section sets up Windows and the common + # GCC flags, and then we handle the other non-Windows platforms specifically + # below. if (is_win) { - cflags = [ + # Windows compiler flags setup. + # ----------------------------- + cflags += [ "/Gy", # Enable function-level linking. "/GS", # Enable buffer security checking. "/EHsc", # Assume C functions can't throw exceptions and don't catch @@ -15,129 +40,214 @@ config("compiler") { } else { # Common GCC compiler flags setup. # -------------------------------- - cflags = [ + cflags += [ "-fno-strict-aliasing", # See http://crbug.com/32204 "-fvisibility=hidden", ] - cflags_c = [ - ] - cflags_cc = [ + cflags_cc += [ "-fno-exceptions", "-fno-threadsafe-statics", "-fvisibility-inlines-hidden", ] - ldflags = [ - ] # Stack protection. - # TODO(brettw) why do we have different values for all of these cases? if (is_mac) { - cflags += "-fstack-protector-all" - } else if (is_chromeos) { - cflags += "-fstack-protector-strong" + cflags += [ "-fstack-protector-all" ] } else if (is_linux) { cflags += [ "-fstack-protector", "--param=ssp-buffer-size=4" ] } + } - if (is_mac) { - # Mac-specific compiler flags setup. - # ---------------------------------- + # Mac-specific compiler flags setup. + # ---------------------------------- + if (is_mac || is_ios) { + # These flags are shared between the C compiler and linker. + common_mac_flags = [] + + # CPU architecture. + if (cpu_arch == "x64") { + common_mac_flags += [ "-arch x86_64" ] + } else if (cpu_arch == "x86") { + common_mac_flags += [ "-arch i386" ] + } - # These flags are shared between the C compiler and linker. - common_mac_flags = [ - # Set which SDK to use. - # TODO(brettw) this needs to be configurable somehow. - "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk", + cflags += common_mac_flags - "-mmacosx-version-min=10.6", - ] + # Without this, the constructors and destructors of a C++ object inside + # an Objective C struct won't be called, which is very bad. + cflags_objcc = [ "-fobjc-call-cxx-cdtors", ] - # CPU architecture. - if (cpu_arch == "x64") { - common_mac_flags += "-arch x86_64" - } else if (cpu_arch == "x32") { - common_mac_flags += "-arch i386" - } + cflags_c += [ "-std=c99" ] + cflags_cc += [ "-std=gnu++11" ] - cflags += common_mac_flags + [ - # Without this, the constructors and destructors of a C++ object inside - # an Objective C struct won't be called, which is very bad. - "-fobjc-call-cxx-cdtors", - ] + ldflags += common_mac_flags + [ + "-L.", - cflags_c += [ "-std=c99" ] - cflags_cc += [ "-std=gnu++11" ] + # TODO(brettW) I don't understand these options. + "-Wl,-rpath,@loader_path/.", + "-Wl,-rpath,@loader_path/../../..", + ] + } else if (is_posix) { + # Non-Mac Posix compiler flags setup. + # ----------------------------------- + + # CPU architecture. We may or may not be doing a cross compile now, so for + # simplicity we always explicitly set the architecture. + if (cpu_arch == "x64") { + cflags += [ "-m64" ] + ldflags += [ "-m64" ] + } else if (cpu_arch == "x86") { + cflags += [ "-m32" ] + ldflags += [ "-m32" ] + } else if (cpu_arch == "arm") { + # Don't set the compiler flags for the WebView build. These will come + # from the Android build system. + if (!is_android_webview_build) { + cflags += [ + "-march=$arm_arch", + "-mfpu=$arm_fpu", + "-mfloat-abi=$arm_float_abi", + ] + if (arm_tune != "") { + cflags += [ "-mtune=$arm_tune" ] + } + if (arm_use_thumb) { + cflags += [ "-mthumb" ] + if (is_android && !is_clang) { # Clang doesn't support this option. + cflags += [ "-mthumb-interwork" ] + } + } + } + } - ldflags += common_mac_flags + [ - "-L.", + defines += [ "_FILE_OFFSET_BITS=64" ] - # TODO(brettW) I don't understand these options. - "-Wl,-rpath,@loader_path/.", - "-Wl,-rpath,@loader_path/../../..", + # Omit unwind support in official builds to save space. We can use breakpad + # for these builds. + if (is_chrome_branded && is_official_build) { + cflags += [ + "-fno-unwind-tables", + "-fno-asynchronous-unwind-tables", ] } else { - # Non-Mac Posix compiler flags setup. - # ----------------------------------- - - # CPU architecture. We may or may not be doing a cross compile now, so for - # simplicity we always explicitly set the architecture. - if (cpu_arch == "x64") { - cflags += "-m64" - ldflags += "-m64" - } else if (cpu_arch == "x32") { - cflags += "-m32" - ldflags += "-m32" - } + cflags += [ "-funwind-tables" ] } + } - # Linux-specific compiler flags setup. - # ------------------------------------ - if (is_linux) { - cflags += [ - "-fPIC", - "-pthread", - "-pipe", # Use pipes for communicating between sub-processes. Faster. - ] + # Linux-specific compiler flags setup. + # ------------------------------------ + if (is_linux) { + cflags += [ + "-fPIC", + "-pipe", # Use pipes for communicating between sub-processes. Faster. + ] + if (!is_android) { + cflags += [ "-pthread" ] + } + if (cpu_arch == "x64") { # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of # address space, and it doesn't support cross-compiling). - if (cpu_arch == "x64") { - gold_path = rebase_path("//third_party/gold", ".", root_build_dir) - ldflags += [ - "-B$gold_path", - - # There seems to be a conflict of --icf and -pie in gold which can - # generate crashy binaries. As a security measure, -pie takes - # precendence for now. - # TODO(brettw) common.gypi has this only for target toolset. - #"-Wl,--icf=safe", - "-Wl,--icf=none", - - # Experimentation found that using four linking threads - # saved ~20% of link time. - # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 - # Only apply this to the target linker, since the host - # linker might not be gold, but isn't used much anyway. - "-Wl,--threads", - "-Wl,--thread-count=4", - ] - } + gold_path = rebase_path("//third_party/gold", ".", root_build_dir) + ldflags += [ + "-B$gold_path", + + # There seems to be a conflict of --icf and -pie in gold which can + # generate crashy binaries. As a security measure, -pie takes + # precendence for now. + # TODO(brettw) common.gypi has this only for target toolset. + #"-Wl,--icf=safe", + "-Wl,--icf=none", + + # Experimentation found that using four linking threads + # saved ~20% of link time. + # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 + # Only apply this to the target linker, since the host + # linker might not be gold, but isn't used much anyway. + "-Wl,--threads", + "-Wl,--thread-count=4", + ] + } + + ldflags += [ + "-fPIC", + "-pthread", + "-Wl,-z,noexecstack", + "-Wl,-z,now", + "-Wl,-z,relro", + ] + } + + # Clang-specific compiler flags setup. + # ------------------------------------ + if (is_clang) { + cflags += [ + "-fcolor-diagnostics", + ] + cflags_cc += [ + "-std=gnu++11", + ] + } + + # Android-specific flags setup. + # ----------------------------- + if (is_android) { + cflags += [ + "-ffunction-sections", + "-funwind-tables", + "-fno-short-enums", + ] + if (!is_clang) { + # Clang doesn't support this one. + cflags += [ "-finline-limit=64" ] + } + if (is_android_webview_build) { + # Android predefines this as 1; undefine it here so Chromium can redefine + # it later to be 2 for chromium code and unset for third party code. This + # works because cflags are added before defines. + # TODO(brettw) the above comment seems incorrect. We specify defines + # before cflags on our compiler command lines. + cflags += [ "-U_FORTIFY_SOURCE" ] + } + + if (is_asan) { + # Android build relies on -Wl,--gc-sections removing unreachable code. + # ASan instrumentation for globals inhibits this and results in a library + # with unresolvable relocations. + # TODO(eugenis): find a way to reenable this. + cflags += [ "-mllvm -asan-globals=0" ] + } + defines += [ "ANDROID" ] + if (!is_android_webview_build) { + # The NDK has these things, but doesn't define the constants + # to say that it does. Define them here instead. + defines += [ "HAVE_SYS_UIO_H" ] + } + + ldflags += [ + "-Wl,--no-undefined", + # Don't export symbols from statically linked libraries. + "-Wl,--exclude-libs=ALL", + ] + if (cpu_arch == "arm") { ldflags += [ - "-fPIC", - "-pthread", - "-Wl,-z,noexecstack", - "-Wl,-z,now", - "-Wl,-z,relro", + # Enable identical code folding to reduce size. + "-Wl,--icf=safe", ] } - # Clang-specific compiler flags setup. - # ------------------------------------ if (is_clang) { - cflags += [ - "-fcolor-diagnostics", - ] + if (cpu_arch == "arm") { + cflags += [ + "-target arm-linux-androideabi", + "-mllvm -arm-enable-ehabi", + ] + ldflags += [ "-target arm-linux-androideabi" ] + } else if (cpu_arch == "x86") { + cflags += [ "-target x86-linux-androideabi" ] + ldflags += [ "-target x86-linux-androideabi" ] + } } } } @@ -146,21 +256,29 @@ config("compiler") { # # Sets the runtime library and associated options. # -# We don't bother making multiple versions that are toggle-able since there -# is more than one axis of control (which makes it complicated) and there's -# no practical reason for anybody to change this since the CRT must agree. +# How do you determine what should go in here vs. "compiler" above? Consider if +# a target might choose to use a different runtime library (ignore for a moment +# if this is possible or reasonable on your system). If such a target would want +# to change or remove your option, put it in the runtime_library config. If a +# target wants the option regardless, put it in the compiler config. config("runtime_library") { + cflags = [] + defines = [] + ldflags = [] + lib_dirs = [] + libs = [] + if (is_component_build) { # Component mode: dynamic CRT. - defines = [ "COMPONENT_BUILD" ] + defines += [ "COMPONENT_BUILD" ] if (is_win) { # Since the library is shared, it requires exceptions or will give errors # about things not matching, so keep exceptions on. if (is_debug) { - cflags = [ "/MDd" ] + cflags += [ "/MDd" ] } else { - cflags = [ "/MD" ] + cflags += [ "/MD" ] } } } else { @@ -168,11 +286,11 @@ config("runtime_library") { if (is_win) { # We don't use exceptions, and when we link statically we can just get # rid of them entirely. - defines = [ "_HAS_EXCEPTIONS=0" ] + defines += [ "_HAS_EXCEPTIONS=0" ] if (is_debug) { - cflags = [ "/MTd" ] + cflags += [ "/MTd" ] } else { - cflags = [ "/MT" ] + cflags += [ "/MT" ] } } } @@ -189,6 +307,56 @@ config("runtime_library") { "UNICODE", ] } + + # Stlport setup. Android uses a different (smaller) version of the STL. + if (is_android) { + if (is_clang) { + # Work around incompatibilities between bionic and clang headers. + defines += [ + "__compiler_offsetof=__builtin_offsetof", + "nan=__builtin_nan", + ] + } + + defines += [ + "USE_STLPORT=1", + "_STLP_USE_PTR_SPECIALIZATIONS=1", + "__GNU_SOURCE=1", # Necessary for clone(). + ] + + ldflags += [ + "-nostdlib", + ] + + + # NOTE: The stlport header include paths below are specified in cflags + # rather than include_dirs because they need to come after include_dirs. + # Think of them like system headers, but don't use '-isystem' because the + # arm-linux-androideabi-4.4.3 toolchain (circa Gingerbread) will exhibit + # strange errors. The include ordering here is important; change with + # caution. + if (use_system_stlport) { + cflags += [ + # For libstdc++/include, which is used by stlport. + "-I$android_src/bionic", + "-I$android_src/external/stlport/stlport", + ] + libs += [ + "stlport", + ] + } else { + android_stlport_root = "$android_ndk_root/sources/cxx-stl/stlport" + + cflags += [ "-I$android_stlport_root/stlport" ] + lib_dirs += [ "$android_stlport_root/libs/$android_app_abi" ] + + if (component_mode == "shared_library") { + libs += [ "stlport_shared" ] + } else { + libs += [ "stlport_static" ] + } + } + } } # chromium_code --------------------------------------------------------------- @@ -224,7 +392,7 @@ config("chromium_code") { # TODO(brettw) this should also be enabled on Linux but some files # currently fail. if (is_mac) { - cflags += "-Wextra" + cflags += [ "-Wextra" ] } } } @@ -239,6 +407,20 @@ config("no_chromium_code") { "_CRT_NONSTDC_NO_DEPRECATE", ] } + + if (is_android_webview_build) { + # There is a class of warning which: + # 1) Android always enables and also treats as errors + # 2) Chromium ignores in third party code + # So we re-enable those warnings when building Android. + cflags = [ + "-Wno-address", + "-Wno-format-security", + "-Wno-return-type", + "-Wno-sequence-point", + ] + cflags_cc = [ "-Wno-non-virtual-dtor" ] + } } # rtti ------------------------------------------------------------------------ @@ -259,6 +441,9 @@ config("no_rtti") { } # Warnings --------------------------------------------------------------------- +# +# This is where we disable various warnings that we've decided aren't +# worthwhile, and enable special warnings. config("default_warnings") { if (is_win) { @@ -270,9 +455,6 @@ config("default_warnings") { "/wd4125", # Decimal digit terminates octal escape sequence. "/wd4127", # Conditional expression is constant. "/wd4130", # Logical operation on address of string constant. - # TODO(brettw) is this necessary? If so, it should probably be on whoever - # is silly enough to be doing this rather than globally. - #"/wd4131", # Function uses old-style declarator. "/wd4189", # A variable was declared and initialized but never used. "/wd4201", # Nonstandard extension used: nameless struct/union. "/wd4238", # Nonstandard extension used: class rvalue used as lvalue. @@ -348,17 +530,60 @@ config("default_warnings") { "-Wstring-conversion", ] } + + if (is_android) { + # Disable any additional warnings enabled by the Android build system but + # which chromium does not build cleanly with (when treating warning as + # errors). + cflags += [ + "-Wno-extra", + "-Wno-ignored-qualifiers", + "-Wno-type-limits", + ] + cflags_cc = [ + # Disabling c++0x-compat should be handled in WebKit, but + # this currently doesn't work because gcc_version is not set + # correctly when building with the Android build system. + # TODO(torne): Fix this in WebKit. + "-Wno-error=c++0x-compat", + # Other things unrelated to -Wextra: + "-Wno-non-virtual-dtor", + "-Wno-sign-promo", + ] + } + } +} + +# This will generate warnings when using Clang if code generates exit-time +# destructors, which will slow down closing the program. +# TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 +config("wexit_time_destructors") { + if (is_clang) { + cflags = [ "-Wexit-time-destructors" ] } } # Optimization ----------------------------------------------------------------- +# +# Note that BUILDCONFIG.gn sets up a variable "default_optimization_config" +# which it will assign to the config it implicitly applies to every target. If +# you want to override the optimization level for your target, remove this +# config (which will expand differently for debug or release builds), and then +# add back the one you want to override it with: +# +# configs -= default_optimization_config +# configs += [ "//build/config/compiler/optimize_max" ] +# Default "optimization on" config. On Windows, this favors size over speed. +# +# IF YOU CHANGE THIS also consider whether optimize_max should be updated. config("optimize") { if (is_win) { cflags = [ "/O2", "/Ob2", # Both explicit and auto inlining. "/Oy-", # Disable omitting frame pointers, must be after /O2. + "/Os", # Favor size over speed. ] } else { if (is_ios) { @@ -369,6 +594,7 @@ config("optimize") { } } +# Turn off optimizations. config("no_optimize") { if (is_win) { cflags = [ @@ -381,6 +607,27 @@ config("no_optimize") { } } +# On Windows, turns up the optimization level. This implies whole program +# optimization and link-time code generation which is very expensive and should +# be used sparingly. For non-Windows, this is the same as "optimize". +config("optimize_max") { + if (is_win) { + cflags = [ + "/O2", + "/Ob2", # Both explicit and auto inlining. + "/Oy-", # Disable omitting frame pointers, must be after /O2. + "/Ot", # Favor speed over size. + "/GL", # Whole program optimization. + ] + } else { + if (is_ios) { + cflags = [ "-Os" ] + } else { + cflags = [ "-O2" ] + } + } +} + # Symbols ---------------------------------------------------------------------- # TODO(brettw) Since this sets ldflags on Windows which is inherited across @@ -412,3 +659,4 @@ config("no_symbols") { cflags = [ "-g0" ] } } + diff --git a/build/config/ios/BUILD.gn b/build/config/ios/BUILD.gn new file mode 100644 index 0000000000..0886be458a --- /dev/null +++ b/build/config/ios/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright 2014 The Chromium Authors. 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/sysroot.gni") +import("//build/config/ios/ios_sdk.gni") + +config("sdk") { + common_flags = [ "-isysroot", sysroot ] + + cflags = common_flags + ldflags = common_flags + + if (use_ios_simulator) { + cflags += [ "-mios-simulator-version-min=$ios_deployment_target" ] + } else { + cflags += [ "-miphoneos-version-min=$ios_deployment_target" ] + } +} diff --git a/build/config/ios/ios_sdk.gni b/build/config/ios/ios_sdk.gni new file mode 100644 index 0000000000..dce993d5cf --- /dev/null +++ b/build/config/ios/ios_sdk.gni @@ -0,0 +1,42 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # SDK path to use. When empty this will use the default SDK based on the + # value of use_ios_simulator. + ios_sdk_path = "" + + # Set to true when targeting a simulator build on iOS. False means that the + # target is for running on the device. The default value (the empty string) + # means to pick the default based on the generator. + use_ios_simulator = "" + + # Version of iOS that we're targeting. + ios_deployment_target = "6.0" +} + +if (use_ios_simulator == "") { + # Pick the default based on the generator. Currently, the Ninja build only + # supports the simulator, while we default to device builds on Xcode. + use_ios_simulator = !is_gyp_xcode_generator +} else { + # Simulator flag explicitly passed in. + if (!is_gyp_xcode_generator) { + # The Ninja build currently only targets the simulator. + assert(use_ios_simulator, + "You can't do an iOS device build using Ninja yet.") + } +} + +if (ios_sdk_path == "") { + # Compute default target. + if (use_ios_simulator) { + _ios_sdk_to_query = "iphonesimulator" + } else { + _ios_sdk_to_query = "iphoneos" + } + _ios_sdk_result = + exec_script("ios_sdk.py", [ _ios_sdk_to_query ], "list lines") + ios_sdk_path = _ios_sdk_result[0] +} diff --git a/build/config/ios/ios_sdk.py b/build/config/ios/ios_sdk.py new file mode 100644 index 0000000000..dfec4dbada --- /dev/null +++ b/build/config/ios/ios_sdk.py @@ -0,0 +1,19 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import subprocess +import sys + +# This script returns the path to the SDK of the given type. Pass the type of +# SDK you want, which is typically "iphone" or "iphonesimulator". +# +# In the GYP build, this is done inside GYP itself based on the SDKROOT +# variable. + +if len(sys.argv) != 2: + print "Takes one arg (SDK to find)" + sys.exit(1) + +print subprocess.check_output(['xcodebuild', '-version', '-sdk', + sys.argv[1], 'Path']).strip() diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn index 1a9507c07e..15b0c9140c 100644 --- a/build/config/linux/BUILD.gn +++ b/build/config/linux/BUILD.gn @@ -2,6 +2,22 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/linux/pkg_config.gni") +import("//build/config/sysroot.gni") + +config("sdk") { + if (sysroot != "") { + cflags = [ "--sysroot=" + sysroot ] + ldflags = [ "--sysroot=" + sysroot ] + + # Need to get some linker flags out of the sysroot. + ldflags += [ exec_script("sysroot_ld_path.py", + [ rebase_path("//build/linux/sysroot_ld_path.sh", ".", root_build_dir), + sysroot ], + "value") ] + } +} + # Sets up the dynamic library search path to include our "lib" directory. config("executable_ldconfig") { ldflags = [ @@ -13,64 +29,35 @@ config("executable_ldconfig") { ] } -# This script returns a list consisting of two nested lists: the first is the -# list of cflags, the second are the linker flags. -pkg_script = "pkg-config.py" - config("fontconfig") { libs = [ "fontconfig" ] } -config("freetype2") { - pkgresult = exec_script(pkg_script, [ "freetype2" ], "value") - include_dirs = pkgresult[0] - cflags = pkgresult[1] - libs = pkgresult[2] - lib_dirs = pkgresult[3] +pkg_config("freetype2") { + packages = [ "freetype2" ] } -config("glib") { - pkgresult = exec_script(pkg_script, - [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ], "value" ) - include_dirs = pkgresult[0] - cflags = pkgresult[1] - libs = pkgresult[2] - lib_dirs = pkgresult[3] +pkg_config("glib") { + packages = [ "glib-2.0", "gmodule-2.0", "gobject-2.0", "gthread-2.0" ] } -config("gtk") { +pkg_config("gtk") { # Gtk requires gmodule, but it does not list it as a dependency in some # misconfigured systems. - pkgresult = exec_script(pkg_script, - [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ], "value" ) - include_dirs = pkgresult[0] - cflags = pkgresult[1] - libs = pkgresult[2] - lib_dirs = pkgresult[3] - - defines = [ "TOOLKIT_GTK" ] + packages = [ "gmodule-2.0", "gtk+-2.0", "gthread-2.0" ] } -config("pangocairo") { - pkgresult = exec_script(pkg_script, [ "pangocairo" ], "value" ) - include_dirs = pkgresult[0] - cflags = pkgresult[1] - libs = pkgresult[2] - lib_dirs = pkgresult[3] +pkg_config("pangocairo") { + packages = [ "pangocairo" ] } -config("udev") { - pkgresult = exec_script(pkg_script, [ "libudev" ], "value" ) - include_dirs = pkgresult[0] - cflags = pkgresult[1] - libs = pkgresult[2] - lib_dirs = pkgresult[3] +pkg_config("udev") { + packages = [ "libudev" ] } config("x11") { # Don't bother running pkg-config for these X related libraries since it just # returns the same libs, and forking pkg-config is slow. - defines = [ "USE_X11" ] libs = [ "X11", "Xcomposite", diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py index 40988d9792..70cb5e961a 100644 --- a/build/config/linux/pkg-config.py +++ b/build/config/linux/pkg-config.py @@ -3,6 +3,7 @@ # found in the LICENSE file. import json +import os import subprocess import sys import re @@ -11,22 +12,98 @@ from optparse import OptionParser # This script runs pkg-config, optionally filtering out some results, and # returns the result. # -# The result will be [ <includes>, <cflags>, <libs>, <lib_dirs> ] where each -# member is itself a list of strings. +# The result will be [ <includes>, <cflags>, <libs>, <lib_dirs>, <ldflags> ] +# where each member is itself a list of strings. # # You can filter out matches using "-v <regexp>" where all results from # pkgconfig matching the given regular expression will be ignored. You can # specify more than one regular expression my specifying "-v" more than once. +# +# You can specify a sysroot using "-s <sysroot>" where sysroot is the absolute +# system path to the sysroot used for compiling. This script will attempt to +# generate correct paths for the sysroot. +# +# When using a sysroot, you must also specify the architecture via +# "-a <arch>" where arch is either "x86" or "x64". # If this is run on non-Linux platforms, just return nothing and indicate # success. This allows us to "kind of emulate" a Linux build from other # platforms. if sys.platform.find("linux") == -1: - print "[[],[],[]]" + print "[[],[],[],[]]" sys.exit(0) + +def SetConfigPath(options): + """Set the PKG_CONFIG_PATH environment variable. + This takes into account any sysroot and architecture specification from the + options on the given command line.""" + + sysroot = options.sysroot + if not sysroot: + sysroot = "" + + # Compute the library path name based on the architecture. + arch = options.arch + if sysroot and not arch: + print "You must specify an architecture via -a if using a sysroot." + sys.exit(1) + if arch == 'x64': + libpath = 'lib64' + else: + libpath = 'lib' + + # Add the sysroot path to the environment's PKG_CONFIG_PATH + config_path = sysroot + '/usr/' + libpath + '/pkgconfig' + config_path += ':' + sysroot + '/usr/share/pkgconfig' + if 'PKG_CONFIG_PATH' in os.environ: + os.environ['PKG_CONFIG_PATH'] += ':' + config_path + else: + os.environ['PKG_CONFIG_PATH'] = config_path + + +def GetPkgConfigPrefixToStrip(args): + """Returns the prefix from pkg-config where packages are installed. + This returned prefix is the one that should be stripped from the beginning of + directory names to take into account sysroots.""" + # Some sysroots, like the Chromium OS ones, may generate paths that are not + # relative to the sysroot. For example, + # /path/to/chroot/build/x86-generic/usr/lib/pkgconfig/pkg.pc may have all + # paths relative to /path/to/chroot (i.e. prefix=/build/x86-generic/usr) + # instead of relative to /path/to/chroot/build/x86-generic (i.e prefix=/usr). + # To support this correctly, it's necessary to extract the prefix to strip + # from pkg-config's |prefix| variable. + prefix = subprocess.check_output(["pkg-config", "--variable=prefix"] + args, + env=os.environ) + if prefix[-4] == '/usr': + return prefix[4:] + return prefix + + +def MatchesAnyRegexp(flag, list_of_regexps): + """Returns true if the first argument matches any regular expression in the + given list.""" + for regexp in list_of_regexps: + if regexp.search(flag) != None: + return True + return False + + +def RewritePath(path, strip_prefix, sysroot): + """Rewrites a path by stripping the prefix and prepending the sysroot.""" + if os.path.isabs(path) and not path.startswith(sysroot): + if path.startswith(strip_prefix): + path = path[len(strip_prefix):] + path = path.lstrip('/') + return os.path.join(sysroot, path) + else: + return path + + parser = OptionParser() parser.add_option('-v', action='append', dest='strip_out', type='string') +parser.add_option('-s', action='store', dest='sysroot', type='string') +parser.add_option('-a', action='store', dest='arch', type='string') (options, args) = parser.parse_args() # Make a list of regular expressions to strip out. @@ -35,9 +112,15 @@ if options.strip_out != None: for regexp in options.strip_out: strip_out.append(re.compile(regexp)) +SetConfigPath(options) +if options.sysroot: + prefix = GetPkgConfigPrefixToStrip(args) +else: + prefix = '' + try: flag_string = subprocess.check_output(["pkg-config", "--cflags", "--libs"] + - args) + args, env=os.environ) # For now just split on spaces to get the args out. This will break if # pkgconfig returns quoted things with spaces in them, but that doesn't seem # to happen in practice. @@ -46,31 +129,38 @@ except: print "Could not run pkg-config." sys.exit(1) + +sysroot = options.sysroot +if not sysroot: + sysroot = '' + includes = [] cflags = [] libs = [] lib_dirs = [] - -def MatchesAnyRegexp(flag, list_of_regexps): - for regexp in list_of_regexps: - if regexp.search(flag) != None: - return True - return False +ldflags = [] for flag in all_flags[:]: if len(flag) == 0 or MatchesAnyRegexp(flag, strip_out): continue; if flag[:2] == '-l': - libs.append(flag[2:]) - if flag[:2] == '-L': - lib_dirs.append(flag[2:]) + libs.append(RewritePath(flag[2:], prefix, sysroot)) + elif flag[:2] == '-L': + lib_dirs.append(RewritePath(flag[2:], prefix, sysroot)) elif flag[:2] == '-I': - includes.append(flag[2:]) + includes.append(RewritePath(flag[2:], prefix, sysroot)) + elif flag[:3] == '-Wl': + ldflags.append(flag) + elif flag == '-pthread': + # Many libs specify "-pthread" which we don't need since we always include + # this anyway. Removing it here prevents a bunch of duplicate inclusions on + # the command line. + pass else: cflags.append(flag) # Output a GN array, the first one is the cflags, the second are the libs. The # JSON formatter prints GN compatible lists when everything is a list of # strings. -print json.dumps([includes, cflags, libs, lib_dirs]) +print json.dumps([includes, cflags, libs, lib_dirs, ldflags]) diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni new file mode 100644 index 0000000000..fdd31ba846 --- /dev/null +++ b/build/config/linux/pkg_config.gni @@ -0,0 +1,39 @@ +# Copyright (c) 2013 The Chromium Authors. 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/sysroot.gni") + +# Defines a config specifying the result of running pkg-config for the given +# packages. Put the package names you want to query in the "packages" variable +# inside the template invocation. +# +# You can also add defines via the "defines" variable. This can be useful to +# add this to the config to pass defines that the library expects to get by +# users of its headers. +# +# Example: +# pkg_config("mything") { +# packages = [ "mything1", "mything2" ] +# defines = [ "ENABLE_AWESOME" ] +# } + +template("pkg_config") { + assert(defined(packages), + "Variable |packages| must be defined to be a list in pkg_config.") + config(target_name) { + if (sysroot != "") { + # Pass the sysroot if we're using one (it requires the CPU arch also). + args = ["-s", sysroot, "-a", cpu_arch] + packages + } else { + args = packages + } + pkgresult = exec_script("//build/config/linux/pkg-config.py", + args, "value") + include_dirs = pkgresult[0] + cflags = pkgresult[1] + libs = pkgresult[2] + lib_dirs = pkgresult[3] + ldflags = pkgresult[4] + } +} diff --git a/build/config/linux/sysroot_ld_path.py b/build/config/linux/sysroot_ld_path.py new file mode 100644 index 0000000000..4bce7ee3e2 --- /dev/null +++ b/build/config/linux/sysroot_ld_path.py @@ -0,0 +1,20 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file takes two arguments, the relative location of the shell script that +# does the checking, and the name of the sysroot. + +# TODO(brettw) the build/linux/sysroot_ld_path.sh script should be rewritten in +# Python in this file. + +import subprocess +import sys + +if len(sys.argv) != 3: + print "Need two arguments" + sys.exit(1) + +result = subprocess.check_output([sys.argv[1], sys.argv[2]]).strip() + +print '"' + result + '"' diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn index 78c106aebf..b6db8e0b71 100644 --- a/build/config/mac/BUILD.gn +++ b/build/config/mac/BUILD.gn @@ -2,6 +2,18 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/sysroot.gni") + +config("sdk") { + common_flags = [ + "-isysroot", sysroot, + "-mmacosx-version-min=10.6" + ] + + cflags = common_flags + ldflags = common_flags +} + # On Mac, this is used for everything except static libraries. config("mac_dynamic_flags") { ldflags = [ diff --git a/build/config/mac/mac_sdk.gni b/build/config/mac/mac_sdk.gni new file mode 100644 index 0000000000..770a06e95a --- /dev/null +++ b/build/config/mac/mac_sdk.gni @@ -0,0 +1,34 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Minimum supported version of the Mac SDK. + mac_sdk_min = "10.6" + + # Path to a specific version of the Mac SDKJ, not including a backslash at + # the end. If empty, the path to the lowest version greater than or equal to + # mac_sdk_min is used. + mac_sdk_path = "" +} + +find_sdk_args = [ "--print_sdk_path" ] +if (is_chrome_branded && is_official_build) { + find_sdk_args += [ "--verify", mac_sdk_min "--sdk_path=" + mac_sdk_path ] +} else { + find_sdk_args += [ mac_sdk_min ] +} +# The tool will print the SDK path on the first line, and the version on the +# second line. +find_sdk_lines = + exec_script("//build/mac/find_sdk.py", find_sdk_args, "list lines") +mac_sdk_version = find_sdk_lines[1] +if (mac_sdk_path == "") { + # TODO(brettw) http://crbug.com/335325 when everybody moves to XCode 5 we + # can remove the --print_sdk_path argument to find_sdk and instead just use + # the following two lines to get the path. Although it looks longer here, it + # saves forking a process in find_sdk.py so will be faster. + #mac_sdk_root = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX" + #mac_sdk_path = mac_sdk_root + mac_sdk_version + ".sdk" + mac_sdk_path = find_sdk_lines[0] +} diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni new file mode 100644 index 0000000000..6340c3a7d1 --- /dev/null +++ b/build/config/sysroot.gni @@ -0,0 +1,51 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This header file defines the "sysroot" variable which is the absolute path +# of the sysroot. If no sysroot applies, the variable will be an empty string. + +if (is_android) { + import("//build/config/android/config.gni") + if (!is_android_webview_build) { + if (cpu_arch == "x86") { + sysroot = "$android_ndk_root/platforms/android-14/arch-x86" + } else if (cpu_arch == "arm") { + sysroot = "$android_ndk_root/platforms/android-14/arch-arm" + } else if (cpu_arch == "mipsel") { + sysroot = "$android_ndk_root/platforms/android-14/arch-mips" + } else { + sysroot = "" + } + } else { + sysroot = "" + } +} else if (is_linux && is_chrome_branded && is_official_build && !is_chromeos) { + # For official builds, use the sysroot checked into the internal source repo + # so that the builds work on older versions of Linux. + if (cpu_arch == "x64") { + sysroot = rebase_path( + "//chrome/installer/linux/debian_wheezy_amd64-sysroot", ".", "") + } else if (cpu_arch == "x86") { + sysroot = rebase_path( + "//chrome/installer/linux/debian_wheezy_i386-sysroot", ".", "") + } else { + # Any other builds don't use a sysroot. + sysroot = "" + } +} else if (is_linux && !is_chromeos) { + if (cpu_arch == "mipsel") { + sysroot = rebase_path("//mipsel-sysroot/sysroot", ".", "") + } else { + sysroot = "" + } +} else if (is_mac) { + import("//build/config/mac/mac_sdk.gni") + + sysroot = mac_sdk_path +} else if (is_ios) { + import("//build/config/ios/ios_sdk.gni") + sysroot = ios_sdk_path +} else { + sysroot = "" +} diff --git a/build/config/ui.gni b/build/config/ui.gni new file mode 100644 index 0000000000..b9969c06e3 --- /dev/null +++ b/build/config/ui.gni @@ -0,0 +1,61 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file contains UI-related build flags. It should theoretically be in the +# src/ui directory and only things that depend on the ui module should get the +# definitions. +# +# However, today we have many "bad" dependencies on some of these flags from, +# e.g. base, so they need to be global. + +declare_args() { + # True means the UI is built useing the "views" framework. + toolkit_views = false + + # Indicates if Ash is enabled. Ash is the Aura SHell which provides a + # desktop-like environment for Aura. Requires use_aura = true + use_ash = false + + # Indicates if Aura is enabled. Aura is a low-level windowing library, sort + # of a replacement for GDI or GTK. + use_aura = false + + # Indicates if Ozone is enabled. Ozone is a low-level library layer for Linux + # that does not require X11. + use_ozone = false +} + +if (is_win || is_chromeos) { + # Windows currelty implies Aura. + # TODO(brettw) bug 342937 move to declare_args block. + use_ash = true + use_aura = true +} + +if (is_linux || use_ozone) { + use_aura = true +} + +if (!use_aura) { + use_ash = false # Ash needs Aura. +} + +# TODO(brettw) bug 342937 move this to the declare_args block above when this +# is supported. It would look like: +# toolkit_views = is_win || is_chromeos || use_aura +if (is_win || is_chromeos || use_aura) { + toolkit_views = true +} + +# Additional dependent variables ----------------------------------------------- +# +# These variables depend on other variables and can't be set externally. + +# Indicates if the UI toolkit depends on GTK. +toolkit_uses_gtk = is_linux && !is_chromeos && !use_aura && !use_ozone + +# Indicates if the UI toolkit depends on X11. +use_x11 = is_linux && !use_ozone + +use_glib = is_linux diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn index 8bedbf581c..39a05013f1 100644 --- a/build/config/win/BUILD.gn +++ b/build/config/win/BUILD.gn @@ -2,13 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/win/visual_studio_version.gni") + declare_args() { # Full path to the Windows SDK, not including a backslash at the end. + # This value is the default location, override if you have a different + # installation location. windows_sdk_path = "C:\Program Files (x86)\Windows Kits\8.0" - - # Full path to the Visual Studio installation, not including a backslash - # at the end. - visual_studio_path = "C:\Program Files (x86)\Microsoft Visual Studio 10.0" } # Compiler setup for the Windows SDK. Applied to all targets. @@ -61,15 +61,15 @@ config("sdk_link") { "$visual_studio_path\VC\lib", "$visual_studio_path\VC\atlmfc\lib", ] - #if (!is_asan) { TODO(brettw) Address Sanitizer - # ldflags += "/largeaddressaware" - #} + if (!is_asan) { + ldflags += [ "/largeaddressaware" ] + } } } # This default linker setup is provided separately from the SDK setup so -# targets who want different libraries linked can remove this and specify their -# own. +# targets who want different library configurations can remove this and specify +# their own. config("common_linker_setup") { ldflags = [ "/FIXED:NO", @@ -85,38 +85,11 @@ config("common_linker_setup") { # Chrome.dll don't stick from one launch to the next. For this reason, we # turn ASLR off in debug builds. if (is_debug) { - ldflags += "/DYNAMICBASE:NO" + ldflags += [ "/DYNAMICBASE:NO" ] } else { - ldflags += "/DYNAMICBASE" + ldflags += [ "/DYNAMICBASE" ] } - # Common libraries. - libs = [ - "advapi32.lib", - "comdlg32.lib", - "dbghelp.lib", - "delayimp.lib", - "dnsapi.lib", - "gdi32.lib", - "kernel32.lib", - "msimg32.lib", - "odbc32.lib", - "odbccp32.lib", - "ole32.lib", - "oleaut32.lib", - "psapi.lib", - "shell32.lib", - "shlwapi.lib", - "user32.lib", - "usp10.lib", - "uuid.lib", - "version.lib", - "wininet.lib", - "winmm.lib", - "winspool.lib", - "ws2_32.lib", - ] - # Delay loaded DLLs. ldflags += [ "/DELAYLOAD:dbghelp.dll", diff --git a/build/config/win/get_visual_studio_path.py b/build/config/win/get_visual_studio_path.py new file mode 100644 index 0000000000..ae132adea4 --- /dev/null +++ b/build/config/win/get_visual_studio_path.py @@ -0,0 +1,176 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import errno +import glob +import os +import re +import subprocess +import sys + +""" +This script searches for Visual Studio versions on the current system. + +Pass in the preferred VS version on the command line, or pass "auto" for +autodetect. + +This script prints a string containing the VS root directory. On failure it +returns the empty string. +""" + +def _ConvertToCygpath(path): + """Convert to cygwin path if we are using cygwin.""" + if sys.platform == 'cygwin': + p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE) + path = p.communicate()[0].strip() + return path + + +def _RegistryQueryBase(sysdir, key, value): + """Use reg.exe to read a particular key. + + While ideally we might use the win32 module, we would like gyp to be + python neutral, so for instance cygwin python lacks this module. + + Arguments: + sysdir: The system subdirectory to attempt to launch reg.exe from. + key: The registry key to read from. + value: The particular value to read. + Return: + stdout from reg.exe, or None for failure. + """ + # Setup params to pass to and attempt to launch reg.exe + cmd = [os.path.join(os.environ.get('WINDIR', ''), sysdir, 'reg.exe'), + 'query', key] + if value: + cmd.extend(['/v', value]) + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid + # Note that the error text may be in [1] in some cases + text = p.communicate()[0] + # Check return code from reg.exe; officially 0==success and 1==error + if p.returncode: + return None + return text + + +def _RegistryQuery(key, value=None): + """Use reg.exe to read a particular key through _RegistryQueryBase. + + First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If + that fails, it falls back to System32. Sysnative is available on Vista and + up and available on Windows Server 2003 and XP through KB patch 942589. Note + that Sysnative will always fail if using 64-bit python due to it being a + virtual directory and System32 will work correctly in the first place. + + KB 942589 - http://support.microsoft.com/kb/942589/en-us. + + Arguments: + key: The registry key. + value: The particular registry value to read (optional). + Return: + stdout from reg.exe, or None for failure. + """ + text = None + try: + text = _RegistryQueryBase('Sysnative', key, value) + except OSError, e: + if e.errno == errno.ENOENT: + text = _RegistryQueryBase('System32', key, value) + else: + raise + return text + + +def _RegistryGetValue(key, value): + """Use reg.exe to obtain the value of a registry key. + + Args: + key: The registry key. + value: The particular registry value to read. + Return: + contents of the registry key's value, or None on failure. + """ + text = _RegistryQuery(key, value) + if not text: + return None + # Extract value. + match = re.search(r'REG_\w+\s+([^\r]+)\r\n', text) + if not match: + return None + return match.group(1) + + +def _DetectVisualStudioVersion(versions_to_check, force_express): + """Gets the path of the preferred Visual Studio version. + + Returns: + The base path of Visual Studio based on the registry and a quick check if + devenv.exe exists. + + Possibilities are: + 2010(e) - Visual Studio 2010 (10) + 2012(e) - Visual Studio 2012 (11) + 2013(e) - Visual Studio 2013 (12) + Where (e) is e for express editions of MSVS and blank otherwise. + """ + versions = [] + for version in versions_to_check: + # Old method of searching for which VS version is installed + # We don't use the 2010-encouraged-way because we also want to get the + # path to the binaries, which it doesn't offer. + keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version, + r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version, + r'HKLM\Software\Microsoft\VCExpress\%s' % version, + r'HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s' % version] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], 'InstallDir') + if not path: + continue + path = _ConvertToCygpath(path) + # Check for full. + full_path = os.path.join(path, 'devenv.exe') + express_path = os.path.join(path, '*express.exe') + if not force_express and os.path.exists(full_path): + return os.path.normpath(os.path.join(path, '..', '..')) + # Check for express. + elif glob.glob(express_path): + return os.path.normpath(os.path.join(path, '..', '..')) + + # The old method above does not work when only SDK is installed. + keys = [r'HKLM\Software\Microsoft\VisualStudio\SxS\VC7', + r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7'] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], version) + if not path: + continue + path = _ConvertToCygpath(path) + return os.path.normpath(os.path.join(path, '..')) + + return None + +if len(sys.argv) != 2: + print 'Usage: get_visual_studio_path.py <version>' + print 'Use "auto" for the version to autodetect.' + sys.exit(2) +version_map = { + 'auto': ('10.0', '12.0', '11.0'), + '2010': ('10.0',), + '2010e': ('10.0',), + '2012': ('11.0',), + '2012e': ('11.0',), + '2013': ('12.0',), + '2013e': ('12.0',), +} + +requested_version = sys.argv[1] +vs_path = _DetectVisualStudioVersion(version_map[requested_version], + 'e' in requested_version) +if not vs_path: + # No Visual Studio version detected. + print '""' # Return empty string to .gn file. + sys.exit(1); + +# Return Visual Studio path to the .gn file. +print '"%s"' % vs_path diff --git a/build/config/win/visual_studio_version.gni b/build/config/win/visual_studio_version.gni new file mode 100644 index 0000000000..79b58418ba --- /dev/null +++ b/build/config/win/visual_studio_version.gni @@ -0,0 +1,36 @@ +# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+declare_args() {
+ # Version of Visual Studio to use.
+ #
+ # Possible values:
+ # - "auto"
+ # - "2010"
+ # - "2010e"
+ # - "2012"
+ # - "2012e"
+ # - "2013"
+ # - "2013e"
+ #
+ # The "e" variants denote "Express". The default, "auto" will find the
+ # preferred one of all Visual Studios installed on the current system.
+ visual_studio_version = "auto"
+
+ # The path to use as the root of a Visual Studio install. If nonempty,
+ # this path will be used instead of any autodetected install locations,
+ # which allows you to have the Visual Studio files in a directory without
+ # actually "installing" it.
+ #
+ # When empty, we will autodetect the best Visual Studio path to use. The
+ # autodetected one is usually something like
+ # "C:\Program Files (x86)\Microsoft Visual Studio 10.0".
+ visual_studio_path = ""
+}
+
+if (visual_studio_path == "") {
+ visual_studio_path = exec_script("get_visual_studio_path.py",
+ [ visual_studio_version ], "value")
+}
+
diff --git a/build/get_landmines.py b/build/get_landmines.py index 05c9de6962..007ebe94ee 100755 --- a/build/get_landmines.py +++ b/build/get_landmines.py @@ -14,7 +14,7 @@ import sys import landmine_utils -builder = landmine_utils.platform +builder = landmine_utils.builder distributor = landmine_utils.distributor gyp_defines = landmine_utils.gyp_defines gyp_msvs_version = landmine_utils.gyp_msvs_version @@ -37,12 +37,20 @@ def print_landmines(target): print 'Builders switching from make to ninja will clobber on this.' if platform() == 'mac': print 'Switching from bundle to unbundled dylib (issue 14743002).' + if platform() in ('win', 'mac'): + print ('Improper dependency for create_nmf.py broke in r240802, ' + 'fixed in r240860.') if (platform() == 'win' and builder() == 'ninja' and gyp_msvs_version() == '2012' and gyp_defines().get('target_arch') == 'x64' and gyp_defines().get('dcheck_always_on') == '1'): print "Switched win x64 trybots from VS2010 to VS2012." + if (platform() == 'win' and builder() == 'ninja' and + gyp_msvs_version().startswith('2013')): + print "Switched win from VS2010 to VS2013." print 'Need to clobber everything due to an IDL change in r154579 (blink)' + if (platform() != 'ios'): + print 'Clobber to get rid of obselete test plugin after r248358' def main(): diff --git a/build/grit_action.gypi b/build/grit_action.gypi index e8b98b43dd..a247d7e8c2 100644 --- a/build/grit_action.gypi +++ b/build/grit_action.gypi @@ -36,6 +36,5 @@ '-o', '<(grit_out_dir)', '<@(grit_defines)', '<@(grit_additional_defines)' ], - 'msvs_cygwin_shell': 0, 'message': 'Generating resources from <(grit_grd_file)', } diff --git a/build/gyp_chromium b/build/gyp_chromium index 03308589c8..e4cafc7561 100755 --- a/build/gyp_chromium +++ b/build/gyp_chromium @@ -12,6 +12,7 @@ import gyp_helper import os import pipes import shlex +import shutil import subprocess import string import sys @@ -26,6 +27,7 @@ import gyp SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Add paths so that pymod_do_main(...) can import files. +sys.path.insert(1, os.path.join(chrome_src, 'tools')) sys.path.insert(1, os.path.join(chrome_src, 'tools', 'generate_shim_headers')) sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit')) sys.path.insert(1, os.path.join(chrome_src, 'chrome', 'tools', 'build')) @@ -37,6 +39,8 @@ sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'liblouis')) sys.path.insert(1, os.path.join(chrome_src, 'third_party', 'WebKit', 'Source', 'build', 'scripts')) +import find_depot_tools + # On Windows, Psyco shortens warm runs of build/gyp_chromium by about # 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70 # seconds. Conversely, memory usage of build/gyp_chromium with Psyco @@ -74,13 +78,32 @@ def FormatKeyForGN(key): def EscapeStringForGN(s): """Converts a string to a GN string literal.""" - # Escape $ characters which have special meaning to GN. - return '"' + s.replace('$', '\\$').replace('"', '\\"') + '"' + for old, new in [('\\', '\\\\'), ('$', '\\$'), ('"', '\\"')]: + s = s.replace(old, new) + return '"' + s + '"' -def GetVarsStringForGN(supplemental_files): - vars_dict = {} +def ProcessGypDefinesItems(items): + """Converts a list of strings to a list of key-value pairs.""" + result = [] + for item in items: + tokens = item.split('=', 1) + # Some GYP variables have hyphens, which we don't support. + key = FormatKeyForGN(tokens[0]) + if len(tokens) == 2: + result += [(key, tokens[1])] + else: + # No value supplied, treat it as a boolean and set it. Note that we + # use the string '1' here so we have a consistent definition whether + # you do 'foo=1' or 'foo'. + result += [(key, '1')] + return result +def GetGypVarsForGN(supplemental_files): + """Returns a dictionary of all GYP vars that we will be passing to GN.""" + + # GYP defines from the supplemental.gypi files. + supp_items = [] for supplement in supplemental_files: with open(supplement, 'r') as f: try: @@ -90,24 +113,156 @@ def GetVarsStringForGN(supplemental_files): raise variables = file_data.get('variables', []) for v in variables: - vars_dict[FormatKeyForGN(v)] = EscapeStringForGN(str(variables[v])) - - env_string = os.environ.get('GYP_DEFINES', '') - items = shlex.split(env_string) - for item in items: - tokens = item.split('=', 1) - # Some GYP variables have hyphens, which we don't support. - key = FormatKeyForGN(tokens[0]) - if len(tokens) == 2: - vars_dict[key] = EscapeStringForGN(tokens[1]) + supp_items += [(FormatKeyForGN(v), str(variables[v]))] + + # GYP defines from the environment. + env_items = ProcessGypDefinesItems( + shlex.split(os.environ.get('GYP_DEFINES', ''))) + + # GYP defines from the command line. We can't use optparse since we want + # to ignore all arguments other than "-D". + cmdline_input_items = [] + for i in range(len(sys.argv))[1:]: + if sys.argv[i].startswith('-D'): + if sys.argv[i] == '-D' and i + 1 < len(sys.argv): + cmdline_input_items += [sys.argv[i + 1]] + elif len(sys.argv[i]) > 2: + cmdline_input_items += [sys.argv[i][2:]] + cmdline_items = ProcessGypDefinesItems(cmdline_input_items) + + return dict(supp_items + env_items + cmdline_items) + +def GetOutputDirectory(): + """Returns the output directory that GYP will use.""" + # GYP generator flags from the command line. We can't use optparse since we + # want to ignore all arguments other than "-G". + needle = '-Goutput_dir=' + cmdline_input_items = [] + for item in sys.argv[1:]: + if item.startswith(needle): + return item[len(needle):] + + env_items = shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', '')) + needle = 'output_dir=' + for item in env_items: + if item.startswith(needle): + return item[len(needle):] + + return "out" + +def GetArgsStringForGN(supplemental_files): + """Returns the args to pass to GN. + Based on a subset of the GYP variables that have been rewritten a bit.""" + + # Find the .gyp directory in the user's home directory. + home_dot_gyp = os.environ.get('GYP_CONFIG_DIR', None) + if home_dot_gyp: + home_dot_gyp = os.path.expanduser(home_dot_gyp) + if not home_dot_gyp: + home_vars = ['HOME'] + if sys.platform in ('cygwin', 'win32'): + home_vars.append('USERPROFILE') + for home_var in home_vars: + home = os.getenv(home_var) + if home != None: + home_dot_gyp = os.path.join(home, '.gyp') + if not os.path.exists(home_dot_gyp): + home_dot_gyp = None + else: + break + + if home_dot_gyp: + include_gypi = os.path.join(home_dot_gyp, "include.gypi") + if os.path.exists(include_gypi): + supplemental_files += [include_gypi] + + vars_dict = GetGypVarsForGN(supplemental_files) + gn_args = '' + + # Note: These are the additional flags passed to various builds by builders + # on the main waterfall. We'll probably need to add these at some point: + # mac_strip_release=1 http://crbug.com/330301 + # linux_dump_symbols=0 http://crbug.com/330300 + # host_os=linux Probably can skip, GN knows the host OS. + # order_text_section=<path> http://crbug.com/330299 + # chromium_win_pch=0 http://crbug.com/297678 + # chromium_ios_signing=0 http://crbug.com/330302 + # linux_use_tcmalloc=0 http://crbug.com/330303 + # release_extra_flags=... http://crbug.com/330305 + + # These tuples of (key, value, gn_arg_string) use the gn_arg_string for + # gn when the key is set to the given value in the GYP arguments. + remap_cases = [ + ('android_webview_build', '1', 'is_android_webview_build=true'), + ('branding', 'Chrome', 'is_chrome_branded=true'), + ('build_for_tool', 'drmemory', 'disable_iterator_debugging=true'), + ('build_for_tool', 'tsan', 'disable_iterator_debugging=true'), + ('buildtype', 'Official', 'is_official_build=true'), + ('component', 'shared_library', 'is_component_build=true'), + ('clang', '1', 'is_clang=true'), + ('clang_use_chrome_plugins', '0', 'clang_use_chrome_plugins=false'), + ('disable_glibcxx_debug', '1', 'disable_iterator_debugging=true'), + ('target_arch', 'ia32', 'cpu_arch="x86"'), + ('target_arch', 'x64', 'cpu_arch="x64" force_win64=true'), + ('target_arch', 'arm', 'cpu_arch="arm"'), + ('target_arch', 'mipsel', 'cpu_arch="mipsel"'), + ('fastbuild', '0', 'symbol_level=2'), + ('fastbuild', '1', 'symbol_level=1'), + ('fastbuild', '2', 'symbol_level=0'), + ('OS', 'ios', 'os="ios"'), + ('OS', 'android', 'os="android"'), + ('chromeos', '1', 'os="chromeos"'), + ('use_aura', '1', 'use_aura=true'), + ('use_goma', '1', 'use_goma=true'), + ('asan', '1', 'is_asan=true'), + ('lsan', '1', 'is_lsan=true'), + ('msan', '1', 'is_msan=true'), + ('tsan', '1', 'is_tsan=true'), + ] + for i in remap_cases: + if i[0] in vars_dict and vars_dict[i[0]] == i[1]: + gn_args += ' ' + i[2] + + # These string arguments get passed directly as GN strings. + for v in ['android_src', 'arm_float_abi', 'ios_deployment_target', + 'ios_sdk_path', 'windows_sdk_path']: + if v in vars_dict: + gn_args += ' ' + v + '=' + EscapeStringForGN(vars_dict[v]) + + # gomadir is renamed goma_dir in the GN build. + if 'gomadir' in vars_dict: + gn_args += ' goma_dir=%s' % EscapeStringForGN(vars_dict['gomadir']) + + # Set the "use_ios_simulator" flag if the ios_sdk_path is set. + if 'ios_sdk_path' in vars_dict: + if os.path.basename(vars_dict['ios_sdk_path']).lower().startswith( + 'iphonesimulator'): + gn_args += ' use_ios_simulator=true' else: - # No value supplied, treat it as a boolean and set it. - vars_dict[key] = 'true' + gn_args += ' use_ios_simulator=false' + + # These arguments get passed directly as integers (avoiding the quoting and + # escaping of the string ones above). + for v in ['arm_version']: + if v in vars_dict: + gn_args += ' %s=%s' % (v, vars_dict[v]) - vars_string = '' - for v in vars_dict: - vars_string = vars_string + v + '=' + vars_dict[v] + ' ' - return vars_string.strip() # Remove trailing space. + # Some other flags come from GYP environment variables. + gyp_msvs_version = os.environ.get('GYP_MSVS_VERSION', '') + if gyp_msvs_version: + gn_args += ' visual_studio_version=' + EscapeStringForGN(gyp_msvs_version) + gyp_msvs_override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH', '') + if gyp_msvs_override_path: + gn_args += ' visual_studio_path=' + \ + EscapeStringForGN(gyp_msvs_override_path) + + # Set the GYP flag so BUILD files know they're being invoked in GYP mode. + gn_args += ' is_gyp=true' + + gyp_outdir = GetOutputDirectory() + gn_args += ' gyp_output_dir=\"%s\"' % gyp_outdir + + return gn_args.strip() def additional_include_files(supplemental_files, args=[]): @@ -161,18 +316,50 @@ def RunGN(supplemental_includes): return False print 'Generating gyp files from GN...' - gyp_vars = GetVarsStringForGN(supplemental_includes) # Need to pass both the source root (the bots don't run this command from # within the source tree) as well as set the is_gyp value so the BUILD files # to know they're being run under GYP. args = [gnpath, 'gyp', '-q', '--root=' + chrome_src, - '--args=is_gyp=true', - '--gyp_vars=' + gyp_vars + ''] + '--args=' + GetArgsStringForGN(supplemental_includes), + '--output=//' + GetOutputDirectory() + '/gn_build/'] return subprocess.call(args) == 0 +def CopyVsRuntimeDlls(output_dir, runtime_dirs): + """Copies the VS runtime DLLs from the given |runtime_dirs| to the output + directory so that even if not system-installed, built binaries are likely to + be able to run. + + This needs to be run after gyp has been run so that the expected target + output directories are already created. + """ + assert sys.platform.startswith(('win32', 'cygwin')) + + def copy_runtime(target_dir, source_dir, dll_pattern): + """Copy both the msvcr and msvcp runtime DLLs, only if the target doesn't + exist, but the target directory does exist.""" + for which in ('p', 'r'): + dll = dll_pattern % which + target = os.path.join(target_dir, dll) + source = os.path.join(source_dir, dll) + # If gyp generated to that output dir, and the runtime isn't already + # there, then copy it over. + if os.path.isdir(target_dir) and not os.path.isfile(target): + shutil.copyfile(source, target) + + x86, x64 = runtime_dirs + out_debug = os.path.join(output_dir, 'Debug') + out_release = os.path.join(output_dir, 'Release') + out_debug_x64 = os.path.join(output_dir, 'Debug_x64') + out_release_x64 = os.path.join(output_dir, 'Release_x64') + copy_runtime(out_debug, x86, 'msvc%s120d.dll') + copy_runtime(out_release, x86, 'msvc%s120.dll') + copy_runtime(out_debug_x64, x64, 'msvc%s120d.dll') + copy_runtime(out_release_x64, x64, 'msvc%s120.dll') + + if __name__ == '__main__': args = sys.argv[1:] @@ -189,7 +376,9 @@ if __name__ == '__main__': # TODO(bradnelson): take this out once this issue is fixed: # http://code.google.com/p/gyp/issues/detail?id=177 if sys.platform == 'cygwin': - python_dir = os.path.join(chrome_src, 'third_party', 'python_26') + depot_tools_path = find_depot_tools.add_depot_tools_to_path() + python_dir = sorted(glob.glob(os.path.join(depot_tools_path, + 'python2*_bin')))[-1] env = os.environ.copy() env['PATH'] = python_dir + os.pathsep + env.get('PATH', '') p = subprocess.Popen( @@ -219,14 +408,6 @@ if __name__ == '__main__': else: args.append(os.path.join(script_dir, 'all.gyp')) - supplemental_includes = GetSupplementalFiles() - - if not RunGN(supplemental_includes): - sys.exit(1) - - args.extend( - ['-I' + i for i in additional_include_files(supplemental_includes, args)]) - # There shouldn't be a circular dependency relationship between .gyp files, # but in Chromium's .gyp files, on non-Mac platforms, circular relationships # currently exist. The check for circular dependencies is currently @@ -239,50 +420,52 @@ if __name__ == '__main__': if sys.platform not in ('darwin',): args.append('--no-circular-check') - # Default to ninja on linux, but only if no generator has explicitly been set. + # Default to ninja on linux and windows, but only if no generator has + # explicitly been set. # Also default to ninja on mac, but only when not building chrome/ios. # . -f / --format has precedence over the env var, no need to check for it # . set the env var only if it hasn't been set yet # . chromium.gyp_env has been applied to os.environ at this point already if sys.platform.startswith('linux') and not os.environ.get('GYP_GENERATORS'): os.environ['GYP_GENERATORS'] = 'ninja' + if sys.platform.startswith('win') and not os.environ.get('GYP_GENERATORS'): + os.environ['GYP_GENERATORS'] = 'ninja' elif sys.platform == 'darwin' and not os.environ.get('GYP_GENERATORS') and \ not 'OS=ios' in os.environ.get('GYP_DEFINES', []): os.environ['GYP_GENERATORS'] = 'ninja' - # If using ninja on windows, and not opting out of the the automatic - # toolchain, then set up variables for the automatic toolchain. Opt-out is - # on by default, for now. - if (sys.platform in ('win32', 'cygwin') and - os.environ.get('GYP_GENERATORS') == 'ninja' and - os.environ.get('GYP_MSVS_USE_SYSTEM_TOOLCHAIN', '1') != '1'): - # For now, call the acquisition script here so that there's only one - # opt-in step required. This will be moved to a separate DEPS step once - # it's on by default. - subprocess.check_call([ - sys.executable, - os.path.normpath(os.path.join(script_dir, '..', 'tools', 'win', - 'toolchain', - 'get_toolchain_if_necessary.py'))]) + # If on windows, and the automatic toolchain has been installed by + # depot_tools, then use it. + vs2013_runtime_dll_dirs = None + if sys.platform in ('win32', 'cygwin'): + depot_tools_path = find_depot_tools.add_depot_tools_to_path() toolchain = os.path.normpath(os.path.join( - script_dir, '..', 'third_party', 'win_toolchain', 'files')) - os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain - os.environ['GYP_MSVS_VERSION'] = '2013' - # We need to make sure windows_sdk_path is set to the automated toolchain - # values in GYP_DEFINES, but don't want to override any other values there. - gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) - win8sdk = os.path.join(toolchain, 'win8sdk') - gyp_defines_dict['windows_sdk_path'] = win8sdk - os.environ['WINDOWSSDKDIR'] = win8sdk - os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) - for k, v in gyp_defines_dict.iteritems()) - # Include the VS runtime in the PATH in case it's not machine-installed. - runtime_path = ';'.join( - os.path.normpath(os.path.join( - script_dir, '..', 'third_party', 'win_toolchain', 'files', s)) - for s in ('sys64', 'sys32')) - os.environ['PATH'] = runtime_path + os.environ['PATH'] - print('Using automatic toolchain in %s.' % toolchain) + depot_tools_path, 'win_toolchain', 'vs2013_files')) + version_file = os.path.join(toolchain, '.version') + if os.path.isdir(toolchain) and os.path.isfile(version_file): + os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain + with open(version_file, 'r') as f: + version_is_pro = f.read().strip() == 'pro' + vs2013_runtime_dll_dirs = (os.path.join(toolchain, 'sys32'), + os.path.join(toolchain, 'sys64')) + os.environ['GYP_MSVS_VERSION'] = '2013' if version_is_pro else '2013e' + # We need to make sure windows_sdk_path is set to the automated + # toolchain values in GYP_DEFINES, but don't want to override any other + # values there. + gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) + win8sdk = os.path.join(toolchain, 'win8sdk') + wdk = os.path.join(toolchain, 'wdk') + gyp_defines_dict['windows_sdk_path'] = win8sdk + os.environ['WINDOWSSDKDIR'] = win8sdk + os.environ['WDK_DIR'] = wdk + os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) + for k, v in gyp_defines_dict.iteritems()) + # Include the VS runtime in the PATH in case it's not machine-installed. + runtime_path = ';'.join(os.path.normpath(os.path.join(toolchain, s)) + for s in ('sys64', 'sys32')) + os.environ['PATH'] = runtime_path + ';' + os.environ['PATH'] + print('Using automatic toolchain in %s (%s edition).' % ( + toolchain, 'Pro' if version_is_pro else 'Express')) # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check # to enfore syntax checking. @@ -290,8 +473,28 @@ if __name__ == '__main__': if syntax_check and int(syntax_check): args.append('--check') + supplemental_includes = GetSupplementalFiles() + if not RunGN(supplemental_includes): + sys.exit(1) + args.extend( + ['-I' + i for i in additional_include_files(supplemental_includes, args)]) + + args.extend(['-D', 'gyp_output_dir=' + GetOutputDirectory()]) + print 'Updating projects from gyp files...' sys.stdout.flush() # Off we go... - sys.exit(gyp.main(args)) + gyp_rc = gyp.main(args) + + # Check for landmines (reasons to clobber the build). This must be run here, + # rather than a separate runhooks step so that any environment modifications + # from above are picked up. + print 'Running build/landmines.py...' + subprocess.check_call( + [sys.executable, os.path.join(script_dir, 'landmines.py')]) + + if vs2013_runtime_dll_dirs: + CopyVsRuntimeDlls(GetOutputDirectory(), vs2013_runtime_dll_dirs) + + sys.exit(gyp_rc) diff --git a/build/gyp_helper.py b/build/gyp_helper.py index 81242783c4..eadc7a5fb5 100644 --- a/build/gyp_helper.py +++ b/build/gyp_helper.py @@ -34,6 +34,7 @@ def apply_gyp_environment_from_file(file_path): 'GYP_CROSSCOMPILE', 'GYP_GENERATOR_OUTPUT', 'GYP_GENERATORS', + 'GYP_MSVS_VERSION', ) for var in supported_vars: file_val = file_data.get(var) diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index 48e2c76dcc..4a7bcb706b 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh @@ -16,6 +16,8 @@ usage() { echo "--[no-]arm: enable or disable installation of arm cross toolchain" echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ "fonts" + echo "--[no-]nacl: enable or disable installation of prerequisites for"\ + "building standalone NaCl and all its toolchains" echo "--no-prompt: silently select standard options/defaults" echo "--quick-check: quickly try to determine if dependencies are installed" echo " (this avoids interactive prompts and sudo commands," @@ -31,6 +33,13 @@ package_exists() { apt-cache pkgnames | grep -x "$1" > /dev/null 2>&1 } +# These default to on because (some) bots need them and it keeps things +# simple for the bot setup if all bots just run the script in its default +# mode. Developers who don't want stuff they don't need installed on their +# own workstations can pass --no-arm --no-nacl when running the script. +do_inst_arm=1 +do_inst_nacl=1 + while test "$1" != "" do case "$1" in @@ -42,6 +51,8 @@ do --no-arm) do_inst_arm=0;; --chromeos-fonts) do_inst_chromeos_fonts=1;; --no-chromeos-fonts) do_inst_chromeos_fonts=0;; + --nacl) do_inst_nacl=1;; + --no-nacl) do_inst_nacl=0;; --no-prompt) do_default=1 do_quietly="-qq --assume-yes" ;; @@ -52,8 +63,8 @@ do shift done -ubuntu_versions="12\.04|12\.10|13\.04" -ubuntu_codenames="precise|quantal|raring" +ubuntu_versions="12\.04|12\.10|13\.04|13\.10" +ubuntu_codenames="precise|quantal|raring|saucy" ubuntu_issue="Ubuntu ($ubuntu_versions|$ubuntu_codenames)" # GCEL is an Ubuntu-derived VM image used on Google Compute Engine; /etc/issue # doesn't contain a version number so just trust that the user knows what @@ -62,7 +73,7 @@ gcel_issue="^GCEL" if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then if ! egrep -q "($ubuntu_issue|$gcel_issue)" /etc/issue; then - echo "ERROR: Only Ubuntu 12.04 (precise) through 13.04 (raring) are"\ + echo "ERROR: Only Ubuntu 12.04 (precise) through 13.10 (saucy) are"\ "currently supported" >&2 exit 1 fi @@ -83,8 +94,8 @@ fi chromeos_dev_list="libbluetooth-dev" # Packages needed for development -dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ git-core gperf - language-pack-da language-pack-fr language-pack-he +dev_list="apache2.2-bin bison curl dpkg-dev elfutils fakeroot flex g++ git-core + gperf language-pack-da language-pack-fr language-pack-he language-pack-zh-hant libapache2-mod-php5 libasound2-dev libbrlapi-dev libbz2-dev libcairo2-dev libcap-dev libcups2-dev libcurl4-gnutls-dev libdrm-dev libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev @@ -95,7 +106,7 @@ dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ git-core gperf mesa-common-dev openbox patch perl php5-cgi pkg-config python python-cherrypy3 python-dev python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts ttf-kochi-gothic ttf-kochi-mincho - ttf-thai-tlwg wdiff xfonts-mathml $chromeos_dev_list" + wdiff xfonts-mathml $chromeos_dev_list" # 64-bit systems need a minimum set of 32-bit compat packages for the pre-built # NaCl binaries. These are always needed, regardless of whether or not we want @@ -144,6 +155,9 @@ armel_list="libc6-armel-cross libc6-dev-armel-cross libgcc1-armel-cross # TODO(sbc): remove armel once the armhf transition is complete arm_list="$arm_list $armel_list" +# Packages to build standalone NaCl and all its toolchains. +nacl_list="g++-mingw-w64-i686 libtinfo-dev:i386" + # Some package names have changed over time if package_exists ttf-mscorefonts-installer; then dev_list="${dev_list} ttf-mscorefonts-installer" @@ -246,21 +260,23 @@ if file /sbin/init | grep -q 'ELF 64-bit'; then fi if test "$do_inst_arm" = "1" ; then - . /etc/lsb-release - if ! [ "${DISTRIB_CODENAME}" = "precise" -o \ - 1 -eq "${do_unsupported-0}" ]; then - echo "ERROR: Installing the ARM cross toolchain is only available on" \ - "Ubuntu precise." >&2 - exit 1 - fi echo "Including ARM cross toolchain." else echo "Skipping ARM cross toolchain." arm_list= fi -packages="$(echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list}" | \ - tr " " "\n" | sort -u | tr "\n" " ")" +if test "$do_inst_nacl" = "1"; then + echo "Including standalone NaCl dependencies." +else + echo "Skipping standalone NaCl dependencies." + nacl_list= +fi + +packages="$( + echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list} ${nacl_list}" | + tr " " "\n" | sort -u | tr "\n" " " +)" if [ 1 -eq "${do_quick_check-0}" ] ; then failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ diff --git a/build/ios/PRESUBMIT.py b/build/ios/PRESUBMIT.py index 7f3dacd1d7..a0d32f8b9e 100644 --- a/build/ios/PRESUBMIT.py +++ b/build/ios/PRESUBMIT.py @@ -16,10 +16,13 @@ def _CheckWhitelistSorted(input_api, output_api): for path in input_api.LocalPaths(): if WHITELIST_FILE == path: lines = open(os.path.join('../..', WHITELIST_FILE)).readlines() - sorted = all(lines[i] <= lines[i + 1] for i in xrange(len(lines) - 1)) - if not sorted: + i = 0 + while i < len(lines) - 1 and lines[i] <= lines[i + 1]: + i += 1 + if i < len(lines) - 1: return [output_api.PresubmitError( - 'The file ' + WHITELIST_FILE + ' must be sorted.')] + 'The file ' + WHITELIST_FILE + ' must be sorted. ' + + 'First offending line: #' + str(i + 2))] return [] def _CommonChecks(input_api, output_api): diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt index b37498673d..0f0949f559 100644 --- a/build/ios/grit_whitelist.txt +++ b/build/ios/grit_whitelist.txt @@ -25,8 +25,6 @@ IDR_NET_EXPORT_HTML IDR_NET_EXPORT_JS IDR_NET_INTERNALS_HELP_HTML IDR_NET_INTERNALS_HELP_JS -IDR_NET_INTERNALS_INDEX_HTML -IDR_NET_INTERNALS_INDEX_JS IDR_OMAHA_HTML IDR_OMAHA_JS IDR_OMNIBOX_EXTENSION_APP @@ -55,7 +53,6 @@ IDR_SYNC_INTERNALS_DATA_JS IDR_SYNC_INTERNALS_EVENTS_JS IDR_SYNC_INTERNALS_INDEX_HTML IDR_SYNC_INTERNALS_INDEX_JS -IDR_SYNC_INTERNALS_NODE_BROWSER_JS IDR_SYNC_INTERNALS_NOTIFICATIONS_JS IDR_SYNC_INTERNALS_SEARCH_JS IDR_SYNC_INTERNALS_SYNC_LOG_JS @@ -65,7 +62,6 @@ IDR_SYNC_INTERNALS_TRAFFIC_JS IDR_THROBBER IDR_TRANSLATE_JS IDR_UPDATE_BADGE4 -IDR_UPDATE_MENU4 IDR_WEBUI_I18N_PROCESS_JS IDR_WEBUI_I18N_TEMPLATE2_JS IDR_WEBUI_I18N_TEMPLATE_JS @@ -94,11 +90,9 @@ IDS_ACCNAME_LOCATION IDS_ACCNAME_VOICE_SEARCH IDS_ALLOW_INSECURE_CONTENT_BUTTON IDS_ALTERNATE_NAV_URL_VIEW_LABEL -IDS_APP_LAUNCHER_OPEN_IN_APP_QUESTION_MESSAGE_MOBILE -IDS_APP_LAUNCHER_OPEN_IN_LABEL_MOBILE -IDS_APP_LAUNCHER_OPEN_ONCE_BUTTON_MOBILE IDS_APP_UNTITLED_SHORTCUT_FILE_NAME IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION +IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR IDS_AUTOFILL_ADDRESS_SUMMARY_SEPARATOR IDS_AUTOFILL_CC_AMEX IDS_AUTOFILL_CC_DINERS @@ -124,9 +118,6 @@ IDS_AUTOFILL_FIELD_LABEL_PREFECTURE IDS_AUTOFILL_FIELD_LABEL_PROVINCE IDS_AUTOFILL_FIELD_LABEL_STATE IDS_AUTOFILL_FIELD_LABEL_ZIP_CODE -IDS_AUTOFILL_FLOW_INFOBAR_ACCEPT -IDS_AUTOFILL_FLOW_INFOBAR_DENY -IDS_AUTOFILL_FLOW_INFOBAR_TEXT IDS_AUTOFILL_OPTIONS_POPUP IDS_AUTOFILL_WARNING_FORM_DISABLED IDS_AUTOFILL_WARNING_INSECURE_CONNECTION @@ -149,7 +140,6 @@ IDS_BOOKMARK_FOLDER_CHOOSER_TITLE IDS_BOOKMARK_FOLDER_EDITOR_TITLE IDS_BOOKMARK_FOLDER_EDITOR_WINDOW_TITLE IDS_BOOKMARK_FOLDER_EDITOR_WINDOW_TITLE_NEW -IDS_BOOKMARK_MANAGER_BOOKMARK_ALL_TABS IDS_BOOKMARK_MANAGER_FOLDER_SECTION IDS_BOOKMARK_MANAGER_FOLDER_TITLE IDS_BOOKMARK_MANAGER_NAME_INPUT_PLACE_HOLDER @@ -179,10 +169,6 @@ IDS_CERT_ERROR_INVALID_CERT_DESCRIPTION IDS_CERT_ERROR_INVALID_CERT_DETAILS IDS_CERT_ERROR_INVALID_CERT_EXTRA_INFO_2 IDS_CERT_ERROR_INVALID_CERT_TITLE -IDS_CERT_ERROR_NOT_IN_DNS_DESCRIPTION -IDS_CERT_ERROR_NOT_IN_DNS_DETAILS -IDS_CERT_ERROR_NOT_IN_DNS_EXTRA_INFO -IDS_CERT_ERROR_NOT_IN_DNS_TITLE IDS_CERT_ERROR_NOT_YET_VALID_DESCRIPTION IDS_CERT_ERROR_NOT_YET_VALID_DETAILS IDS_CERT_ERROR_NOT_YET_VALID_DETAILS_EXTRA_INFO_2 @@ -210,7 +196,6 @@ IDS_CERT_ERROR_WEAK_SIGNATURE_ALGORITHM_EXTRA_INFO_2 IDS_CERT_ERROR_WEAK_SIGNATURE_ALGORITHM_TITLE IDS_CHROME_TO_DEVICE_PRINT_TO_PHONE IDS_CHROME_TO_DEVICE_SNAPSHOTS -IDS_COPY_URL_MAC IDS_COULDNT_OPEN_PROFILE_ERROR IDS_CRASHES_BUG_LINK_LABEL IDS_CRASHES_CRASH_COUNT_BANNER_FORMAT @@ -245,7 +230,6 @@ IDS_DEFAULT_TAB_TITLE IDS_DELETE IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION IDS_DISABLE_TOUCH_ADJUSTMENT_NAME -IDS_DOM_DISTILLER_TITLE IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD_FAILED IDS_DOM_DISTILLER_WEBUI_ENTRY_URL @@ -257,10 +241,6 @@ IDS_EDIT_FIND_MAC IDS_EMPTY_KEYWORD_VALUE IDS_ENABLE_BACKLOADER_DESCRIPTION IDS_ENABLE_BACKLOADER_NAME -IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION -IDS_ENABLE_BEZEL_TOUCH_NAME -IDS_ENABLE_TAB_CAPTURE_DESCRIPTION -IDS_ENABLE_TAB_CAPTURE_NAME IDS_ERRORPAGES_BUTTON_LESS IDS_ERRORPAGES_BUTTON_MORE IDS_ERRORPAGES_BUTTON_RELOAD @@ -299,12 +279,10 @@ IDS_ERRORPAGES_DETAILS_RESPONSE_HEADERS_MULTIPLE_LOCATION IDS_ERRORPAGES_DETAILS_SERVICE_UNAVAILABLE IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR IDS_ERRORPAGES_DETAILS_SSL_UNSAFE_NEGOTIATION -IDS_ERRORPAGES_DETAILS_TEMPLATE IDS_ERRORPAGES_DETAILS_TEMPORARILY_THROTTLED IDS_ERRORPAGES_DETAILS_TIMED_OUT IDS_ERRORPAGES_DETAILS_TOO_MANY_REDIRECTS IDS_ERRORPAGES_DETAILS_UNKNOWN -IDS_ERRORPAGES_DETAILS_UNSUPPORTED_SCHEME_ERROR IDS_ERRORPAGES_ERROR_CODE IDS_ERRORPAGES_HEADING_ACCESS_DENIED IDS_ERRORPAGES_HEADING_BAD_SSL_CLIENT_AUTH_CERT @@ -315,11 +293,9 @@ IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE IDS_ERRORPAGES_HEADING_DOWNLOAD_FILE_TYPE_ERROR IDS_ERRORPAGES_HEADING_DUPLICATE_HEADERS IDS_ERRORPAGES_HEADING_EMPTY_RESPONSE -IDS_ERRORPAGES_HEADING_ESET_ANTI_VIRUS_SSL_INTERCEPTION IDS_ERRORPAGES_HEADING_FILE_ACCESS_DENIED IDS_ERRORPAGES_HEADING_HTTP_SERVER_ERROR IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED -IDS_ERRORPAGES_HEADING_KASPERSKY_ANTI_VIRUS_SSL_INTERCEPTION IDS_ERRORPAGES_HEADING_NETWORK_ACCESS_DENIED IDS_ERRORPAGES_HEADING_NETWORK_IO_SUSPENDED IDS_ERRORPAGES_HEADING_NOT_AVAILABLE @@ -328,18 +304,13 @@ IDS_ERRORPAGES_HEADING_PINNING_FAILURE IDS_ERRORPAGES_HEADING_PROXY_CONNECTION_FAILED IDS_ERRORPAGES_HEADING_SSL_PROTOCOL_ERROR IDS_ERRORPAGES_HEADING_TOO_MANY_REDIRECTS -IDS_ERRORPAGES_HEADING_UNSUPPORTED_SCHEME_ERROR IDS_ERRORPAGES_HEADING_WEAK_SERVER_EPHEMERAL_DH_KEY -IDS_ERRORPAGES_HTTP_DETAILS_TEMPLATE IDS_ERRORPAGES_HTTP_POST_WARNING IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_BODY IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_HEADER IDS_ERRORPAGES_SUGGESTION_CONTACT_ADMINISTRATOR -IDS_ERRORPAGES_SUGGESTION_DISABLE_PLATFORM IDS_ERRORPAGES_SUGGESTION_DNS_CONFIG IDS_ERRORPAGES_SUGGESTION_FIREWALL_CONFIG -IDS_ERRORPAGES_SUGGESTION_HEADING -IDS_ERRORPAGES_SUGGESTION_HOMEPAGE IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY IDS_ERRORPAGES_SUGGESTION_NETWORK_PREDICTION IDS_ERRORPAGES_SUGGESTION_PROXY_CONFIG @@ -361,7 +332,6 @@ IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING IDS_ERRORPAGES_SUMMARY_DOWNLOAD_FILE_TYPE_ERROR IDS_ERRORPAGES_SUMMARY_DUPLICATE_HEADERS IDS_ERRORPAGES_SUMMARY_EMPTY_RESPONSE -IDS_ERRORPAGES_SUMMARY_ESET_ANTI_VIRUS_SSL_INTERCEPTION IDS_ERRORPAGES_SUMMARY_FILE_ACCESS_DENIED IDS_ERRORPAGES_SUMMARY_FORBIDDEN IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT @@ -370,7 +340,6 @@ IDS_ERRORPAGES_SUMMARY_INTERNAL_SERVER_ERROR IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_INSTRUCTIONS_TEMPLATE IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM -IDS_ERRORPAGES_SUMMARY_KASPERSKY_ANTI_VIRUS_SSL_INTERCEPTION IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED IDS_ERRORPAGES_SUMMARY_NETWORK_ACCESS_DENIED IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED @@ -384,7 +353,6 @@ IDS_ERRORPAGES_SUMMARY_SSL_PROTOCOL_ERROR IDS_ERRORPAGES_SUMMARY_TEMPORARILY_THROTTLED IDS_ERRORPAGES_SUMMARY_TIMED_OUT IDS_ERRORPAGES_SUMMARY_TOO_MANY_REDIRECTS -IDS_ERRORPAGES_SUMMARY_UNSUPPORTED_SCHEME_ERROR IDS_ERRORPAGES_SUMMARY_WEAK_SERVER_EPHEMERAL_DH_KEY IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE IDS_ERRORPAGES_TITLE_ACCESS_DENIED @@ -392,13 +360,10 @@ IDS_ERRORPAGES_TITLE_BLOCKED IDS_ERRORPAGES_TITLE_LOAD_FAILED IDS_ERRORPAGES_TITLE_NOT_AVAILABLE IDS_ERRORPAGES_TITLE_NOT_FOUND -IDS_EXTENSIONS_LOCKED_MANAGED_MODE IDS_EXTENSION_KEYWORD_COMMAND -IDS_FEEDBACK_DESCRIPTION_LABEL IDS_FEEDBACK_REPORT_PAGE_TITLE IDS_FEEDBACK_REPORT_URL_LABEL IDS_FEEDBACK_SEND_REPORT -IDS_FEEDBACK_SYSTEM_INFORMATION_URL_TEXT IDS_FEEDBACK_USER_EMAIL_LABEL IDS_FILE_BROWSER_OPEN_LABEL IDS_FIND_IN_PAGE_CLOSE_TOOLTIP @@ -409,33 +374,12 @@ IDS_FLAGS_ACCELERATED_FILTERS IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_DESCRIPTION IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_NAME -IDS_FLAGS_ACTION_BOX_DESCRIPTION -IDS_FLAGS_ACTION_BOX_NAME IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME -IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION -IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME -IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION -IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME -IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION -IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2 -IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3 -IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION -IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_DESCRIPTION -IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_NAME -IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION -IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME -IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION -IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME -IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION -IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME -IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR -IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION -IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME IDS_FLAGS_COMPOSITED_LAYER_BORDERS IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION @@ -461,45 +405,23 @@ IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI -IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION -IDS_FLAGS_DESKTOP_GUEST_MODE_NAME IDS_FLAGS_DISABLE IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME IDS_FLAGS_DISABLE_BOOT_ANIMATION -IDS_FLAGS_DISABLE_BOOT_ANIMATION2 -IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION -IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION -IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME -IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION -IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME -IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION -IDS_FLAGS_DISABLE_GPU_VSYNC_NAME IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME -IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION -IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME -IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION -IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME -IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION -IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME -IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION -IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME IDS_FLAGS_DISABLE_PNACL_DESCRIPTION IDS_FLAGS_DISABLE_PNACL_NAME IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME -IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION -IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME -IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION -IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION IDS_FLAGS_DISABLE_WEBGL_NAME IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION @@ -509,8 +431,6 @@ IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME -IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION -IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION IDS_FLAGS_ENABLE_ASH_OAK_NAME IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION @@ -527,46 +447,24 @@ IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME -IDS_FLAGS_ENABLE_DRAGGABLE_MENU_BUTTON_DESCRIPTION -IDS_FLAGS_ENABLE_DRAGGABLE_MENU_BUTTON_NAME -IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION -IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME -IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION -IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME IDS_FLAGS_ENABLE_HTTP2_DRAFT_04_DESCRIPTION IDS_FLAGS_ENABLE_HTTP2_DRAFT_04_NAME -IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API -IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME -IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION -IDS_FLAGS_ENABLE_KIOSK_APPS_NAME -IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION -IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME -IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API -IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API_DESCRIPTION IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION IDS_FLAGS_ENABLE_NACL_DEBUG_NAME IDS_FLAGS_ENABLE_NACL_DESCRIPTION -IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION -IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME IDS_FLAGS_ENABLE_NACL_NAME -IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_DESCRIPTION -IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_NAME -IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION -IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME -IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION -IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME IDS_FLAGS_ENABLE_PANELS_DESCRIPTION IDS_FLAGS_ENABLE_PANELS_NAME IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION @@ -583,20 +481,10 @@ IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME -IDS_FLAGS_ENABLE_SPDY31_DESCRIPTION -IDS_FLAGS_ENABLE_SPDY31_NAME -IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION -IDS_FLAGS_ENABLE_SPDY3_NAME -IDS_FLAGS_ENABLE_SPDY4A1_DESCRIPTION -IDS_FLAGS_ENABLE_SPDY4A1_NAME IDS_FLAGS_ENABLE_SPDY4A2_DESCRIPTION IDS_FLAGS_ENABLE_SPDY4A2_NAME -IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION -IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME -IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION -IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION @@ -607,42 +495,24 @@ IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME IDS_FLAGS_ENABLE_TOUCH_SIDE_BEZELS_DESCRIPTION IDS_FLAGS_ENABLE_TOUCH_SIDE_BEZELS_NAME -IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION -IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME -IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION -IDS_FLAGS_ENABLE_WEBGL_NAME -IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION -IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME -IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION -IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME -IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION -IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME -IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION -IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME -IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION -IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME -IDS_FLAGS_FORCE_FULLSCREEN_APP_DESCRIPTION -IDS_FLAGS_FORCE_FULLSCREEN_APP_NAME IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION IDS_FLAGS_FORCE_HIGH_DPI_NAME IDS_FLAGS_FORCE_UNIVERSAL_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION IDS_FLAGS_FORCE_UNIVERSAL_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION IDS_FLAGS_FULL_HISTORY_SYNC_NAME -IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION -IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_NAME IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION @@ -651,39 +521,16 @@ IDS_FLAGS_LONG_TITLE IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION IDS_FLAGS_NACL_DEBUG_MASK_NAME IDS_FLAGS_NOT_AVAILABLE -IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION -IDS_FLAGS_NO_DISCARD_TABS_NAME IDS_FLAGS_NO_EXPERIMENTS_AVAILABLE IDS_FLAGS_NO_UNSUPPORTED_EXPERIMENTS IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED -IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME -IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED -IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC -IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION -IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME -IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION IDS_FLAGS_PER_TILE_PAINTING_NAME -IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW -IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION -IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW -IDS_FLAGS_PRESENT_WITH_GDI_NAME -IDS_FLAGS_PRINT_RASTER_DESCRIPTION -IDS_FLAGS_PRINT_RASTER_NAME IDS_FLAGS_RELAUNCH_BUTTON IDS_FLAGS_RELAUNCH_NOTICE IDS_FLAGS_RESET_ALL_BUTTON @@ -693,9 +540,6 @@ IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION IDS_FLAGS_SCRIPT_BADGES_NAME IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION IDS_FLAGS_SCRIPT_BUBBLE_NAME -IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR -IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION -IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME IDS_FLAGS_SHOW_FPS_COUNTER @@ -708,28 +552,14 @@ IDS_FLAGS_SPELLCHECK_AUTOCORRECT IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION IDS_FLAGS_STACKED_TAB_STRIP_NAME -IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION -IDS_FLAGS_STATIC_IP_CONFIG_NAME -IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION -IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME -IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION -IDS_FLAGS_SYNC_TAB_FAVICONS_NAME IDS_FLAGS_TABLE_TITLE -IDS_FLAGS_TABPOSE_DESCRIPTION -IDS_FLAGS_TABPOSE_NAME IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME -IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION -IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME IDS_FLAGS_UNSUPPORTED_TABLE_TITLE -IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION -IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME -IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION -IDS_FLAGS_VIEWS_TEXTFIELD_NAME IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME IDS_FLAGS_WARNING_HEADER @@ -762,8 +592,6 @@ IDS_HISTORY_LOCK_BUTTON IDS_HISTORY_MORE_FROM_SITE IDS_HISTORY_NEWER IDS_HISTORY_NEWEST -IDS_HISTORY_NO_ITEMS -IDS_HISTORY_NO_RESPONSE_FROM_SERVER IDS_HISTORY_NO_RESULTS IDS_HISTORY_NO_SEARCH_RESULTS IDS_HISTORY_NO_SYNCED_RESULTS @@ -781,8 +609,6 @@ IDS_HISTORY_REMOVE_PAGE IDS_HISTORY_REMOVE_SELECTED_ITEMS IDS_HISTORY_SEARCHRESULTSFOR IDS_HISTORY_SEARCH_BUTTON -IDS_HISTORY_START_EDITING_HISTORY -IDS_HISTORY_STOP_EDITING_HISTORY IDS_HISTORY_TITLE IDS_HISTORY_UNKNOWN_DEVICE IDS_HISTORY_UNLOCK_BUTTON @@ -825,9 +651,7 @@ IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY IDS_OPTIONS_DISABLE_WEB_SERVICES IDS_OPTIONS_ENABLE_LOGGING IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE -IDS_OPTIONS_INTERNET_TAB_LABEL IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON -IDS_OPTIONS_SETTINGS_OPTIONS IDS_OTHER_DEVICES_X_MORE IDS_PAGEINFO_ADDRESS IDS_PAGEINFO_CERT_INFO_BUTTON @@ -846,7 +670,6 @@ IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT -IDS_PAGE_INFO_SECURITY_TAB_NO_COMPRESSION IDS_PAGE_INFO_SECURITY_TAB_NO_REVOCATION_MECHANISM IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY @@ -868,6 +691,61 @@ IDS_PDF_INFOBAR_ALWAYS_USE_READER_BUTTON IDS_PLATFORM_LABEL IDS_PLUGIN_CONFIRM_INSTALL_DIALOG_ACCEPT_BUTTON IDS_PLUGIN_CONFIRM_INSTALL_DIALOG_TITLE +IDS_POLICY_DEFAULT_SEARCH_DISABLED +IDS_POLICY_DEPRECATED +IDS_POLICY_DM_STATUS_HTTP_STATUS_ERROR +IDS_POLICY_DM_STATUS_REQUEST_FAILED +IDS_POLICY_DM_STATUS_REQUEST_INVALID +IDS_POLICY_DM_STATUS_RESPONSE_DECODING_ERROR +IDS_POLICY_DM_STATUS_SERVICE_ACTIVATION_PENDING +IDS_POLICY_DM_STATUS_SERVICE_DEPROVISIONED +IDS_POLICY_DM_STATUS_SERVICE_DEVICE_ID_CONFLICT +IDS_POLICY_DM_STATUS_SERVICE_DEVICE_NOT_FOUND +IDS_POLICY_DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER +IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED +IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID +IDS_POLICY_DM_STATUS_SERVICE_MISSING_LICENSES +IDS_POLICY_DM_STATUS_SERVICE_POLICY_NOT_FOUND +IDS_POLICY_DM_STATUS_SUCCESS +IDS_POLICY_DM_STATUS_TEMPORARY_UNAVAILABLE +IDS_POLICY_DM_STATUS_UNKNOWN_ERROR +IDS_POLICY_INVALID_PROXY_MODE_ERROR +IDS_POLICY_INVALID_SEARCH_URL_ERROR +IDS_POLICY_LIST_ENTRY_ERROR +IDS_POLICY_NOT_SPECIFIED_ERROR +IDS_POLICY_OUT_OF_RANGE_ERROR +IDS_POLICY_OVERRIDDEN +IDS_POLICY_PROXY_BOTH_SPECIFIED_ERROR +IDS_POLICY_PROXY_MODE_AUTO_DETECT_ERROR +IDS_POLICY_PROXY_MODE_DISABLED_ERROR +IDS_POLICY_PROXY_MODE_FIXED_SERVERS_ERROR +IDS_POLICY_PROXY_MODE_PAC_URL_ERROR +IDS_POLICY_PROXY_MODE_SYSTEM_ERROR +IDS_POLICY_PROXY_NEITHER_SPECIFIED_ERROR +IDS_POLICY_SCHEMA_VALIDATION_ERROR +IDS_POLICY_STORE_STATUS_BAD_STATE +IDS_POLICY_STORE_STATUS_LOAD_ERROR +IDS_POLICY_STORE_STATUS_OK +IDS_POLICY_STORE_STATUS_PARSE_ERROR +IDS_POLICY_STORE_STATUS_SERIALIZE_ERROR +IDS_POLICY_STORE_STATUS_STORE_ERROR +IDS_POLICY_STORE_STATUS_UNKNOWN_ERROR +IDS_POLICY_STORE_STATUS_VALIDATION_ERROR +IDS_POLICY_SUBKEY_ERROR +IDS_POLICY_TYPE_ERROR +IDS_POLICY_VALIDATION_BAD_INITIAL_SIGNATURE +IDS_POLICY_VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE +IDS_POLICY_VALIDATION_BAD_SIGNATURE +IDS_POLICY_VALIDATION_BAD_TIMESTAMP +IDS_POLICY_VALIDATION_BAD_USERNAME +IDS_POLICY_VALIDATION_ERROR_CODE_PRESENT +IDS_POLICY_VALIDATION_OK +IDS_POLICY_VALIDATION_PAYLOAD_PARSE_ERROR +IDS_POLICY_VALIDATION_POLICY_PARSE_ERROR +IDS_POLICY_VALIDATION_UNKNOWN_ERROR +IDS_POLICY_VALIDATION_WRONG_POLICY_TYPE +IDS_POLICY_VALIDATION_WRONG_SETTINGS_ENTITY_ID +IDS_POLICY_VALIDATION_WRONG_TOKEN IDS_PREFERENCES_CORRUPT_ERROR IDS_PREFERENCES_UNREADABLE_ERROR IDS_PRINT @@ -934,20 +812,13 @@ IDS_SHOW_HISTORY IDS_SIGNED_IN_WITH_SYNC_DISABLED IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED IDS_SIGNIN_ERROR_BUBBLE_VIEW_TITLE -IDS_SKIP IDS_SPEECH_INPUT_ABORTED IDS_SPEECH_INPUT_MIC_ERROR IDS_SPEECH_INPUT_NET_ERROR IDS_SPEECH_INPUT_NO_MIC IDS_SPEECH_INPUT_NO_RESULTS IDS_SPEECH_INPUT_NO_SPEECH -IDS_SSL_BLOCKING_PAGE_EXIT -IDS_SSL_BLOCKING_PAGE_PROCEED -IDS_SSL_BLOCKING_PAGE_SHOULD_NOT_PROCEED IDS_SSL_BLOCKING_PAGE_TITLE -IDS_SSL_ERROR_PAGE_CANNOT_PROCEED -IDS_SSL_ERROR_PAGE_TITLE -IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED IDS_SYNC_ACCOUNT_SYNCING_TO_USER IDS_SYNC_ACCOUNT_SYNCING_TO_USER_WITH_MANAGE_LINK IDS_SYNC_AUTHENTICATING_LABEL @@ -966,7 +837,6 @@ IDS_SYNC_EMPTY_PASSPHRASE_ERROR IDS_SYNC_ENABLE_SYNC_ON_ACCOUNT IDS_SYNC_ENCRYPTION_SECTION_TITLE IDS_SYNC_ENTER_GOOGLE_PASSPHRASE_BODY -IDS_SYNC_ENTER_OTHER_PASSPHRASE_BODY IDS_SYNC_ENTER_PASSPHRASE_BODY IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE IDS_SYNC_ENTER_PASSPHRASE_TITLE @@ -975,14 +845,11 @@ IDS_SYNC_ERROR_SIGNING_IN IDS_SYNC_FULL_ENCRYPTION_DATA IDS_SYNC_GAIA_CAPTCHA_CASE_INSENSITIVE_TIP IDS_SYNC_GET_ACCESS_CODE_URL -IDS_SYNC_INVALID_ACCESS_CODE_LABEL IDS_SYNC_INVALID_USER_CREDENTIALS -IDS_SYNC_LOGIN_COULD_NOT_CONNECT IDS_SYNC_LOGIN_INFO_OUT_OF_DATE IDS_SYNC_LOGIN_SETTING_UP IDS_SYNC_MENU_PRE_SYNCED_LABEL IDS_SYNC_MENU_SYNCED_LABEL -IDS_SYNC_MENU_SYNC_ERROR_LABEL IDS_SYNC_NTP_PASSWORD_ENABLE IDS_SYNC_NTP_PASSWORD_PROMO IDS_SYNC_NTP_PASSWORD_PROMO, @@ -996,7 +863,6 @@ IDS_SYNC_PASSPHRASE_LABEL IDS_SYNC_PASSPHRASE_MISMATCH_ERROR IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_POSTFIX IDS_SYNC_PASSPHRASE_MSG_EXPLICIT_PREFIX -IDS_SYNC_PASSPHRASE_SECTION_TITLE IDS_SYNC_PASSWORD_SYNC_ATTENTION IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE IDS_SYNC_PROMO_TAB_TITLE @@ -1004,7 +870,6 @@ IDS_SYNC_RELOGIN_LINK_LABEL IDS_SYNC_SERVER_IS_UNREACHABLE IDS_SYNC_SERVICE_UNAVAILABLE IDS_SYNC_SETUP_ERROR -IDS_SYNC_SIGNIN IDS_SYNC_SIGN_IN_ERROR_BUBBLE_VIEW_ACCEPT IDS_SYNC_SIGN_IN_ERROR_BUBBLE_VIEW_MESSAGE IDS_SYNC_SIGN_IN_ERROR_WRENCH_MENU_ITEM @@ -1091,6 +956,12 @@ IDS_TIME_REMAINING_LONG_MINS_MANY IDS_TIME_REMAINING_LONG_MINS_TWO IDS_TIME_REMAINING_LONG_MINS_ZERO IDS_TIME_REMAINING_LONG_MIN_SINGULAR +IDS_TIME_REMAINING_LONG_SECS_DEFAULT +IDS_TIME_REMAINING_LONG_SECS_FEW +IDS_TIME_REMAINING_LONG_SECS_MANY +IDS_TIME_REMAINING_LONG_SECS_TWO +IDS_TIME_REMAINING_LONG_SECS_ZERO +IDS_TIME_REMAINING_LONG_SEC_SINGULAR IDS_TIME_REMAINING_MINS_DEFAULT IDS_TIME_REMAINING_MINS_FEW IDS_TIME_REMAINING_MINS_MANY @@ -1115,7 +986,6 @@ IDS_TOUCH_EVENTS_NAME IDS_TRANSLATE_INFOBAR_ACCEPT IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE IDS_TRANSLATE_INFOBAR_DENY -IDS_UNKNOWN_SEARCH_ENGINE_NAME IDS_UPGRADE_AVAILABLE IDS_UPGRADE_AVAILABLE_BUTTON IDS_WEB_FONT_FAMILY diff --git a/build/isolate.gypi b/build/isolate.gypi index d1dd1a7728..c9a15add87 100644 --- a/build/isolate.gypi +++ b/build/isolate.gypi @@ -33,8 +33,14 @@ # # The generated .isolated file will be: # <(PRODUCT_DIR)/foo_test.isolated +# +# See http://dev.chromium.org/developers/testing/isolated-testing/for-swes +# for more information. { + 'includes': [ + '../chrome/version.gypi', + ], 'rules': [ { 'rule_name': 'isolate', @@ -43,7 +49,6 @@ # Files that are known to be involved in this step. '<(DEPTH)/tools/swarming_client/isolate.py', '<(DEPTH)/tools/swarming_client/run_isolated.py', - '<(DEPTH)/tools/swarming_client/googletest/run_test_cases.py', # Disable file tracking by the build driver for now. This means the # project must have the proper build-time dependency for their runtime @@ -64,38 +69,51 @@ 'python', '<(DEPTH)/tools/swarming_client/isolate.py', '<(test_isolation_mode)', - # Variables should use the -V FOO=<(FOO) form so frequent values, - # like '0' or '1', aren't stripped out by GYP. - '--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ', - '--variable', 'OS=<(OS)', '--result', '<@(_outputs)', '--isolate', '<(RULE_INPUT_PATH)', + + # Variables should use the -V FOO=<(FOO) form so frequent values, + # like '0' or '1', aren't stripped out by GYP. Run 'isolate.py help' for + # more details. + # + # This list needs to be kept in sync with the cmd line options + # in src/build/android/pylib/gtest/setup.py. + + # Path variables are used to replace file paths when loading a .isolate + # file + '--path-variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ', + + # Extra variables are replaced on the 'command' entry and on paths in + # the .isolate file but are not considered relative paths. + '--extra-variable', 'version_full=<(version_full)', + + '--config-variable', 'OS=<(OS)', + '--config-variable', 'chromeos=<(chromeos)', + '--config-variable', 'component=<(component)', + # TODO(kbr): move this to chrome_tests.gypi:gles2_conform_tests_run + # once support for user-defined config variables is added. + '--config-variable', + 'internal_gles2_conform_tests=<(internal_gles2_conform_tests)', + '--config-variable', 'icu_use_data_file_flag=<(icu_use_data_file_flag)', + '--config-variable', 'libpeer_target_type=<(libpeer_target_type)', + '--config-variable', 'use_openssl=<(use_openssl)', ], 'conditions': [ # Note: When gyp merges lists, it appends them to the old value. ['OS=="mac"', { # <(mac_product_name) can contain a space, so don't use FOO=<(FOO) # form. - 'action': [ '--variable', 'mac_product_name', '<(mac_product_name)' ], + 'action': [ + '--extra-variable', 'mac_product_name', '<(mac_product_name)', + ], }], - ["test_isolation_outdir==''", { - # GYP will eliminate duplicate arguments so '<(PRODUCT_DIR)' cannot - # be provided twice. To work around this behavior, append '/'. - # - # Also have a space after <(PRODUCT_DIR) or visual studio will - # escape the argument wrappping " with the \ and merge it into - # the following arguments. - 'action': [ '--outdir', '<(PRODUCT_DIR)/ ' ], - }, { - 'action': [ '--outdir', '<(test_isolation_outdir)' ], + ["test_isolation_outdir!=''", { + 'action': [ '--isolate-server', '<(test_isolation_outdir)' ], }], ['test_isolation_fail_on_missing == 0', { - 'action': ['--ignore_broken_items'], - }, - ], + 'action': ['--ignore_broken_items'], + }], ], - - 'msvs_cygwin_shell': 0, }, ], } diff --git a/build/jar_file_jni_generator.gypi b/build/jar_file_jni_generator.gypi index 2e1b08497b..dc43c49070 100644 --- a/build/jar_file_jni_generator.gypi +++ b/build/jar_file_jni_generator.gypi @@ -22,6 +22,10 @@ { 'variables': { 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', + # A comma separated string of include files. + 'jni_generator_includes%': ( + 'base/android/jni_generator/jni_generator_helper.h' + ), }, 'actions': [ { @@ -46,6 +50,8 @@ '<(input_java_class)', '--output_dir', '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni', + '--includes', + '<(jni_generator_includes)', '--optimize_generation', '<(optimize_jni_generation)', ], diff --git a/build/java_apk.gypi b/build/java_apk.gypi index 5ca61e3794..bf841fe906 100644 --- a/build/java_apk.gypi +++ b/build/java_apk.gypi @@ -48,11 +48,11 @@ # strings.xml files, if any. # library_manifest_paths'- Paths to additional AndroidManifest.xml files from # libraries. -# use_content_linker - Enable the content dynamic linker that allows sharing the +# use_chromium_linker - Enable the content dynamic linker that allows sharing the # RELRO section of the native libraries between the different processes. -# enable_content_linker_tests - Enable the content dynamic linker test support +# enable_chromium_linker_tests - Enable the content dynamic linker test support # code. This allows a test APK to inject a Linker.TestRunner instance at -# runtime. Should only be used by the content_linker_test_apk target!! +# runtime. Should only be used by the chromium_linker_test_apk target!! # never_lint - Set to 1 to not run lint on this target. { 'variables': { @@ -81,10 +81,7 @@ 'compile_input_paths': [], 'package_input_paths': [], 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', - # TODO(cjhopman): build/ shouldn't refer to content/. The libraryloader and - # nativelibraries template should be moved out of content/ (to base/?). - # http://crbug.com/225101 - 'native_libraries_template': '<(DEPTH)/content/public/android/java/templates/NativeLibraries.template', + 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLibraries.template', 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java', 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp', @@ -126,8 +123,8 @@ 'variables': { 'native_lib_target%': '', 'native_lib_version_name%': '', - 'use_content_linker%': 0, - 'enable_content_linker_tests%': 0, + 'use_chromium_linker%' : 0, + 'enable_chromium_linker_tests%': 0, 'is_test_apk%': 0, }, 'conditions': [ @@ -150,8 +147,8 @@ }, 'native_lib_target%': '', 'native_lib_version_name%': '', - 'use_content_linker%': 0, - 'enable_content_linker_tests%': 0, + 'use_chromium_linker%' : 0, + 'enable_chromium_linker_tests%': 0, 'emma_instrument': '<(emma_instrument)', 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', @@ -185,9 +182,9 @@ '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', ], }], - ['use_content_linker == 1', { + ['use_chromium_linker == 1', { 'dependencies': [ - '<(DEPTH)/content/content.gyp:content_android_linker', + '<(DEPTH)/base/base.gyp:chromium_android_linker', ], }], ['native_lib_target != ""', { @@ -217,10 +214,10 @@ { 'variables': { 'conditions': [ - ['use_content_linker == 1', { + ['use_chromium_linker == 1', { 'variables': { 'linker_input_libraries': [ - '<(SHARED_LIB_DIR)/libcontent_android_linker.>(android_product_extension)', + '<(SHARED_LIB_DIR)/libchromium_android_linker.>(android_product_extension)', ], } }, { @@ -261,10 +258,10 @@ 'action_name': 'native_libraries_<(_target_name)', 'variables': { 'conditions': [ - ['use_content_linker == 1', { + ['use_chromium_linker == 1', { 'variables': { 'linker_gcc_preprocess_defines': [ - '--defines', 'ENABLE_CONTENT_LINKER', + '--defines', 'ENABLE_CHROMIUM_LINKER', ], } }, { @@ -272,10 +269,10 @@ 'linker_gcc_preprocess_defines': [], }, }], - ['enable_content_linker_tests == 1', { + ['enable_chromium_linker_tests == 1', { 'variables': { 'linker_tests_gcc_preprocess_defines': [ - '--defines', 'ENABLE_CONTENT_LINKER_TESTS', + '--defines', 'ENABLE_CHROMIUM_LINKER_TESTS', ], } }, { @@ -289,7 +286,7 @@ '<@(linker_tests_gcc_preprocess_defines)', ], }, - 'message': 'Creating NativeLibraries.java for <(_target_name).', + 'message': 'Creating NativeLibraries.java for <(_target_name)', 'inputs': [ '<(DEPTH)/build/android/gyp/util/build_utils.py', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', @@ -340,7 +337,7 @@ }, { 'action_name': 'create device library symlinks', - 'message': 'Creating links on device for <(_target_name).', + 'message': 'Creating links on device for <(_target_name)', 'inputs': [ '<(DEPTH)/build/android/gyp/util/build_utils.py', '<(DEPTH)/build/android/gyp/create_device_library_links.py', @@ -684,7 +681,7 @@ }, { 'action_name': 'ant package resources', - 'message': 'Packaging resources for <(_target_name) APK.', + 'message': 'Packaging resources for <(_target_name) APK', 'inputs': [ '<(DEPTH)/build/android/ant/apk-package-resources.xml', '<(DEPTH)/build/android/gyp/util/build_utils.py', @@ -737,7 +734,7 @@ }, { 'action_name': 'ant_package_<(_target_name)', - 'message': 'Packaging <(_target_name).', + 'message': 'Packaging <(_target_name)', 'inputs': [ '<(DEPTH)/build/android/ant/apk-package.xml', '<(DEPTH)/build/android/gyp/util/build_utils.py', diff --git a/build/jni_generator.gypi b/build/jni_generator.gypi index a6c8364d44..da99331ec5 100644 --- a/build/jni_generator.gypi +++ b/build/jni_generator.gypi @@ -31,7 +31,11 @@ 'variables': { 'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py', 'jni_generator_jarjar_file%': '', - 'jni_generator_ptr_type%': 'int', + 'jni_generator_ptr_type%': 'long', + # A comma separated string of include files. + 'jni_generator_includes%': ( + 'base/android/jni_generator/jni_generator_helper.h' + ), }, 'rules': [ { @@ -49,6 +53,8 @@ '<(RULE_INPUT_PATH)', '--output_dir', '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)/jni', + '--includes', + '<(jni_generator_includes)', '--optimize_generation', '<(optimize_jni_generation)', '--jarjar', @@ -67,6 +73,11 @@ ], }, ], + 'direct_dependent_settings': { + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_package)', + ], + }, # This target exports a hard dependency because it generates header # files. 'hard_dependency': 1, diff --git a/build/landmine_utils.py b/build/landmine_utils.py index 4b8b257191..773783291f 100644 --- a/build/landmine_utils.py +++ b/build/landmine_utils.py @@ -33,7 +33,7 @@ def IsWindows(): @memoize() def IsLinux(): - return sys.platform.startswith('linux') + return sys.platform.startswith(('linux', 'freebsd')) @memoize() @@ -105,7 +105,7 @@ def builder(): elif platform() == 'ios': return 'xcode' elif IsWindows(): - return 'msvs' + return 'ninja' elif IsLinux(): return 'ninja' elif IsMac(): diff --git a/build/landmines.py b/build/landmines.py index 7b4c5b5ecc..857585adbf 100755 --- a/build/landmines.py +++ b/build/landmines.py @@ -15,7 +15,6 @@ build is clobbered. """ import difflib -import gyp_helper import logging import optparse import os @@ -113,7 +112,9 @@ def process_options(): def main(): landmine_scripts = process_options() - gyp_helper.apply_chromium_gyp_env() + + if landmine_utils.builder() == 'dump_dependency_json': + return 0 for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): landmines = [] diff --git a/build/linux/bin/eu-strip.sha1 b/build/linux/bin/eu-strip.sha1 new file mode 100644 index 0000000000..43f290a701 --- /dev/null +++ b/build/linux/bin/eu-strip.sha1 @@ -0,0 +1 @@ +0a9b8f68615ce388b65201e6d22da7a9cf2e729c
\ No newline at end of file diff --git a/build/linux/detect_host_arch.py b/build/linux/detect_host_arch.py new file mode 100755 index 0000000000..268646197a --- /dev/null +++ b/build/linux/detect_host_arch.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Outputs host CPU architecture in format recognized by gyp.""" + +import platform +import re +import sys + + +def main(): + host_arch = platform.machine() + + # Convert machine type to format recognized by gyp. + if re.match(r'i.86', host_arch) or host_arch == 'i86pc': + host_arch = 'ia32' + elif host_arch in ['x86_64', 'amd64']: + host_arch = 'x64' + elif host_arch.startswith('arm'): + host_arch = 'arm' + + # platform.machine is based on running kernel. It's possible to use 64-bit + # kernel with 32-bit userland, e.g. to give linker slightly more memory. + # Distinguish between different userland bitness by querying + # the python binary. + if host_arch == 'x64' and platform.architecture()[0] == '32bit': + host_arch = 'ia32' + + print host_arch + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/build/linux/python_arch.sh b/build/linux/python_arch.sh index 3a41f94a98..e0f63bc6b0 100755 --- a/build/linux/python_arch.sh +++ b/build/linux/python_arch.sh @@ -11,7 +11,9 @@ # file_out=$(file --dereference "$1") -if [ $? -ne 0 ]; then +# The POSIX spec says that `file` should not exit(1) if the file does not +# exist, so do our own -e check to catch things. +if [ $? -ne 0 ] || [ ! -e "$1" ] ; then echo unknown exit 0 fi diff --git a/build/linux/sysroot_ld_path.sh b/build/linux/sysroot_ld_path.sh index 74553c9363..4b8bf7305e 100755 --- a/build/linux/sysroot_ld_path.sh +++ b/build/linux/sysroot_ld_path.sh @@ -46,15 +46,19 @@ process_ld_so_conf() { echo "$ENTRY" | grep -qs ^include if [ $? -eq 0 ]; then local included_files=$(echo "$ENTRY" | sed 's/^include //') - if ls $included_files >/dev/null 2>&1 ; then - for inc_file in $included_files; do - echo $inc_file | grep -qs ^/ - if [ $? -eq 0 ]; then - process_ld_so_conf "$root" "$root$inc_file" - else - process_ld_so_conf "$root" "$(pwd)/$inc_file" - fi - done + echo "$included_files" | grep -qs ^/ + if [ $? -eq 0 ]; then + if ls $root$included_files >/dev/null 2>&1 ; then + for inc_file in $root$included_files; do + process_ld_so_conf "$root" "$inc_file" + done + fi + else + if ls $(pwd)/$included_files >/dev/null 2>&1 ; then + for inc_file in $(pwd)/$included_files; do + process_ld_so_conf "$root" "$inc_file" + done + fi fi continue fi diff --git a/build/linux/system.gyp b/build/linux/system.gyp index 4a7e857efc..9cb15b70fe 100644 --- a/build/linux/system.gyp +++ b/build/linux/system.gyp @@ -6,7 +6,7 @@ 'variables': { 'conditions': [ ['sysroot!=""', { - 'pkg-config': './pkg-config-wrapper "<(sysroot)" "<(target_arch)"', + 'pkg-config': '<(chroot_cmd) ./pkg-config-wrapper "<(sysroot)" "<(target_arch)"', }, { 'pkg-config': 'pkg-config' }], @@ -18,17 +18,6 @@ 'linux_link_libbrlapi%': 0, }, 'conditions': [ - [ 'os_posix==1 and OS!="mac"', { - 'variables': { - # We use our own copy of libssl3, although we still need to link against - # the rest of NSS. - 'use_system_ssl%': 0, - }, - }, { - 'variables': { - 'use_system_ssl%': 1, - }, - }], [ 'chromeos==0', { # Hide GTK and related dependencies for Chrome OS, so they won't get # added back to Chrome OS. Don't try to use GTK on Chrome OS. @@ -156,19 +145,30 @@ 'type': 'none', 'conditions': [ ['_toolset=="target"', { - 'direct_dependent_settings': { - 'cflags': [ - '<!@(<(pkg-config) --cflags fontconfig)', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l fontconfig)', - ], - }, + 'conditions': [ + ['use_system_fontconfig==1', { + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags fontconfig)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l fontconfig)', + ], + }, + }, { # use_system_fontconfig==0 + 'dependencies': [ + '../../third_party/fontconfig/fontconfig.gyp:fontconfig', + ], + 'export_dependent_settings' : [ + '../../third_party/fontconfig/fontconfig.gyp:fontconfig', + ], + }], + ], }], ], }, @@ -329,11 +329,6 @@ ], }, }], - ['use_x11==1', { - 'link_settings': { - 'libraries': [ '-lXtst' ] - } - }], ], }, { @@ -415,9 +410,6 @@ { 'target_name': 'libbrlapi', 'type': 'static_library', - 'dependencies': [ - '../../base/base.gyp:base', - ], 'all_dependent_settings': { 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)', @@ -435,6 +427,9 @@ }], ], }, + 'include_dirs': [ + '../..', + ], 'hard_dependency': 1, 'actions': [ { @@ -702,7 +697,7 @@ '../../third_party/openssl/openssl.gyp:openssl', ], }], - ['use_openssl==0 and use_system_ssl==0', { + ['use_openssl==0', { 'dependencies': [ '../../net/third_party/nss/ssl.gyp:libssl', ], @@ -725,24 +720,6 @@ ], }, }], - ['use_openssl==0 and use_system_ssl==1', { - 'direct_dependent_settings': { - 'cflags': [ - '<!@(<(pkg-config) --cflags nss)', - ], - 'defines': [ - 'USE_SYSTEM_SSL', - ], - }, - 'link_settings': { - 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)', - ], - 'libraries': [ - '<!@(<(pkg-config) --libs-only-l nss)', - ], - }, - }], ['use_openssl==0 and clang==1', { 'direct_dependent_settings': { 'cflags': [ @@ -815,82 +792,212 @@ ], }, { + 'target_name': 'xcursor', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xcursor)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xcursor)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xcursor)', + ], + }, + }, + { + 'target_name': 'xcomposite', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xcomposite)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xcomposite)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xcomposite)', + ], + }, + }, + { + 'target_name': 'xdamage', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xdamage)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xdamage)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xdamage)', + ], + }, + }, + { 'target_name': 'xext', 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xext)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xext)', + ], + }, + }, + { + 'target_name': 'xfixes', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xfixes)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xfixes)', + ], + }, + }, + { + 'target_name': 'xi', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xi)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xi)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xi)', + ], + }, + }, + { + 'target_name': 'xrandr', + 'type': 'none', + 'toolsets': ['host', 'target'], 'conditions': [ ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags xext)', + '<!@(<(pkg-config) --cflags xrandr)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l xext)', + '<!@(<(pkg-config) --libs-only-l xrandr)', ], }, - }], - ], - }, - { - 'target_name': 'xfixes', - 'type': 'none', - 'conditions': [ - ['_toolset=="target"', { + }, { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags xfixes)', + '<!@(pkg-config --cflags xrandr)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)', + '<!@(pkg-config --libs-only-L --libs-only-other xrandr)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l xfixes)', + '<!@(pkg-config --libs-only-l xrandr)', ], }, }], ], }, { - 'target_name': 'xrandr', + 'target_name': 'xrender', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xrender)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xrender)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xrender)', + ], + }, + }, + { + 'target_name': 'xscrnsaver', + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ + '<!@(<(pkg-config) --cflags xscrnsaver)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(<(pkg-config) --libs-only-L --libs-only-other xscrnsaver)', + ], + 'libraries': [ + '<!@(<(pkg-config) --libs-only-l xscrnsaver)', + ], + }, + }, + { + 'target_name': 'xtst', 'type': 'none', 'toolsets': ['host', 'target'], 'conditions': [ ['_toolset=="target"', { 'direct_dependent_settings': { 'cflags': [ - '<!@(<(pkg-config) --cflags xrandr)', + '<!@(<(pkg-config) --cflags xtst)', ], }, 'link_settings': { 'ldflags': [ - '<!@(<(pkg-config) --libs-only-L --libs-only-other xrandr)', + '<!@(<(pkg-config) --libs-only-L --libs-only-other xtst)', ], 'libraries': [ - '<!@(<(pkg-config) --libs-only-l xrandr)', + '<!@(<(pkg-config) --libs-only-l xtst)', ], }, }, { 'direct_dependent_settings': { 'cflags': [ - '<!@(pkg-config --cflags xrandr)', + '<!@(pkg-config --cflags xtst)', ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other xrandr)', + '<!@(pkg-config --libs-only-L --libs-only-other xtst)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l xrandr)', + '<!@(pkg-config --libs-only-l xtst)', ], }, - }], - ], - }, + }] + ] + } ], } diff --git a/build/linux/system.isolate b/build/linux/system.isolate new file mode 100644 index 0000000000..3933af1e2e --- /dev/null +++ b/build/linux/system.isolate @@ -0,0 +1,12 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + # This file is only used with the condition "desktop_linux==1 or chromeos==1". + 'includes': [ + # This is only used when use_openssl==0. + # TODO(rsleevi): This is awkward, because this file is imported from + # base.isolate but references net, causing an improper import cycle. + '../../net/third_party/nss/ssl.isolate', + ], +} diff --git a/build/linux/unbundle/libXNVCtrl.gyp b/build/linux/unbundle/libXNVCtrl.gyp new file mode 100644 index 0000000000..f076bdba41 --- /dev/null +++ b/build/linux/unbundle/libXNVCtrl.gyp @@ -0,0 +1,35 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'libXNVCtrl', + 'type': 'none', + 'variables': { + 'headers_root_path': '.', + 'header_filenames': [ + 'NVCtrlLib.h', + 'NVCtrl.h', + ], + }, + 'includes': [ + '../../build/shim_headers.gypi', + ], + 'direct_dependent_settings': { + 'cflags': [ + '<!@(pkg-config --cflags libXNVCtrl)', + ], + }, + 'link_settings': { + 'ldflags': [ + '<!@(pkg-config --libs-only-L --libs-only-other libXNVCtrl)', + ], + 'libraries': [ + '<!@(pkg-config --libs-only-l libXNVCtrl)', + ], + }, + } + ], +} diff --git a/build/linux/unbundle/replace_gyp_files.py b/build/linux/unbundle/replace_gyp_files.py index c0fcc49f55..28ab14f8ff 100755 --- a/build/linux/unbundle/replace_gyp_files.py +++ b/build/linux/unbundle/replace_gyp_files.py @@ -29,6 +29,7 @@ REPLACEMENTS = { 'use_system_libvpx': 'third_party/libvpx/libvpx.gyp', 'use_system_libwebp': 'third_party/libwebp/libwebp.gyp', 'use_system_libxml': 'third_party/libxml/libxml.gyp', + 'use_system_libxnvctrl' : 'third_party/libXNVCtrl/libXNVCtrl.gyp', 'use_system_libxslt': 'third_party/libxslt/libxslt.gyp', 'use_system_openssl': 'third_party/openssl/openssl.gyp', 'use_system_opus': 'third_party/opus/opus.gyp', diff --git a/build/mac/find_sdk.py b/build/mac/find_sdk.py index 067be638d2..1d7634391f 100755 --- a/build/mac/find_sdk.py +++ b/build/mac/find_sdk.py @@ -31,6 +31,9 @@ def main(): parser.add_option("--sdk_path", action="store", type="string", dest="sdk_path", default="", help="user-specified SDK path; bypasses verification") + parser.add_option("--print_sdk_path", + action="store_true", dest="print_sdk_path", default=False, + help="Additionaly print the path the SDK (appears first).") (options, args) = parser.parse_args() min_sdk_version = args[0] @@ -73,6 +76,10 @@ def main(): print >>sys.stderr, '' return min_sdk_version + if options.print_sdk_path: + print subprocess.check_output(['xcodebuild', '-version', '-sdk', + 'macosx' + best_sdk, 'Path']).strip() + return best_sdk diff --git a/build/mac/tweak_info_plist.py b/build/mac/tweak_info_plist.py index eb38acea4e..0f65e4aed2 100755 --- a/build/mac/tweak_info_plist.py +++ b/build/mac/tweak_info_plist.py @@ -204,6 +204,24 @@ def _RemoveBreakpadKeys(plist): 'BreakpadSkipConfirm') +def _TagSuffixes(): + # Keep this list sorted in the order that tag suffix components are to + # appear in a tag value. That is to say, it should be sorted per ASCII. + components = ('32bit', 'full') + assert tuple(sorted(components)) == components + + components_len = len(components) + combinations = 1 << components_len + tag_suffixes = [] + for combination in xrange(0, combinations): + tag_suffix = '' + for component_index in xrange(0, components_len): + if combination & (1 << component_index): + tag_suffix += '-' + components[component_index] + tag_suffixes.append(tag_suffix) + return tag_suffixes + + def _AddKeystoneKeys(plist, bundle_identifier): """Adds the Keystone keys. This must be called AFTER _AddVersionKeys() and also requires the |bundle_identifier| argument (com.example.product).""" @@ -211,6 +229,11 @@ def _AddKeystoneKeys(plist, bundle_identifier): plist['KSProductID'] = bundle_identifier plist['KSUpdateURL'] = 'https://tools.google.com/service/update2' + _RemoveKeys(plist, 'KSChannelID') + for tag_suffix in _TagSuffixes(): + if tag_suffix: + plist['KSChannelID' + tag_suffix] = tag_suffix + def _RemoveKeystoneKeys(plist): """Removes any set Keystone keys.""" @@ -219,6 +242,11 @@ def _RemoveKeystoneKeys(plist): 'KSProductID', 'KSUpdateURL') + tag_keys = [] + for tag_suffix in _TagSuffixes(): + tag_keys.append('KSChannelID' + tag_suffix) + _RemoveKeys(plist, *tag_keys) + def Main(argv): parser = optparse.OptionParser('%prog [options]') diff --git a/build/protoc.gypi b/build/protoc.gypi index 52fb8a2b60..fafdf9df7a 100644 --- a/build/protoc.gypi +++ b/build/protoc.gypi @@ -94,7 +94,6 @@ '--cpp_out', '<(cc_generator_options)<(cc_dir)', '--python_out', '<(py_dir)', ], - 'msvs_cygwin_shell': 0, 'message': 'Generating C++ and Python code from <(RULE_INPUT_PATH)', 'process_outputs_as_sources': 1, }, diff --git a/build/toolchain/android/BUILD.gn b/build/toolchain/android/BUILD.gn new file mode 100644 index 0000000000..8f84f69b99 --- /dev/null +++ b/build/toolchain/android/BUILD.gn @@ -0,0 +1,108 @@ +# Copyright 2013 The Chromium Authors. 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/android/config.gni") +import("//build/toolchain/clang.gni") +import("//build/toolchain/goma.gni") +import("//build/toolchain/gcc_toolchain.gni") + +# Get the Android version of the name of the build host's architecture. +if (build_cpu_arch == "x64") { + android_host_arch = "x86_64" +} else if (build_cpu_arch == "x86") { + android_host_arch = "x86" +} else { + assert(false, "Need Android toolchain support for your build OS.") +} + +if (is_gyp) { + # Set the compilers for GYP to use. This logic is only relevant to GYP where + # there is "a" target compiler. In native GN builds, we have separate + # compilers for the toolchains below, any or all of which could be active in + # any given build. + if (is_clang) { + # Set the GYP header for all toolchains when running under Clang. + make_global_settings = make_clang_global_settings + } else { + # Find the compiler for GYP for non-Clang Android. + if (cpu_arch == "x86") { + android_toolchain_arch = "x86-4.6" + } else if (cpu_arch == "arm") { + android_toolchain_arch = "arm-linux-androideabi-4.6" + } else if (cpu_arch == "mipsel") { + android_toolchain_arch = "mipsel-linux-android-4.6" + } else { + assert(false, "Need Android toolchain support for your platform.") + } + + # The extra slash before "toolchains" is because GYP generates this and we + # have to match the make_global_settings character-for-character, + # TODO(brettw) remove extra slash before toolchains when GYP compat is no + # longer necessary. + android_toolchain = + "$android_ndk_root//toolchains/$android_toolchain_arch/prebuilt/$build_os-$android_host_arch/bin" + + # This script will find the compilers for the given Android toolchain + # directory. + android_compilers = exec_script("find_android_compiler.py", + [android_toolchain], "value") + make_global_settings = + "['CC', '" + android_compilers[0] + "']," + + "['CXX', '" + android_compilers[1] + "']," + + "['CC.host', '" + android_compilers[2] + "']," + + "['CXX.host', '" + android_compilers[3] + "']," + } + + if (use_goma) { + # There is a TODO(yyanagisawa) in common.gypi about the make generator not + # supporting CC_wrapper without CC. As a result, we must add a condition + # when on the generator when we're not explicitly setting the variables + # above (which happens when gyp_header is empty at this point). + # + # GYP will interpret the file once for each generator, so we have to write + # this condition into the GYP file since the user could have more than one + # generator set. + gyp_header = + "'conditions': [" + + "['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" + + make_global_settings + + make_goma_global_settings + + "]}]]," + } else { + gyp_header = "'make_global_settings': [" + make_global_settings + "]," + } +} + +gcc_toolchain("x86") { + prefix = "$android_ndk_root/toolchains/x86-4.6/prebuilt/$build_os-$android_host_arch/bin/i686-linux-android-" + cc = prefix + "gcc" + cxx = prefix + "g++" + ar = prefix + "ar" + ld = cxx + + toolchain_cpu_arch = "x86" + toolchain_os = "android" +} + +gcc_toolchain("arm") { + prefix = "$android_ndk_root/toolchains/arm-linux-androideabi-4.6/prebuilt/$build_os-$android_host_arch/bin/arm-linux-androideabi-" + cc = prefix + "gcc" + cxx = prefix + "g++" + ar = prefix + "ar" + ld = cxx + + toolchain_cpu_arch = "arm" + toolchain_os = "android" +} + +gcc_toolchain("mipsel") { + prefix = "$android_ndk_root/toolchains/mipsel-linux-android-4.6/prebuilt/$build_os-$android_host_arch/bin/mipsel-linux-android-" + cc = prefix + "gcc" + cxx = prefix + "g++" + ar = prefix + "ar" + ld = cxx + + toolchain_cpu_arch = "mipsel" + toolchain_os = "android" +} diff --git a/build/toolchain/android/find_android_compiler.py b/build/toolchain/android/find_android_compiler.py new file mode 100644 index 0000000000..d806ead80d --- /dev/null +++ b/build/toolchain/android/find_android_compiler.py @@ -0,0 +1,41 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This script locates the Android compilers given the bin directory of the +# android toolchain. + +import glob +import subprocess +import sys + +if len(sys.argv) != 2: + print "Error: expecting one argument of the android toolchain dir." + sys.exit(1) + +# TODO(brettw) this logic seems like a bad idea. It was copied from +# common.gypi. It seems like the toolchain should just know the name given the +# current platform rather than having to rely on glob. +android_toolchain = sys.argv[1] +cc = glob.glob(android_toolchain + "/*-gcc") +cxx = glob.glob(android_toolchain + "/*-g++") + +# We tolerate "no matches." In the Android AOSP WebView build, it runs this +# logic and the directory doesn't exist, giving no matches. But that build runs +# GYP to generate Android Makefiles which specify the compiler separately. So +# all we need to do in this case is ignore the error and continue with empty +# target compilers. +if len(cc) == 0: + cc = [""] +if len(cxx) == 0: + cxx = [""] +if len(cc) != 1 or len(cxx) != 1: + print "More than one matching compiler." + sys.exit(1) + +# Get the host compilers from the current path. +which_gcc = subprocess.check_output(["which gcc"], shell=True).strip() +which_gxx = subprocess.check_output(["which g++"], shell=True).strip() + +print ('["' + cc[0] + '","' + cxx[0] + '","' + which_gcc + '","' + + which_gxx + '"]') diff --git a/build/toolchain/clang.gni b/build/toolchain/clang.gni new file mode 100644 index 0000000000..433ab3227d --- /dev/null +++ b/build/toolchain/clang.gni @@ -0,0 +1,34 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + use_clang_type_profiler = false +} + +if (is_clang) { + # Define "make_clang_dir" which is the directory relative to the source root + # of the clang directory we're using. This is used for defining the header + # for GYP so it must match the directory format of GYP (rather than using + # GN-style "//..." paths). + if (is_linux && use_clang_type_profiler) { + if (cpu_arch == "x64") { + make_clang_dir = "third_party/llvm-allocated-type/Linux_x64" + } else { + # 32-bit Clang is unsupported. It may not build. Put your 32-bit Clang in + # this directory at your own risk if needed for some purpose (e.g. to + # compare 32-bit and 64-bit behavior like memory usage). Any failure by + # this compiler should not close the tree. + make_clang_dir = "third_party/llvm-allocated-type/Linux_ia32" + } + } else { + make_clang_dir = "third_party/llvm-build/Release+Asserts" + } + + # This includes the array values but not the 'make_global_settings' name. + make_clang_global_settings = + "['CC', '$make_clang_dir/bin/clang']," + + "['CXX', '$make_clang_dir/bin/clang++']," + + "['CC.host', '\$(CC)']," + + "['CXX.host', '\$(CXX)']," +} diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni new file mode 100644 index 0000000000..e1f8a8941c --- /dev/null +++ b/build/toolchain/gcc_toolchain.gni @@ -0,0 +1,68 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This template defines a GCC toolchain. +# +# It requires the following variables specifying the executables to run: +# - cc +# - cxx +# - ar +# - ld +# and the following which is used in the toolchain_args +# - toolchain_cpu_arch (What "cpu_arch" should be set to when invoking a +# build using this toolchain.) +# - toolchain_os (What "os" should be set to when invoking a build using this +# toolchain.) +template("gcc_toolchain") { + toolchain(target_name) { + # Make these apply to all tools below. + lib_prefix = "-l" + lib_dir_prefix="-L" + + tool("cc") { + # cflags_pch_c + command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out" + description = "CC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("cxx") { + # cflags_pch_cc + command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out" + description = "CXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("alink") { + command = "rm -f \$out && $ar rcs \$out \$in" + description = "AR \$out" + } + tool("solink") { + command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" + description = "SOLINK \$lib" + #pool = "link_pool" + restat = "1" + } + tool("link") { + command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs" + description = "LINK \$out" + #pool = "link_pool" + } + tool("stamp") { + command = "\${postbuilds}touch \$out" + description = "STAMP \$out" + } + tool("copy") { + command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)" + description = "COPY \$in \$out" + } + + # When invoking this toolchain not as the default one, these args will be + # passed to the build. They are ignored when this is the default toolchain. + toolchain_args() { + cpu_arch = toolchain_cpu_arch + os = toolchain_os + } + } +} diff --git a/build/toolchain/get_default_posix_goma_dir.py b/build/toolchain/get_default_posix_goma_dir.py new file mode 100644 index 0000000000..2aa02674fe --- /dev/null +++ b/build/toolchain/get_default_posix_goma_dir.py @@ -0,0 +1,11 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This script returns the default goma directory for Posix systems, which is +# relative to the user's home directory. On Windows, goma.gypi hardcodes a +# value. + +import os + +print '"' + os.environ['HOME'] + '/goma"' diff --git a/build/toolchain/goma.gni b/build/toolchain/goma.gni new file mode 100644 index 0000000000..dca6a4dbfa --- /dev/null +++ b/build/toolchain/goma.gni @@ -0,0 +1,34 @@ +# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Defines the configuration of Goma. +# +# This is currently designed to match the GYP build exactly, so as not to break +# people during the transition. + +declare_args() { + use_goma = false + + goma_dir = "" +} + +if (use_goma && goma_dir == "") { + # Set the default goma directory. This must be a character-for-character + # match for the GYP default or else the compilers for the different targets + # won't match and GYP will assert. + if (is_win) { + goma_dir = "c:\goma\goma-win" + } else { + goma_dir = exec_script("get_default_posix_goma_dir.py", [], "value") + } +} + +if (use_goma) { + # Define the toolchain for the GYP build when using goma. + make_goma_global_settings = + "['CC_wrapper', '$goma_dir/gomacc']," + + "['CXX_wrapper', '$goma_dir/gomacc']," + + "['CC.host_wrapper', '$goma_dir/gomacc']," + + "['CXX.host_wrapper', '$goma_dir/gomacc']," +} diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn index ffb378beb8..38f4b184ce 100644 --- a/build/toolchain/linux/BUILD.gn +++ b/build/toolchain/linux/BUILD.gn @@ -1,180 +1,114 @@ -# Copyright (c) 2013 The Chromium Authors. All rights reserved. +# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -cc = "gcc" -cxx = "g++" -ar = "ar" -ld = cxx +import("//build/config/sysroot.gni") +import("//build/toolchain/clang.gni") +import("//build/toolchain/gcc_toolchain.gni") +import("//build/toolchain/goma.gni") -# The toolchains below all issue the same commands with some different flags. -# TODO(brettw) it would be nice to have a different way to express this without -# so much duplication. -cc_command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out" -cxx_command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out" -alink_command = "rm -f \$out && $ar rcs \$out \$in" -solink_command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" -link_command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs" -stamp_command = "\${postbuilds}touch \$out" -copy_command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)" - -# ARM -------------------------------------------------------------------------- - -cc = "arm-linux-gnueabi-gcc" -cxx = "arm-linux-gnueabi-g++" -ar = "arm-linux-gnueabi-ar" -ld = cxx - -toolchain("arm") { - # Make these apply to all tools below. - lib_prefix = "-l" - lib_dir_prefix="-L" - - tool("cc") { - # cflags_pch_c - command = cc_command - description = "CC \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("cxx") { - # cflags_pch_cc - command = cxx_command - description = "CXX \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("alink") { - command = alink_command - description = "AR \$out" - } - tool("solink") { - command = solink_command - description = "SOLINK \$lib" - #pool = "link_pool" - restat = "1" - } - tool("link") { - command = link_command - description = "LINK \$out" - #pool = "link_pool" - } - tool("stamp") { - command = stamp_command - description = "STAMP \$out" - } - tool("copy") { - command = copy_command - description = "COPY \$in \$out" +if (is_gyp) { + # Set the compilers for GYP to use. This logic is only relevant to GYP where + # there is "a" target compiler. In native GN builds, we have separate + # compilers for the toolchains below, any or all of which could be active in + # any given build. + if (is_clang) { + # Set the GYP header for all toolchains when running under Clang. + make_global_settings = make_clang_global_settings + } else { + if (cpu_arch == "mipsel") { + make_global_settings = + "['CC', '$sysroot/../bin/mipsel-linux-gnu-gcc']," + + "['CXX', '$sysroot/../bin/mipsel-linux-gnu-g++']," + + "['CC.host', '/usr/bin/gcc']," + + "['CXX.host', '/usr/bin/g++']," + } else { + make_global_settings = "" + } } - # When invoking this toolchain not as the default one, these args will be - # passed to the build. They are ignored when this is the default toolchain. - toolchain_args() { - cpu_arch = "arm" + if (use_goma) { + # There is a TODO(yyanagisawa) in common.gypi about the make generator not + # supporting CC_wrapper without CC. As a result, we must add a condition + # when on the generator when we're not explicitly setting the variables + # above (which happens when gyp_header is empty at this point). + # + # GYP will interpret the file once for each generator, so we have to write + # this condition into the GYP file since the user could have more than one + # generator set. + gyp_header = + "'conditions':" + + "[['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" + + make_global_settings + + make_goma_global_settings + + "]}]]," + } else { + gyp_header = "'make_global_settings': [" + make_global_settings + "]," } } -# 32-bit ----------------------------------------------------------------------- +gcc_toolchain("arm") { + cc = "arm-linux-gnueabi-gcc" + cxx = "arm-linux-gnueabi-g++" + ar = "arm-linux-gnueabi-ar" + ld = cxx -toolchain("32") { - # Make these apply to all tools below. - lib_prefix = "-l" - lib_dir_prefix="-L" + toolchain_cpu_arch = "arm" + toolchain_os = "linux" +} - tool("cc") { - # cflags_pch_c - command = cc_command - description = "CC \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("cxx") { - # cflags_pch_cc - command = cxx_command - description = "CXX \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("alink") { - command = alink_command - description = "AR \$out" - } - tool("solink") { - command = solink_command - description = "SOLINK \$lib" - #pool = "link_pool" - restat = "1" - } - tool("link") { - command = link_command - description = "LINK \$out" - #pool = "link_pool" - } - tool("stamp") { - command = stamp_command - description = "STAMP \$out" - } - tool("copy") { - command = copy_command - description = "COPY \$in \$out" +gcc_toolchain("x86") { + if (is_clang) { + if (use_clang_type_profiler) { + prefix = rebase_path("//third_party/llvm-allocated-type/Linux_ia32/bin", + ".", root_build_dir) + } else { + prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", + ".", root_build_dir) + } + cc = "$prefix/clang" + cxx = "$prefix/clang++" + } else { + cc = "gcc" + cxx = "g++" } - # When invoking this toolchain not as the default one, these args will be - # passed to the build. They are ignored when this is the default toolchain. - toolchain_args() { - cpu_arch = "x32" - } + ar = "ar" + ld = cxx + + toolchain_cpu_arch = "x86" + toolchain_os = "linux" } -# 64-bit ----------------------------------------------------------------------- +gcc_toolchain("x64") { + if (is_clang) { + if (use_clang_type_profiler) { + prefix = rebase_path("//third_party/llvm-allocated-type/Linux_x64/bin", + ".", root_build_dir) + } else { + prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", + ".", root_build_dir) + } + cc = "$prefix/clang" + cxx = "$prefix/clang++" + } else { + cc = "gcc" + cxx = "g++" + } -toolchain("64") { - # Make these apply to all tools below. - lib_prefix = "-l" - lib_dir_prefix="-L" + ar = "ar" + ld = cxx - tool("cc") { - # cflags_pch_c - command = cc_command - description = "CC \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("cxx") { - # cflags_pch_cc - command = cxx_command - description = "CXX \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("alink") { - command = alink_command - description = "AR \$out" - } - tool("solink") { - command = solink_command - description = "SOLINK \$lib" - #pool = "link_pool" - restat = "1" - } - tool("link") { - command = link_command - description = "LINK \$out" - #pool = "link_pool" - } - tool("stamp") { - command = stamp_command - description = "STAMP \$out" - } - tool("copy") { - command = copy_command - description = "COPY \$in \$out" - } + toolchain_cpu_arch = "x64" + toolchain_os = "linux" +} - # When invoking this toolchain not as the default one, these args will be - # passed to the build. They are ignored when this is the default toolchain. - toolchain_args() { - cpu_arch = "x64" - } +gcc_toolchain("mipsel") { + cc = "mipsel-linux-gnu-gcc" + cxx = "mipsel-linux-gnu-g++" + ar = "mipsel-linux-gnu-ar" + ld = cxx + + toolchain_cpu_arch = "mipsel" + toolchain_os = "linux" } diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index b8a3c5eef1..afd09e0a45 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -2,11 +2,49 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires +# some enhancements since the commands on Mac are slightly different than on +# Linux. + +import("../goma.gni") + # Should only be running on Mac. -assert(is_mac) +assert(is_mac || is_ios) + +import("//build/toolchain/clang.gni") +import("//build/toolchain/goma.gni") + +if (is_clang) { + cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang", ".", root_build_dir) + cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++", ".", root_build_dir) + + # Set the GYP header for all toolchains when running under Clang. + if (is_gyp) { + make_global_settings = make_clang_global_settings -cc = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang", ".", root_build_dir) -cxx = rebase_path("//third_party/llvm-build/Release+Asserts/bin/clang++", ".", root_build_dir) + if (use_goma) { + # There is a TODO(yyanagisawa) in common.gypi about the make generator not + # supporting CC_wrapper without CC. As a result, we must add a condition + # when on the generator when we're not explicitly setting the variables + # above (which happens when gyp_header is empty at this point). + # + # GYP will interpret the file once for each generator, so we have to write + # this condition into the GYP file since the user could have more than one + # generator set. + gyp_header = + "'conditions':" + + "[['\"<(GENERATOR)\"==\"ninja\"', { 'make_global_settings': [" + + make_global_settings + + make_goma_global_settings + + "]}]]," + } else { + gyp_header = "'make_global_settings': [" + make_global_settings + "]," + } + } +} else { + cc = "gcc" + cxx = "g++" +} ld = cxx # This will copy the gyp-mac-tool to the build directory. We pass in the source @@ -15,68 +53,87 @@ gyp_mac_tool_source = rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", ".", root_build_dir) exec_script("setup_toolchain.py", [ gyp_mac_tool_source ], "value") -toolchain("clang") { - # Make these apply to all tools below. - lib_prefix = "-l" - lib_dir_prefix="-L" +# Shared toolchain definition. Invocations should set toolchain_os to set the +# build args in this definition. +template("mac_clang_toolchain") { + toolchain(target_name) { + # Make these apply to all tools below. + lib_prefix = "-l" + lib_dir_prefix="-L" - tool("cc") { - command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_pch_c -c \$in -o \$out" - description = "CC \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("cxx") { - command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_pch_cc -c \$in -o \$out" - description = "CXX \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("objc") { - command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_objc \$cflags_pch_objc -c \$in -o \$out" - description = "OBJC \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("objcxx") { - command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_objcc \$cflags_pch_objcc -c \$in -o \$out" - description = "OBJCXX \$out" - depfile = "\$out.d" - deps = "gcc" - } - tool("alink") { - command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_flags -static -o \$out \$in \$postbuilds" - description = "LIBTOOL-STATIC \$out, POSTBUILDS" - } - tool("solink") { - command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" - description = "SOLINK \$lib, POSTBUILDS" - #pool = "link_pool" - restat = "1" - } - tool("link") { - command = "$ld \$ldflags -o \$out \$in \$solibs \$libs \$postbuilds" - description = "LINK \$out, POSTBUILDS" - #pool = "link_pool" - } - #tool("infoplist") { - # command = "$cc -E -P -Wno-trigraphs -x c \$defines \$in -o \$out && plutil -convert xml1 \$out \$out" - # description = "INFOPLIST \$out" - #} - #tool("mac_tool") { - # command = "\$env ./gyp-mac-tool \$mactool_cmd \$in \$out" - # description = "MACTOOL \$mactool_cmd \$in" - #} - #tool("package_framework") { - # command = "./gyp-mac-tool package-framework \$out \$version \$postbuilds && touch \$out" - # description = "PACKAGE FRAMEWORK \$out, POSTBUILDS" - #} - tool("stamp") { - command = "\${postbuilds}touch \$out" - description = "STAMP \$out" - } - tool("copy") { - command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)" - description = "COPY \$in \$out" + tool("cc") { + command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_pch_c -c \$in -o \$out" + description = "CC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("cxx") { + command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_pch_cc -c \$in -o \$out" + description = "CXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("objc") { + command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_objc \$cflags_pch_objc -c \$in -o \$out" + description = "OBJC \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("objcxx") { + command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_objcc \$cflags_pch_objcc -c \$in -o \$out" + description = "OBJCXX \$out" + depfile = "\$out.d" + deps = "gcc" + } + tool("alink") { + command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_flags -static -o \$out \$in \$postbuilds" + description = "LIBTOOL-STATIC \$out, POSTBUILDS" + } + tool("solink") { + command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" + description = "SOLINK \$lib, POSTBUILDS" + #pool = "link_pool" + restat = "1" + } + tool("link") { + command = "$ld \$ldflags -o \$out \$in \$solibs \$libs \$postbuilds" + description = "LINK \$out, POSTBUILDS" + #pool = "link_pool" + } + #tool("infoplist") { + # command = "$cc -E -P -Wno-trigraphs -x c \$defines \$in -o \$out && plutil -convert xml1 \$out \$out" + # description = "INFOPLIST \$out" + #} + #tool("mac_tool") { + # command = "\$env ./gyp-mac-tool \$mactool_cmd \$in \$out" + # description = "MACTOOL \$mactool_cmd \$in" + #} + #tool("package_framework") { + # command = "./gyp-mac-tool package-framework \$out \$version \$postbuilds && touch \$out" + # description = "PACKAGE FRAMEWORK \$out, POSTBUILDS" + #} + tool("stamp") { + command = "\${postbuilds}touch \$out" + description = "STAMP \$out" + } + tool("copy") { + command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)" + description = "COPY \$in \$out" + } + + toolchain_args() { + os = toolchain_os + } } } + +# Toolchain representing the target build (either mac or iOS). +mac_clang_toolchain("clang") { + toolchain_os = os +} + +# This toolchain provides a way for iOS target compiles to reference targets +# compiled for the host system. It just overrides the OS back to "mac". +mac_clang_toolchain("host_clang") { + toolchain_os = "mac" +} diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn index 6abf8082da..1c1977b9db 100644 --- a/build/toolchain/win/BUILD.gn +++ b/build/toolchain/win/BUILD.gn @@ -2,30 +2,31 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/toolchain/goma.gni") + # Should only be running on Windows. assert(is_win) +import("//build/config/win/visual_studio_version.gni") + # Setup the Visual Studio state. # -# Its argument is the location to write the environment files. -# It will write "environment.x86" and "environment.x64" to this directory, -# and return a list to us. -# -# The list contains the include path as its only element. (I'm expecting to -# add more so it's currently a list inside a list.) -#exec_script("get_msvc_config.py", - # [relative_root_output_dir], - # "value") - -# This will save the environment block and and copy the gyp-win-tool to the -# build directory. We pass in the source file of the win tool. -gyp_win_tool_source = - rebase_path("//tools/gyp/pylib/gyp/win_tool.py", ".", root_build_dir) -exec_script("setup_toolchain.py", [ gyp_win_tool_source ], "value") +# Its arguments are the VS path and the compiler wrapper tool. It will write +# "environment.x86" and "environment.x64" to the build directory and return a +# list to us. +gyp_win_tool_path = rebase_path("//tools/gyp/pylib/gyp/win_tool.py", ".", + root_build_dir) +exec_script("setup_toolchain.py", [ visual_studio_path, gyp_win_tool_path ], + "string") stamp_command = "$python_path gyp-win-tool stamp \$out" copy_command = "$python_path gyp-win-tool recursive-mirror \$in \$out" +if (use_goma) { + # Add the Goma compiler prefixes to the GYP file. + gyp_header = "'make_global_settings': [ $make_goma_global_settings ]," +} + # 32-bit toolchain ------------------------------------------------------------- toolchain("32") { @@ -57,20 +58,20 @@ toolchain("32") { description = "ASM \$in" } tool("alink") { - command = "$python_path gyp-win-tool link-wrapper environment.x86 lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp" + command = "$python_path gyp-win-tool link-wrapper environment.x86 False lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp" description = "LIB \$out" rspfile = "\$out.rsp" rspfile_content = "\$in_newline \$libflags" } tool("solink") { - command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest" + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 False link.exe /nologo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$dll.manifest del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest" description = "LINK(DLL) \$dll" restat = "1" rspfile = "\$dll.rsp" rspfile_content = "\$libs \$in_newline \$ldflags" } tool("link") { - command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 link.exe /nologo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$out.manifest" + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x86 cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper environment.x86 mt.exe -nologo -manifest \$manifests -out:\$out.manifest" description = "LINK \$out" rspfile = "\$out.rsp" rspfile_content = "\$in_newline \$libs \$ldflags" @@ -116,20 +117,20 @@ toolchain("64") { description = "ASM \$in" } tool("alink") { - command = "$python_path gyp-win-tool link-wrapper environment.x64 lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp" + command = "$python_path gyp-win-tool link-wrapper environment.x64 False lib.exe /nologo /ignore:4221 /OUT:\$out @\$out.rsp" description = "LIB \$out" rspfile = "\$out.rsp" rspfile_content = "\$in_newline \$libflags" } tool("solink") { - command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x64 link.exe /nologo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool manifest-wrapper environment.x64 cmd /c if exist \$dll.manifest del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x64 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest" + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x64 False link.exe /nologo \$implibflag /DLL /OUT:\$dll /PDB:\$dll.pdb @\$dll.rsp && $python_path gyp-win-tool manifest-wrapper environment.x64 cmd /c if exist \$dll.manifest del \$dll.manifest && $python_path gyp-win-tool manifest-wrapper environment.x64 mt.exe -nologo -manifest \$manifests -out:\$dll.manifest" description = "LINK(DLL) \$dll" restat = "1" rspfile = "\$dll.rsp" rspfile_content = "\$libs \$in_newline \$ldflags" } tool("link") { - command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x64 link.exe /nologo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x64 cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper environment.x64 mt.exe -nologo -manifest \$manifests -out:\$out.manifest" + command = "cmd /c $python_path gyp-win-tool link-wrapper environment.x64 False link.exe /nologo /OUT:\$out /PDB:\$out.pdb @\$out.rsp && $python_path gyp-win-tool manifest-wrapper environment.x64 cmd /c if exist \$out.manifest del \$out.manifest && $python_path gyp-win-tool manifest-wrapper environment.x64 mt.exe -nologo -manifest \$manifests -out:\$out.manifest" description = "LINK \$out" rspfile = "\$out.rsp" rspfile_content = "\$in_newline \$libs \$ldflags" diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py index 162c2e16ce..bceafd121b 100644 --- a/build/toolchain/win/setup_toolchain.py +++ b/build/toolchain/win/setup_toolchain.py @@ -2,10 +2,23 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import errno import os import re +import subprocess import sys +""" +Copies the given "win tool" (which the toolchain uses to wrap compiler +invocations) and the environment blocks for the 32-bit and 64-bit builds on +Windows to the build directory. + +The arguments are the visual studio install location and the location of the +win tool. The script assumes that the root build directory is the current dir +and the files will be written to the current directory. +""" + + def ExtractImportantEnvironment(): """Extracts environment variables required for the toolchain from the current environment.""" @@ -36,48 +49,6 @@ def ExtractImportantEnvironment(): return result -# VC setup will add a path like this in 32-bit mode: -# c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN -# And this in 64-bit mode: -# c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64 -# Note that in 64-bit it's duplicated but the 64-bit one comes first. -# -# What we get as the path when running this will depend on which VS setup -# script you've run. The following two functions try to do this. - -# For 32-bit compiles remove anything that ends in "\VC\WIN\amd64". -def FixupPath32(path): - find_64 = re.compile("VC\\\\BIN\\\\amd64\\\\*$", flags=re.IGNORECASE) - - for i in range(len(path)): - if find_64.search(path[i]): - # Found 32-bit path, insert the 64-bit one immediately before it. - dir_64 = path[i].rstrip("\\") - dir_64 = dir_64[:len(dir_64) - 6] # Trim off "\amd64". - path[i] = dir_64 - break - return path - -# For 64-bit compiles, append anything ending in "\VC\BIN" with "\amd64" as -# long as that thing isn't already in the list, and append it immediately -# before the non-amd64-one. -def FixupPath64(path): - find_32 = re.compile("VC\\\\BIN\\\\*$", flags=re.IGNORECASE) - - for i in range(len(path)): - if find_32.search(path[i]): - # Found 32-bit path, insert the 64-bit one immediately before it. - dir_32 = path[i] - if dir_32[len(dir_32) - 1] == '\\': - dir_64 = dir_32 + "amd64" - else: - dir_64 = dir_32 + "\\amd64" - path.insert(i, dir_64) - break - - return path - - def FormatAsEnvironmentBlock(envvar_dict): """Format as an 'environment block' directly suitable for CreateProcess. Briefly this is a list of key=value\0, terminated by an additional \0. See @@ -89,6 +60,7 @@ def FormatAsEnvironmentBlock(envvar_dict): block += nul return block + def CopyTool(source_path): """Copies the given tool to the current directory, including a warning not to edit it.""" @@ -102,22 +74,27 @@ def CopyTool(source_path): '# Generated by setup_toolchain.py do not edit.\n'] + tool_source[1:])) +if len(sys.argv) != 3: + print 'Usage setup_toolchain.py <visual studio path> <win tool path>' + sys.exit(2) +vs_path = sys.argv[1] +tool_source = sys.argv[2] -# Find the tool source, it's the first argument, and copy it. -if len(sys.argv) != 2: - print "Need one argument (win_tool source path)." - sys.exit(1) -CopyTool(sys.argv[1]) +CopyTool(tool_source) important_env_vars = ExtractImportantEnvironment() path = important_env_vars["PATH"].split(";") -important_env_vars["PATH"] = ";".join(FixupPath32(path)) +# Add 32-bit compiler path to the beginning and write the block. +path32 = [os.path.join(vs_path, "VC\\BIN")] + path +important_env_vars["PATH"] = ";".join(path32) environ = FormatAsEnvironmentBlock(important_env_vars) with open('environment.x86', 'wb') as env_file: env_file.write(environ) -important_env_vars["PATH"] = ";".join(FixupPath64(path)) +# Add 64-bit compiler path to the beginning and write the block. +path64 = [os.path.join(vs_path, "VC\\BIN\\amd64")] + path +important_env_vars["PATH"] = ";".join(path64) environ = FormatAsEnvironmentBlock(important_env_vars) with open('environment.x64', 'wb') as env_file: env_file.write(environ) diff --git a/build/util/LASTCHANGE b/build/util/LASTCHANGE index 9cd69e2e25..b3a84b9f41 100644 --- a/build/util/LASTCHANGE +++ b/build/util/LASTCHANGE @@ -1 +1 @@ -LASTCHANGE=240154 +LASTCHANGE=251904 diff --git a/build/util/LASTCHANGE.blink b/build/util/LASTCHANGE.blink index 78c37c8f8a..f43548caba 100644 --- a/build/util/LASTCHANGE.blink +++ b/build/util/LASTCHANGE.blink @@ -1 +1 @@ -LASTCHANGE=163628 +LASTCHANGE=167304 diff --git a/build/whitespace_file.txt b/build/whitespace_file.txt index 8c44313567..2a4f754a00 100644 --- a/build/whitespace_file.txt +++ b/build/whitespace_file.txt @@ -10,7 +10,7 @@ any modification below this line. Let's make a story. Add one sentence for every commit: -CHAPTER 1: +CHÄPTER 1: It was a dark and blinky night; the rain fell in torrents -- except at occasional intervals, when it was checked by a violent gust of wind which swept up the streets (for it is in London that our scene lies), rattling along @@ -58,7 +58,7 @@ a bottle of 3000¥ sake. He tries to recall the cook's face. Purple? CHAPTER 5: Many tears later, Mr. Usagi would laugh at the memory of the earnest, -well-intentioned Domo-Kun. Another day in the life. That is whe he realized that +well-intentioned Domo-Kun. Another day in the life. That is when he realized that life goes on. TRUISMS (1978-1983) @@ -77,3 +77,6 @@ AM NOT ARE TOO IF AT FIRST YOU DON'T SUCCEED: TRY, EXCEPT, FINALLY AND THEN, TIME LEAPT BACKWARDS +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhh LOT +I'm really tempted to change something above the line. +Reeccciiiipppppeeeeeesssssss!!!!!!!!! diff --git a/build/win/importlibs/create_import_lib.gypi b/build/win/importlibs/create_import_lib.gypi index c809eab84f..9cb0d34548 100644 --- a/build/win/importlibs/create_import_lib.gypi +++ b/build/win/importlibs/create_import_lib.gypi @@ -46,7 +46,6 @@ '--output-file', '<@(_outputs)', '<(RULE_INPUT_PATH)', ], - 'msvs_cygwin_shell': 0, 'message': 'Generating import library from <(RULE_INPUT_PATH)', 'process_outputs_as_sources': 0, }, diff --git a/build/win/reorder-imports.py b/build/win/reorder-imports.py new file mode 100755 index 0000000000..281668fff5 --- /dev/null +++ b/build/win/reorder-imports.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import glob +import optparse +import os +import shutil +import subprocess +import sys + +def reorder_imports(input_dir, output_dir, architecture): + """Run swapimports.exe on the initial chrome.exe, and write to the output + directory. Also copy over any related files that might be needed + (pdbs, manifests etc.). + """ + + input_image = os.path.join(input_dir, 'chrome.exe') + output_image = os.path.join(output_dir, 'chrome.exe') + + swap_exe = os.path.join( + __file__, + '..\\..\\..\\third_party\\syzygy\\binaries\\exe\\swapimport.exe') + + args = [swap_exe, '--input-image=%s' % input_image, + '--output-image=%s' % output_image, '--overwrite', '--no-logo'] + + if architecture == 'x64': + args.append('--x64'); + + args.append('chrome_elf.dll'); + + subprocess.call(args) + + for fname in glob.iglob(os.path.join(input_dir, 'chrome.exe.*')): + shutil.copy(fname, os.path.join(output_dir, os.path.basename(fname))) + return 0 + + +def main(argv): + usage = 'reorder_imports.py -i <input_dir> -o <output_dir> -a <target_arch>' + parser = optparse.OptionParser(usage=usage) + parser.add_option('-i', '--input', help='reorder chrome.exe in DIR', + metavar='DIR') + parser.add_option('-o', '--output', help='write new chrome.exe to DIR', + metavar='DIR') + parser.add_option('-a', '--arch', help='architecture of build (optional)', + default='ia32') + opts, args = parser.parse_args() + + if not opts.input or not opts.output: + parser.error('Please provide and input and output directory') + return reorder_imports(opts.input, opts.output, opts.arch) + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/build/win/setup_cygwin_mount.py b/build/win/setup_cygwin_mount.py deleted file mode 100644 index d68a3af41d..0000000000 --- a/build/win/setup_cygwin_mount.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import sys - -def main(): - if len(sys.argv) != 2 or sys.argv[1] != '--win-only': - return 1 - if sys.platform in ('win32', 'cygwin'): - self_dir = os.path.dirname(sys.argv[0]) - mount_path = os.path.join(self_dir, "../../third_party/cygwin") - batch_path = os.path.join(mount_path, "setup_mount.bat") - return os.system(os.path.normpath(batch_path) + ">nul") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) |