diff options
author | Ben Murdoch <benm@google.com> | 2014-04-10 11:22:14 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2014-04-10 11:22:14 +0100 |
commit | c5cede9ae108bb15f6b7a8aea21c7e1fefa2834c (patch) | |
tree | e9edd581ad60ab80aa5ab423a2a80df652a75792 /build | |
parent | 54cd42278ccf1d52996034848086a09b23065a40 (diff) | |
download | chromium_org-c5cede9ae108bb15f6b7a8aea21c7e1fefa2834c.tar.gz |
Merge from Chromium at DEPS revision 262940
This commit was generated by merge_to_master.py.
Change-Id: I9a3fddbb29857fa8f68a18c6a0115862b65f84d1
Diffstat (limited to 'build')
35 files changed, 636 insertions, 253 deletions
diff --git a/build/all.gyp b/build/all.gyp index 1b9d5fe7a9..028d926503 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -223,6 +223,11 @@ '../google_apis/gcm/gcm.gyp:*', ], }], + ['chromeos==1 or (OS=="linux" and use_aura==1)', { + 'dependencies': [ + '../apps/shell/app_shell.gyp:*', + ], + }], ], }, # target_name: All { @@ -459,7 +464,6 @@ '../chrome/chrome.gyp:chrome', '../chrome/chrome.gyp:load_library_perf_tests', '../chrome/chrome.gyp:performance_browser_tests', - '../chrome/chrome.gyp:performance_ui_tests', '../chrome/chrome.gyp:sync_performance_tests', '../media/media.gyp:media_perftests', '../tools/perf/clear_system_cache/clear_system_cache.gyp:*', @@ -494,7 +498,6 @@ 'dependencies': [ '../chrome/chrome.gyp:chrome', '../chrome/chrome.gyp:performance_browser_tests', - '../chrome/chrome.gyp:performance_ui_tests', '../content/content_shell_and_tests.gyp:content_browsertests', '../content/content_shell_and_tests.gyp:content_gl_tests', '../gpu/gles2_conform_support/gles2_conform_test.gyp:gles2_conform_test', @@ -772,6 +775,7 @@ '../sql/sql.gyp:sql_unittests_apk', '../sync/sync.gyp:sync_unit_tests_apk', '../ui/events/events.gyp:events_unittests_apk', + '../ui/gfx/gfx.gyp:gfx_unittests_apk', '../ui/ui_unittests.gyp:ui_unittests_apk', '../android_webview/android_webview.gyp:android_webview_test_apk', '../chrome/chrome.gyp:chrome_shell_test_apk', @@ -884,7 +888,6 @@ '../cc/cc_tests.gyp:cc_unittests', '../chrome/chrome.gyp:browser_tests', '../chrome/chrome.gyp:performance_browser_tests', - '../chrome/chrome.gyp:performance_ui_tests', '../chrome/chrome.gyp:sync_integration_tests', '../chrome/chrome.gyp:unit_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', @@ -985,7 +988,6 @@ '../chrome/chrome.gyp:interactive_ui_tests', '../chrome/chrome.gyp:mini_installer_test', '../chrome/chrome.gyp:performance_browser_tests', - '../chrome/chrome.gyp:performance_ui_tests', '../chrome/chrome.gyp:sync_integration_tests', '../chrome/chrome.gyp:unit_tests', '../cloud_print/cloud_print.gyp:cloud_print_unittests', diff --git a/build/android/adb_gdb b/build/android/adb_gdb index ee9f45f2d0..a5e49187db 100755 --- a/build/android/adb_gdb +++ b/build/android/adb_gdb @@ -245,12 +245,7 @@ them up automatically for you though: - host gdb client (e.g. arm-linux-androideabi-gdb) - directory with symbolic version of $PROGRAM_NAME's shared libraries. -If you have sourced Chromium's build/android/envsetup.sh, this script will -find all of them automatically. This is the recommended way to use it. - -Otherwise, if you have ANDROID_NDK_ROOT defined in your environment, -the script will use it to find the gdb and gdbserver binaries. You can -also use --ndk-dir=<path> to specify an alternative NDK installation +You can also use --ndk-dir=<path> to specify an alternative NDK installation directory. The script tries to find the most recent version of the debug version of @@ -342,10 +337,8 @@ if [ -z "$PACKAGE_NAME" ]; then fi if [ -z "$NDK_DIR" ]; then - if [ -z "$ANDROID_NDK_ROOT" ]; then - panic "Can't find NDK directory, please source \ -build/android/envsetup.sh!" - fi + ANDROID_NDK_ROOT=$(PYTHONPATH=build/android python -c \ +'from pylib.constants import ANDROID_NDK_ROOT; print ANDROID_NDK_ROOT,') else if [ ! -d "$NDK_DIR" ]; then panic "Invalid directory: $NDK_DIR" diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh index b7ed3522f8..33247a2451 100755 --- a/build/android/envsetup.sh +++ b/build/android/envsetup.sh @@ -12,50 +12,42 @@ if [[ -n "$BASH_VERSION" && "${BASH_SOURCE:-$0}" == "$0" ]]; then exit 1 fi -SCRIPT_DIR="$(dirname "${BASH_SOURCE:-$0}")" - -CURRENT_DIR="$(readlink -f "${SCRIPT_DIR}/../../")" -if [[ -z "${CHROME_SRC}" ]]; then - # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. - export CHROME_SRC="${CURRENT_DIR}" -fi - -if [[ "${CURRENT_DIR/"${CHROME_SRC}"/}" == "${CURRENT_DIR}" ]]; then - # If current directory is not in $CHROME_SRC, it might be set for other - # source tree. If $CHROME_SRC was set correctly and we are in the correct - # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". - # Otherwise, it will equal to "${CURRENT_DIR}" - echo "Warning: Current directory is out of CHROME_SRC, it may not be \ -the one you want." - echo "${CHROME_SRC}" -fi - -# 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. -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_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then - export ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" -fi - -# Add Android SDK tools to system path. -export PATH=$PATH:${ANDROID_SDK_ROOT}/tools -export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools - -# Add Chromium Android development scripts to system path. -# Must be after CHROME_SRC is set. -export PATH=$PATH:${CHROME_SRC}/build/android - -if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then - # 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). - export OFFICIAL_BUILD=1 - export CHROMIUM_BUILD="_google_chrome" - export CHROME_BUILD_TYPE="_official" -fi +# This only exists to set local variables. Don't call this manually. +android_envsetup_main() { + local SCRIPT_DIR="$(dirname "${BASH_SOURCE:-$0}")" + + local CURRENT_DIR="$(readlink -f "${SCRIPT_DIR}/../../")" + if [[ -z "${CHROME_SRC}" ]]; then + # If $CHROME_SRC was not set, assume current directory is CHROME_SRC. + local CHROME_SRC="${CURRENT_DIR}" + fi + + if [[ "${CURRENT_DIR/"${CHROME_SRC}"/}" == "${CURRENT_DIR}" ]]; then + # If current directory is not in $CHROME_SRC, it might be set for other + # source tree. If $CHROME_SRC was set correctly and we are in the correct + # directory, "${CURRENT_DIR/"${CHROME_SRC}"/}" will be "". + # Otherwise, it will equal to "${CURRENT_DIR}" + echo "Warning: Current directory is out of CHROME_SRC, it may not be \ + the one you want." + echo "${CHROME_SRC}" + fi + + # 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. + if [[ -z "${ANDROID_SDK_ROOT}" || ! -d "${ANDROID_SDK_ROOT}" ]]; then + local ANDROID_SDK_ROOT="${CHROME_SRC}/third_party/android_tools/sdk/" + fi + + # Add Android SDK tools to system path. + export PATH=$PATH:${ANDROID_SDK_ROOT}/tools + export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools + + # Add Chromium Android development scripts to system path. + # Must be after CHROME_SRC is set. + export PATH=$PATH:${CHROME_SRC}/build/android +} +android_envsetup_main android_gyp() { echo "Please call build/gyp_chromium instead. android_gyp is going away." diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py index d0fc6c9f20..21dd379d86 100644 --- a/build/android/pylib/android_commands.py +++ b/build/android/pylib/android_commands.py @@ -964,31 +964,40 @@ class AndroidCommands(object): host_hash_tuples, device_hash_tuples = self._RunMd5Sum( real_host_path, real_device_path) - # Ignore extra files on the device. - if not ignore_filenames: - host_files = [os.path.relpath(os.path.normpath(p.path), - real_host_path) for p in host_hash_tuples] - - def HostHas(fname): - return any(path in fname for path in host_files) - - device_hash_tuples = [h for h in device_hash_tuples if HostHas(h.path)] - if len(host_hash_tuples) > len(device_hash_tuples): logging.info('%s files do not exist on the device' % (len(host_hash_tuples) - len(device_hash_tuples))) - # Constructs the target device path from a given host path. Don't use when - # only a single file is given as the base name given in device_path may - # differ from that in host_path. - def HostToDevicePath(host_file_path): - return os.path.join(device_path, os.path.relpath(host_file_path, - real_host_path)) + host_rel = [(os.path.relpath(os.path.normpath(t.path), real_host_path), + t.hash) + for t in host_hash_tuples] - device_hashes = [h.hash for h in device_hash_tuples] - return [(t.path, HostToDevicePath(t.path) if - os.path.isdir(real_host_path) else real_device_path) - for t in host_hash_tuples if t.hash not in device_hashes] + if os.path.isdir(real_host_path): + def RelToRealPaths(rel_path): + return (os.path.join(real_host_path, rel_path), + os.path.join(real_device_path, rel_path)) + else: + assert len(host_rel) == 1 + def RelToRealPaths(_): + return (real_host_path, real_device_path) + + if ignore_filenames: + # If we are ignoring file names, then we want to push any file for which + # a file with an equivalent MD5 sum does not exist on the device. + device_hashes = set([h.hash for h in device_hash_tuples]) + ShouldPush = lambda p, h: h not in device_hashes + else: + # Otherwise, we want to push any file on the host for which a file with + # an equivalent MD5 sum does not exist at the same relative path on the + # device. + device_rel = dict([(os.path.relpath(os.path.normpath(t.path), + real_device_path), + t.hash) + for t in device_hash_tuples]) + ShouldPush = lambda p, h: p not in device_rel or h != device_rel[p] + + return [RelToRealPaths(path) for path, host_hash in host_rel + if ShouldPush(path, host_hash)] def PushIfNeeded(self, host_path, device_path): """Pushes |host_path| to |device_path|. @@ -1861,14 +1870,30 @@ class AndroidCommands(object): if not command: raise Exception('Unable to act on usb charging.') disable_command = command['disable_command'] - self.RunShellCommand(disable_command) + # Do not loop directly on self.IsDeviceCharging to cut the number of calls + # to the device. + while True: + self.RunShellCommand(disable_command) + if not self.IsDeviceCharging(): + break def EnableUsbCharging(self): command = self._GetControlUsbChargingCommand() if not command: raise Exception('Unable to act on usb charging.') disable_command = command['enable_command'] - self.RunShellCommand(disable_command) + # Do not loop directly on self.IsDeviceCharging to cut the number of calls + # to the device. + while True: + self.RunShellCommand(disable_command) + if self.IsDeviceCharging(): + break + + def IsDeviceCharging(self): + for line in self.RunShellCommand('dumpsys battery'): + if 'powered: ' in line: + if line.split('powered: ')[1] == 'true': + return True class NewLineNormalizer(object): diff --git a/build/android/pylib/android_commands_unittest.py b/build/android/pylib/android_commands_unittest.py new file mode 100644 index 0000000000..7d5e5599c1 --- /dev/null +++ b/build/android/pylib/android_commands_unittest.py @@ -0,0 +1,142 @@ +# 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 os +import shutil +import sys +import unittest + +sys.path.append(os.path.join(os.pardir, os.path.dirname(__file__))) + +from pylib import android_commands + +# pylint: disable=W0212,W0702 + +class TestGetFilesChanged(unittest.TestCase): + + def setUp(self): + if not os.getenv('BUILDTYPE'): + os.environ['BUILDTYPE'] = 'Debug' + + devices = android_commands.GetAttachedDevices() + self.assertGreater(len(devices), 0, 'No device attached!') + self.ac = android_commands.AndroidCommands(device=devices[0]) + self.host_data_dir = os.path.realpath('test_push_data') + self.device_data_dir = '%s/test_push_data' % ( + self.ac.RunShellCommand('realpath %s' % + self.ac.GetExternalStorage())[0]) + + os.mkdir(self.host_data_dir) + for i in xrange(1, 10): + with open('%s/%d.txt' % (self.host_data_dir, i), 'w') as f: + f.write('file #%d' % i) + + self.ac.RunShellCommand('mkdir %s' % self.device_data_dir) + + def testGetFilesChangedAllNeeded(self): + """ Tests GetFilesChanged when none of the files are on the device. + """ + expected = [('%s/%d.txt' % (self.host_data_dir, i), + '%s/%d.txt' % (self.device_data_dir, i)) + for i in xrange(1, 10)] + actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir) + self.assertSequenceEqual(expected, actual) + + def testGetFilesChangedSomeIdentical(self): + """ Tests GetFilesChanged when some of the files are on the device. + """ + for i in xrange(1, 5): + self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i), + self.device_data_dir) + expected = [('%s/%d.txt' % (self.host_data_dir, i), + '%s/%d.txt' % (self.device_data_dir, i)) + for i in xrange(5, 10)] + actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir) + self.assertSequenceEqual(expected, actual) + + def testGetFilesChangedAllIdentical(self): + """ Tests GetFilesChanged when all of the files are on the device. + """ + for i in xrange(1, 10): + self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i), + self.device_data_dir) + expected = [] + actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir) + self.assertSequenceEqual(expected, actual) + + def testGetFilesChangedRename(self): + """ Tests GetFilesChanged when one of the files has been renamed. + + This tests both with and without the ignore_filenames flag set. + """ + for i in xrange(5, 10): + self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i), + self.device_data_dir) + os.rename('%s/5.txt' % (self.host_data_dir), + '%s/99.txt' % (self.host_data_dir)) + + expected = [('%s/%d.txt' % (self.host_data_dir, i), + '%s/%d.txt' % (self.device_data_dir, i)) + for i in xrange(1, 5)] + actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir, + ignore_filenames=True) + self.assertSequenceEqual(expected, actual) + + expected.append(('%s/99.txt' % self.host_data_dir, + '%s/99.txt' % self.device_data_dir)) + actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir) + self.assertSequenceEqual(expected, actual) + + def testGetFilesChangedCopy(self): + """ Tests GetFilesChanged when one of the files has been copied. + + This tests both with and without the ignore_filenames flag set. + """ + for i in xrange(5, 10): + self.ac._adb.Push('%s/%d.txt' % (self.host_data_dir, i), + self.device_data_dir) + shutil.copy('%s/5.txt' % self.host_data_dir, + '%s/99.txt' % self.host_data_dir) + + expected = [('%s/%d.txt' % (self.host_data_dir, i), + '%s/%d.txt' % (self.device_data_dir, i)) + for i in xrange(1, 5)] + actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir, + ignore_filenames=True) + self.assertSequenceEqual(expected, actual) + + expected.append(('%s/99.txt' % self.host_data_dir, + '%s/99.txt' % self.device_data_dir)) + actual = self.ac.GetFilesChanged(self.host_data_dir, self.device_data_dir) + self.assertSequenceEqual(expected, actual) + + def testGetFilesChangedIndividual(self): + """ Tests GetFilesChanged when provided one file. + """ + expected = [('%s/1.txt' % self.host_data_dir, + '%s/1.txt' % self.device_data_dir)] + actual = self.ac.GetFilesChanged('%s/1.txt' % self.host_data_dir, + '%s/1.txt' % self.device_data_dir) + self.assertSequenceEqual(expected, actual) + + def testGetFilesChangedFileToDirectory(self): + """ Tests GetFilesChanged when provided a file from the host and a + directory on the device. + """ + expected = [('%s/1.txt' % self.host_data_dir, + '%s' % self.device_data_dir)] + actual = self.ac.GetFilesChanged('%s/1.txt' % self.host_data_dir, + '%s' % self.device_data_dir) + self.assertSequenceEqual(expected, actual) + + def tearDown(self): + try: + shutil.rmtree(self.host_data_dir) + self.ac.RunShellCommand('rm -rf %s' % self.device_data_dir) + except: + pass + +if __name__ == '__main__': + unittest.main() + diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py index e62b64811a..01683dec78 100644 --- a/build/android/pylib/gtest/setup.py +++ b/build/android/pylib/gtest/setup.py @@ -12,10 +12,11 @@ import os import shutil import sys -from pylib import android_commands from pylib import cmd_helper from pylib import constants +from pylib.base import base_test_result +from pylib.base import test_dispatcher from pylib.gtest import test_package_apk from pylib.gtest import test_package_exe from pylib.gtest import test_runner @@ -29,7 +30,7 @@ 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', + 'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate', 'breakpad_unittests': 'breakpad/breakpad_unittests.isolate', 'cc_perftests': 'cc/cc_perftests.isolate', 'components_unittests': 'components/components_unittests.isolate', @@ -163,19 +164,22 @@ def _GenerateDepsDirUsingIsolate(suite_name): # On Android, all pak files need to be in the top-level 'paks' directory. paks_dir = os.path.join(constants.ISOLATE_DEPS_DIR, 'paks') os.mkdir(paks_dir) - for root, _, filenames in os.walk(os.path.join(constants.ISOLATE_DEPS_DIR, - 'out')): + + deps_out_dir = os.path.join( + constants.ISOLATE_DEPS_DIR, + os.path.relpath(os.path.join(constants.GetOutDirectory(), os.pardir), + constants.DIR_SOURCE_ROOT)) + for root, _, filenames in os.walk(deps_out_dir): for filename in fnmatch.filter(filenames, '*.pak'): shutil.move(os.path.join(root, filename), paks_dir) # Move everything in PRODUCT_DIR to top level. - deps_product_dir = os.path.join(constants.ISOLATE_DEPS_DIR, 'out', - constants.GetBuildType()) + deps_product_dir = os.path.join(deps_out_dir, constants.GetBuildType()) if os.path.isdir(deps_product_dir): for p in os.listdir(deps_product_dir): shutil.move(os.path.join(deps_product_dir, p), constants.ISOLATE_DEPS_DIR) os.rmdir(deps_product_dir) - os.rmdir(os.path.join(constants.ISOLATE_DEPS_DIR, 'out')) + os.rmdir(deps_out_dir) def _GetDisabledTestsFilterFromFile(suite_name): @@ -204,26 +208,35 @@ def _GetDisabledTestsFilterFromFile(suite_name): return disabled_filter -def _GetTestsFromDevice(runner_factory, devices): - """Get a list of tests from a device. +def _GetTests(test_options, test_package, devices): + """Get a list of tests. Args: - runner_factory: Callable that takes device and shard_index and returns - a TestRunner. - devices: A list of device ids. + test_options: A GTestOptions object. + test_package: A TestPackageApk object. + devices: A list of attached devices. Returns: - All the tests in the test suite. + A list of all the tests in the test suite. """ - for device in devices: - try: - logging.info('Obtaining tests from %s', device) - return runner_factory(device, 0).GetAllTests() - except (android_commands.errors.WaitForResponseTimedOutError, - android_commands.errors.DeviceUnresponsiveError), e: - logging.warning('Failed obtaining test list from %s with exception: %s', - device, e) - raise Exception('Failed to obtain test list from devices.') + def TestListerRunnerFactory(device, _shard_index): + class TestListerRunner(test_runner.TestRunner): + def RunTest(self, _test): + result = base_test_result.BaseTestResult( + 'gtest_list_tests', base_test_result.ResultType.PASS) + self.test_package.Install(self.adb) + result.test_list = self.test_package.GetAllTests(self.adb) + results = base_test_result.TestRunResults() + results.AddResult(result) + return results, None + return TestListerRunner(test_options, device, test_package) + + results, _no_retry = test_dispatcher.RunTests( + ['gtest_list_tests'], TestListerRunnerFactory, devices) + tests = [] + for r in results.GetAll(): + tests.extend(r.test_list) + return tests def _FilterTestsUsingPrefixes(all_tests, pre=False, manual=False): @@ -299,6 +312,8 @@ def Setup(test_options, devices): _GenerateDepsDirUsingIsolate(test_options.suite_name) + tests = _GetTests(test_options, test_package, devices) + # Constructs a new TestRunner with the current options. def TestRunnerFactory(device, _shard_index): return test_runner.TestRunner( @@ -306,7 +321,6 @@ def Setup(test_options, devices): device, test_package) - tests = _GetTestsFromDevice(TestRunnerFactory, devices) if test_options.run_disabled: test_options = test_options._replace( test_arguments=('%s --gtest_also_run_disabled_tests' % diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py index e4f98ff8f6..9013668221 100644 --- a/build/android/pylib/gtest/test_runner.py +++ b/build/android/pylib/gtest/test_runner.py @@ -59,11 +59,6 @@ class TestRunner(base_test_runner.BaseTestRunner): def InstallTestPackage(self): self.test_package.Install(self.adb) - def GetAllTests(self): - """Install test package and get a list of all tests.""" - self.test_package.Install(self.adb) - return self.test_package.GetAllTests(self.adb) - #override def PushDataDeps(self): self.adb.WaitForSdCardReady(20) diff --git a/build/android/pylib/instrumentation/test_jar.py b/build/android/pylib/instrumentation/test_jar.py index 8ea3dbf550..ee781c518e 100644 --- a/build/android/pylib/instrumentation/test_jar.py +++ b/build/android/pylib/instrumentation/test_jar.py @@ -41,8 +41,7 @@ class TestJar(object): if not os.path.exists(jar_path): raise Exception('%s not found, please build it' % jar_path) - sdk_root = os.getenv('ANDROID_SDK_ROOT', constants.ANDROID_SDK_ROOT) - self._PROGUARD_PATH = os.path.join(sdk_root, + self._PROGUARD_PATH = os.path.join(constants.ANDROID_SDK_ROOT, 'tools/proguard/bin/proguard.sh') if not os.path.exists(self._PROGUARD_PATH): self._PROGUARD_PATH = os.path.join(os.environ['ANDROID_BUILD_TOP'], diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py index 6545463ae2..7d57781f8e 100644 --- a/build/android/pylib/utils/emulator.py +++ b/build/android/pylib/utils/emulator.py @@ -4,8 +4,6 @@ """Provides an interface to start and stop Android emulator. -Assumes system environment ANDROID_NDK_ROOT has been set. - Emulator: The class provides the methods to launch/shutdown the emulator with the android virtual device named 'avd_armeabi' . """ diff --git a/build/build_config.h b/build/build_config.h index 7a208a56ee..e26d75e572 100644 --- a/build/build_config.h +++ b/build/build_config.h @@ -32,7 +32,7 @@ #define OS_LINUX 1 #if defined(__GLIBC__) && !defined(__UCLIBC__) // we really are using glibc, not uClibc pretending to be glibc -#define LIBC_GLIBC +#define LIBC_GLIBC 1 #endif #elif defined(_WIN32) #define OS_WIN 1 diff --git a/build/check_return_value.py b/build/check_return_value.py index 6f0daec3a7..c659d1e967 100755 --- a/build/check_return_value.py +++ b/build/check_return_value.py @@ -6,10 +6,12 @@ """This program wraps an arbitrary command and prints "1" if the command ran successfully.""" +import os import subprocess import sys -if not subprocess.call(sys.argv[1:]): +devnull = open(os.devnull, 'wb') +if not subprocess.call(sys.argv[1:], stdout=devnull, stderr=devnull): print 1 else: print 0 diff --git a/build/common.gypi b/build/common.gypi index a75369112e..dc3415649c 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -278,9 +278,6 @@ 'sysroot%': '<(sysroot)', 'chroot_cmd%': '<(chroot_cmd)', - # Whether content/chrome is using mojo: see http://crbug.com/353602 - 'use_mojo%': 0, - # Set to 1 to enable fast builds. Set to 2 for even faster builds # (it disables debug info for fastest compilation - only for use # on compile-only bots). @@ -420,9 +417,6 @@ # Enable Chrome browser extensions 'enable_extensions%': 1, - # Enable browser automation. - 'enable_automation%': 1, - # Enable Google Now. 'enable_google_now%': 1, @@ -655,7 +649,6 @@ }], ['OS=="android"', { - 'enable_automation%': 0, 'enable_extensions%': 0, 'enable_google_now%': 0, 'cld_version%': 1, @@ -699,7 +692,6 @@ ['OS=="ios"', { 'disable_ftp_support%': 1, - 'enable_automation%': 0, 'enable_extensions%': 0, 'enable_google_now%': 0, 'cld_version%': 1, @@ -864,10 +856,6 @@ 'enable_printing%': 0, }], - ['OS=="win" or OS=="linux" or OS=="mac"', { - 'use_mojo%': 1, - }], - # By default, use ICU data file (icudtl.dat) on all platforms # except when building Android WebView. # TODO(jshin): Handle 'use_system_icu' on Linux (Chromium). @@ -939,7 +927,6 @@ 'use_aura%': '<(use_aura)', 'use_ash%': '<(use_ash)', 'use_cras%': '<(use_cras)', - 'use_mojo%': '<(use_mojo)', 'use_openssl%': '<(use_openssl)', 'use_openssl_certs%': '<(use_openssl_certs)', 'use_nss%': '<(use_nss)', @@ -1015,7 +1002,6 @@ 'test_isolation_mode%': '<(test_isolation_mode)', 'test_isolation_outdir%': '<(test_isolation_outdir)', 'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)', - 'enable_automation%': '<(enable_automation)', 'enable_printing%': '<(enable_printing)', 'enable_spellcheck%': '<(enable_spellcheck)', 'enable_google_now%': '<(enable_google_now)', @@ -1230,6 +1216,10 @@ # whether warnings are treated as errors. 'chromium_code%': 0, + # Disable fatal linker warnings, similarly to how we make it possible + # to disable -Werror (e.g. for different toolchain versions). + 'disable_fatal_linker_warnings%': 0, + 'release_valgrind_build%': 0, # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 @@ -1323,6 +1313,9 @@ # Compile d8 for the host toolset. 'v8_toolset_for_d8': 'host', + # Compiles v8 without its platform library. + 'v8_use_default_platform': 0, + # Use the chromium skia by default. 'use_system_skia%': '0', @@ -1352,7 +1345,37 @@ }, { 'syzygy_optimize%': 0, }], - + # Get binutils version so we can enable debug fission if we can. + ['os_posix==1 and OS!="mac" and OS!="ios"', { + 'conditions': [ + # compiler_version doesn't work with clang + # TODO(mithro): Land https://codereview.chromium.org/199793014/ so + # compiler_version works with clang. + # TODO(glider): set clang to 1 earlier for ASan and TSan builds so + # that it takes effect here. + ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', { + 'binutils_version%': '<!(python <(DEPTH)/build/compiler_version.py assembler)', + }], + # On Android we know the binutils version in the toolchain. + ['OS=="android"', { + 'binutils_version%': 222, + }], + # Our version of binutils in third_party/binutils + ['linux_use_gold_binary==1', { + 'binutils_version%': 224, + 'conditions': [ + ['host_arch=="x64"', { + 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', + }], + ['host_arch=="ia32"', { + 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin', + }], + ], + }], + ], + }, { + 'binutils_version%': 0, + }], # 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 # platforms except Windows, Mac and iOS. @@ -1369,15 +1392,12 @@ 'gcc_version%': 46, }], ], - 'binutils_version%': 222, }, { 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)', - 'binutils_version%': '<!(python <(DEPTH)/build/compiler_version.py assembler)', }], ], }, { 'gcc_version%': 0, - 'binutils_version%': 0, }], ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_default_path))"=="True"', { 'windows_sdk_path%': '<(windows_sdk_default_path)', @@ -1574,7 +1594,6 @@ 'proprietary_codecs%': '<(proprietary_codecs)', 'safe_browsing%': 2, 'input_speech%': 0, - 'enable_automation%': 0, 'java_bridge%': 1, 'build_ffmpegsumo%': 0, # TODO(dmikurube): Change the default of use_allocator to "none". @@ -1794,9 +1813,6 @@ ['toolkit_views==1', { 'grit_defines': ['-D', 'toolkit_views'], }], - ['use_mojo==1', { - 'grit_defines': ['-D', 'use_mojo'], - }], ['toolkit_uses_gtk==1', { 'grit_defines': ['-D', 'toolkit_uses_gtk'], }], @@ -1895,7 +1911,7 @@ 'grit_defines': ['-D', 'enable_notifications'], }], ['enable_resource_whitelist_generation==1', { - 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("{textual_id}") {numeric_id}'], + 'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'], }], ['enable_mdns==1 or OS=="mac"', { 'grit_defines': ['-D', 'enable_service_discovery'], @@ -1920,6 +1936,7 @@ }], ['tsan==1', { 'clang%': 1, + 'use_custom_libcxx%': 1, }], ['msan==1', { 'clang%': 1, @@ -2290,9 +2307,6 @@ ['use_libjpeg_turbo==1', { 'defines': ['USE_LIBJPEG_TURBO=1'], }], - ['use_mojo==1', { - 'defines': ['USE_MOJO=1'], - }], ['use_x11==1', { 'defines': ['USE_X11=1'], }], @@ -2523,9 +2537,6 @@ ['enable_background==1', { 'defines': ['ENABLE_BACKGROUND=1'], }], - ['enable_automation==1', { - 'defines': ['ENABLE_AUTOMATION=1'], - }], ['enable_google_now==1', { 'defines': ['ENABLE_GOOGLE_NOW=1'], }], @@ -3069,16 +3080,22 @@ }, }, 'conditions': [ - # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 - ['os_posix==1 and (chromeos==0 or target_arch!="arm")', { + ['os_posix==1', { 'target_defaults': { 'ldflags': [ - '-Wl,--fatal-warnings', '-Wl,-z,now', '-Wl,-z,relro', ], }, }], + # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 + ['os_posix==1 and disable_fatal_linker_warnings==0 and (chromeos==0 or target_arch!="arm")', { + 'target_defaults': { + 'ldflags': [ + '-Wl,--fatal-warnings', + ], + }, + }], ['os_posix==1 and chromeos==0', { # Chrome OS enables -fstack-protector-strong via its build wrapper, # and we want to avoid overriding this, so stack-protector is only @@ -3806,12 +3823,16 @@ ['linux_dump_symbols==1', { 'cflags': [ '-g' ], 'conditions': [ - ['target_arch=="ia32" and OS!="android"', { + # TODO(thestig) We should not need to specify chromeos==0 here, + # but somehow ChromeOS uses gold despite linux_use_gold_binary==0. + # http://crbug.com./360082 + ['linux_use_gold_binary==0 and chromeos==0 and OS!="android"', { 'target_conditions': [ ['_toolset=="target"', { 'ldflags': [ - # Workaround for linker OOM. + # Workarounds for linker OOM. '-Wl,--no-keep-memory', + '-Wl,--reduce-memory-overheads', ], }], ], @@ -3856,15 +3877,27 @@ ], }], ['linux_use_gold_binary==1', { + # Put our binutils, which contains gold in the search path. We pass + # the path to gold to the compiler. gyp leaves unspecified what the + # cwd is when running the compiler, so the normal gyp path-munging + # fails us. This hack gets the right path. + 'cflags': [ + '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)', + ], 'ldflags': [ - # Put our gold binary in the search path for the linker. - # We pass the path to gold to the compiler. gyp leaves - # unspecified what the cwd is when running the compiler, - # so the normal gyp path-munging fails us. This hack - # gets the right path. - '-B<!(cd <(DEPTH) && pwd -P)/third_party/gold', + '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)', ], }], + ['binutils_version>=224', { + # Newer binutils don't set DT_RPATH unless you disable "new" dtags + # and the new DT_RUNPATH doesn't work without --no-as-needed flag. + # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags + # inside this file to allow usage of --no-as-needed and removal of + # this flag. + 'ldflags': [ + '-Wl,--disable-new-dtags', + ], + }] ], }, }], @@ -4347,7 +4380,7 @@ ], }], ['OS=="ios" and target_subarch!="arm32" and \ - "<(GENERATOR)"=="ninja"', { + "<(GENERATOR)"=="xcode"', { 'OTHER_CFLAGS': [ # TODO(ios): when building Chrome for iOS on 64-bit platform # with Xcode, the -Wshorted-64-to-32 warning is automatically diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index d0b14c2f79..1d58f8624d 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -39,13 +39,16 @@ config("feature_flags") { "ENABLE_THEMES=1", "ENABLE_AUTOFILL_DIALOG=1", "ENABLE_BACKGROUND=1", - "ENABLE_AUTOMATION=1", "ENABLE_GOOGLE_NOW=1", "ENABLE_CAPTIVE_PORTAL_DETECTION=1", "ENABLE_APP_LIST=1", "ENABLE_SETTINGS_APP=1", "ENABLE_MANAGED_USERS=1", + "ENABLE_SERVICE_DISCOVERY=1", + "USE_MOJO=1", "V8_DEPRECATION_WARNINGS", # Don't use deprecated V8 APIs anywhere. + # Temporary suppression until Blink code can be removed. + "BLINK_SCALE_FILTERS_AT_RECORD_TIME", ] if (cld_version > 0) { @@ -175,6 +178,10 @@ config("default_libs") { "winmm.lib", "winspool.lib", "ws2_32.lib", + # Please don't add more stuff here. We should actually be making this + # list smaller, since all common things should be covered. If you need + # some extra libraries, please just add a libs = [ "foo.lib" ] to your + # target that needs it. ] } else if (is_android) { # Android uses -nostdlib so we need to add even libc here. diff --git a/build/config/arm.gni b/build/config/arm.gni index cf6619c8d1..f9c6cdcbc8 100644 --- a/build/config/arm.gni +++ b/build/config/arm.gni @@ -21,12 +21,10 @@ if (cpu_arch == "arm") { 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 + arm_optionally_use_neon = false } else { arm_use_neon = true - #arm_optionally_use_neon = true + arm_optionally_use_neon = true } if (arm_version == 6) { diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index 04487ccaae..b91ee6704b 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni @@ -39,5 +39,8 @@ template("pkg_config") { if (defined(invoker.defines)) { defines = invoker.defines } + if (defined(invoker.visibility)) { + visibility = invoker.visibility + } } } diff --git a/build/git-hooks/pre-commit b/build/git-hooks/pre-commit index 790e14ec84..41b596344c 100755 --- a/build/git-hooks/pre-commit +++ b/build/git-hooks/pre-commit @@ -49,7 +49,7 @@ gitmodules_diff() { git diff-index --cached "$1" .gitmodules } -if test "$(git ls-files .gitmodules)" -a "$(gitmodules_diff $head_ref)"; then +if [ "$(git ls-files .gitmodules)" ] && [ "$(gitmodules_diff $head_ref)" ]; then cat <<EOF 1>&2 You are trying to commit a change to .gitmodules. That is not allowed. To make changes to submodule names/paths, edit DEPS. diff --git a/build/gn_helpers.py b/build/gn_helpers.py new file mode 100644 index 0000000000..3b0647d9a5 --- /dev/null +++ b/build/gn_helpers.py @@ -0,0 +1,39 @@ +# 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. + +"""Helper functions useful when writing scripts that are run from GN's +exec_script function.""" + +class GNException(Exception): + pass + + +def ToGNString(value, allow_dicts = True): + """Prints the given value to stdout. + + allow_dicts indicates if this function will allow converting dictionaries + to GN scopes. This is only possible at the top level, you can't nest a + GN scope in a list, so this should be set to False for recursive calls.""" + if isinstance(value, str): + if value.find('\n') >= 0: + raise GNException("Trying to print a string with a newline in it.") + return '"' + value.replace('"', '\\"') + '"' + + if isinstance(value, list): + return '[ %s ]' % ', '.join(ToGNString(v) for v in value) + + if isinstance(value, dict): + if not allow_dicts: + raise GNException("Attempting to recursively print a dictionary.") + result = "" + for key in value: + if not isinstance(key, str): + raise GNException("Dictionary key is not a string.") + result += "%s = %s\n" % (key, ToGNString(value[key], False)) + return result + + if isinstance(value, int): + return str(value) + + raise GNException("Unsupported type when printing to GN.") diff --git a/build/gyp_chromium b/build/gyp_chromium index ca00a54dc1..3ac81c045f 100755 --- a/build/gyp_chromium +++ b/build/gyp_chromium @@ -265,7 +265,7 @@ if __name__ == '__main__': not 'OS=ios' in os.environ.get('GYP_DEFINES', []): os.environ['GYP_GENERATORS'] = 'ninja' - vs2013_runtime_dll_dirs = vs_toolchain.DownloadVsToolchain() + vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check # to enfore syntax checking. diff --git a/build/gypi_to_gn.py b/build/gypi_to_gn.py new file mode 100644 index 0000000000..1446d81163 --- /dev/null +++ b/build/gypi_to_gn.py @@ -0,0 +1,87 @@ +# 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. + +"""Converts a given gypi file to a python scope and writes the result to stdout. + +It is assumed that the file contains a toplevel dictionary, and this script +will return that dictionary as a GN "scope" (see example below). This script +does not know anything about GYP and it will not expand variables or execute +conditions (it will check for the presence of a "conditions" value in the +dictionary and will abort if it is present). It also does not support nested +dictionaries. + +Say your_file.gypi looked like this: + { + 'sources': [ 'a.cc', 'b.cc' ], + 'defines': [ 'ENABLE_DOOM_MELON' ], + } + +You would call it like this: + gypi_values = exec_script("//build/gypi_to_gn.py", + [ rebase_path("your_file.gypi") ], + "scope", + [ "your_file.gypi" ]) + +Notes: + - The rebase_path call converts the gypi file from being relative to the + current build file to being system absolute for calling the script, which + will have a different current directory than this file. + + - The "scope" parameter tells GN to interpret the result as a series of GN + variable assignments. + + - The last file argument to exec_script tells GN that the given file is a + dependency of the build so Ninja can automatically re-run GN if the file + changes. + +Read the values into a target like this: + component("mycomponent") { + sources = gypi_values.sources + defines = gypi_values.defines + } + +Sometimes your .gypi file will include paths relative to a different +directory than the current .gn file. In this case, you can rebase them to +be relative to the current directory. + sources = rebase_path(gypi_values.sources, ".", + "//path/gypi/input/values/are/relative/to") +""" + +import gn_helpers +from optparse import OptionParser +import sys + +def LoadPythonDictionary(path): + file_string = open(path).read() + try: + file_data = eval(file_string, {'__builtins__': None}, None) + except SyntaxError, e: + e.filename = path + raise + except Exception, e: + raise Exception("Unexpected error while reading %s: %s" % (path, str(e))) + + assert isinstance(file_data, dict), "%s does not eval to a dictionary" % path + assert 'conditions' not in file_data, \ + "The file %s has conditions in it, these aren't supported." % path + + return file_data + + +def main(): + parser = OptionParser() + (options, args) = parser.parse_args() + + if len(args) != 1: + raise Exception("Need one argument which is the .gypi file to read.") + + data = LoadPythonDictionary(args[0]) + print gn_helpers.ToGNString(data) + +if __name__ == '__main__': + try: + main() + except Exception, e: + print str(e) + sys.exit(1) diff --git a/build/install-build-deps-android.sh b/build/install-build-deps-android.sh index 73e534a286..c3375ad858 100755 --- a/build/install-build-deps-android.sh +++ b/build/install-build-deps-android.sh @@ -17,11 +17,9 @@ if ! uname -m | egrep -q "i686|x86_64"; then exit fi -if [ "x$(id -u)" != x0 ]; then - echo "Running as non-root user." - echo "You might have to enter your password one or more times for 'sudo'." - echo -fi +# Install first the default Linux build deps. +"$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ + --no-syms --no-arm --no-chromeos-fonts --no-nacl --no-prompt # The temporary directory used to store output of update-java-alternatives TEMPDIR=$(mktemp -d) diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index 8e5b628681..a02b748bd4 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh @@ -94,19 +94,20 @@ fi chromeos_dev_list="libbluetooth-dev" # Packages needed for development -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 libexif-dev libgconf2-dev libgl1-mesa-dev - libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev - libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev - libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev - libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev - 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" +dev_list="apache2.2-bin bison curl dpkg-dev elfutils fakeroot flex + fonts-thai-tlwg 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 libexif-dev + libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev + libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev + libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev + libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl + libxslt1-dev libxss-dev libxt-dev libxtst-dev 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 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 diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt index 0a30875229..82964a86c2 100644 --- a/build/ios/grit_whitelist.txt +++ b/build/ios/grit_whitelist.txt @@ -129,6 +129,18 @@ IDS_BOOKMARK_ALL_TABS_DIALOG_TITLE IDS_BOOKMARK_BAR_FOLDER_NAME IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME +IDS_BOOKMARK_BAR_REDO +IDS_BOOKMARK_BAR_REDO_ADD +IDS_BOOKMARK_BAR_REDO_DELETE +IDS_BOOKMARK_BAR_REDO_EDIT +IDS_BOOKMARK_BAR_REDO_MOVE +IDS_BOOKMARK_BAR_REDO_REORDER +IDS_BOOKMARK_BAR_UNDO +IDS_BOOKMARK_BAR_UNDO_ADD +IDS_BOOKMARK_BAR_UNDO_DELETE +IDS_BOOKMARK_BAR_UNDO_EDIT +IDS_BOOKMARK_BAR_UNDO_MOVE +IDS_BOOKMARK_BAR_UNDO_REORDER IDS_BOOKMARK_BUBBLE_CHOOSER_ANOTHER_FOLDER IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK IDS_BOOKMARK_EDITOR_CONFIRM_DELETE diff --git a/build/isolate.gypi b/build/isolate.gypi index 6a84a56fa7..6267441e73 100644 --- a/build/isolate.gypi +++ b/build/isolate.gypi @@ -47,6 +47,7 @@ 'extension': 'isolate', 'inputs': [ # Files that are known to be involved in this step. + '<(DEPTH)/tools/isolate_driver.py', '<(DEPTH)/tools/swarming_client/isolate.py', '<(DEPTH)/tools/swarming_client/run_isolated.py', @@ -67,9 +68,9 @@ ], 'action': [ 'python', - '<(DEPTH)/tools/swarming_client/isolate.py', + '<(DEPTH)/tools/isolate_driver.py', '<(test_isolation_mode)', - '--result', '<@(_outputs)', + '--isolated', '<@(_outputs)', '--isolate', '<(RULE_INPUT_PATH)', # Variables should use the -V FOO=<(FOO) form so frequent values, diff --git a/build/java_apk.gypi b/build/java_apk.gypi index 85128103f9..8e9e7a2a21 100644 --- a/build/java_apk.gypi +++ b/build/java_apk.gypi @@ -199,7 +199,6 @@ 'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)', 'files': [ '<(android_gdbserver)', - '<@(extra_native_libs)', ], }, ], diff --git a/build/linux/system.isolate b/build/linux/system.isolate deleted file mode 100644 index 3933af1e2e..0000000000 --- a/build/linux/system.isolate +++ /dev/null @@ -1,12 +0,0 @@ -# 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/mac/asan.gyp b/build/mac/asan.gyp index 73e86416c6..91a36d2d4d 100644 --- a/build/mac/asan.gyp +++ b/build/mac/asan.gyp @@ -4,7 +4,7 @@ { 'targets': [ - { + { 'target_name': 'asan_dynamic_runtime', 'type': 'none', 'variables': { @@ -13,7 +13,11 @@ 'prune_self_dependency': 1, # Path is relative to this GYP file. 'asan_rtl_mask_path': - '../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin/libclang_rt.asan_osx_dynamic.dylib', + '../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin', + 'asan_osx_dynamic': + '<(asan_rtl_mask_path)/libclang_rt.asan_osx_dynamic.dylib', + 'asan_iossim_dynamic': + '<(asan_rtl_mask_path)/libclang_rt.asan_iossim_dynamic.dylib', }, 'conditions': [ ['OS=="mac"', { @@ -21,12 +25,25 @@ { 'destination': '<(PRODUCT_DIR)', 'files': [ - '<!(/bin/ls <(asan_rtl_mask_path))', + '<!(/bin/ls <(asan_osx_dynamic))', + ], + }, + ], + }], + # ASan works with iOS simulator only, not bare-metal iOS. + ['OS=="ios" and target_arch=="ia32"', { + 'toolsets': ['host', 'target'], + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'target_conditions': [ + ['_toolset=="host"', { 'files': [ 'asan_osx_dynamic'] }], + ['_toolset=="target"', { 'files': [ 'asan_iossim_dynamic'] }], ], }, ], }], ], - }, - ], + }, + ], } diff --git a/build/repack_action.gypi b/build/repack_action.gypi index e4bbf68615..be91ac70d6 100644 --- a/build/repack_action.gypi +++ b/build/repack_action.gypi @@ -11,6 +11,7 @@ { 'variables': { 'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py', + 'repack_options%': [], }, 'inputs': [ '<(repack_path)', @@ -19,5 +20,11 @@ 'outputs': [ '<(pak_output)' ], - 'action': ['python', '<(repack_path)', '<(pak_output)', '<@(pak_inputs)'], + 'action': [ + 'python', + '<(repack_path)', + '<@(repack_options)', + '<(pak_output)', + '<@(pak_inputs)', + ], } diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index 7e66c168bb..9e53ef667e 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -19,11 +19,11 @@ template("gcc_toolchain") { assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value") assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value") assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value") - assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ld\" value") + assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value") assert(defined(invoker.toolchain_cpu_arch), - "gcc_toolchain() must specify a \"toolchain_cpu_arch\"") + "gcc_toolchain() must specify a \"toolchain_cpu_arch\"") assert(defined(invoker.toolchain_os), - "gcc_toolchain() must specify a \"toolchain_os\"") + "gcc_toolchain() must specify a \"toolchain_os\"") # We can't do string interpolation ($ in strings) on things with dots in # them. To allow us to use $cc below, for example, we create copies of diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn index 35f80b0282..8613d1fe58 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -59,6 +59,22 @@ exec_script("setup_toolchain.py", [ gyp_mac_tool_source ], "value") # build args in this definition. template("mac_clang_toolchain") { toolchain(target_name) { + assert(defined(invoker.cc), + "mac_clang_toolchain() must specify a \"cc\" value") + assert(defined(invoker.cxx), + "mac_clang_toolchain() must specify a \"cxx\" value") + assert(defined(invoker.ld), + "mac_clang_toolchain() must specify a \"ld\" value") + assert(defined(invoker.toolchain_os), + "mac_clang_toolchain() must specify a \"toolchain_os\"") + + # We can't do string interpolation ($ in strings) on things with dots in + # them. To allow us to use $cc below, for example, we create copies of + # these values in our scope. + cc = invoker.cc + cxx = invoker.cxx + ld = invoker.ld + # Make these apply to all tools below. lib_prefix = "-l" lib_dir_prefix="-L" @@ -124,7 +140,7 @@ template("mac_clang_toolchain") { } toolchain_args() { - os = toolchain_os + os = invoker.toolchain_os } } } diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn index fbced9732d..362e9124ae 100644 --- a/build/toolchain/nacl/BUILD.gn +++ b/build/toolchain/nacl/BUILD.gn @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. - toolchain("x86_newlib") { toolprefix = "gen/sdk/toolchain/linux_x86_newlib/bin/x86_64-nacl-" cc = toolprefix + "gcc" diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn index 2a9a96c0fd..5b9ae48d74 100644 --- a/build/toolchain/win/BUILD.gn +++ b/build/toolchain/win/BUILD.gn @@ -2,13 +2,12 @@ # 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") 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 arguments are the VS path and the compiler wrapper tool. It will write diff --git a/build/util/LASTCHANGE b/build/util/LASTCHANGE index 812ab0cb96..ba5e608846 100644 --- a/build/util/LASTCHANGE +++ b/build/util/LASTCHANGE @@ -1 +1 @@ -LASTCHANGE=261286 +LASTCHANGE=262940 diff --git a/build/util/LASTCHANGE.blink b/build/util/LASTCHANGE.blink index e1853cb205..e7fc59c4f8 100644 --- a/build/util/LASTCHANGE.blink +++ b/build/util/LASTCHANGE.blink @@ -1 +1 @@ -LASTCHANGE=170710 +LASTCHANGE=171171 diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py index 247703b865..4b925f0799 100644 --- a/build/vs_toolchain.py +++ b/build/vs_toolchain.py @@ -8,7 +8,6 @@ import pipes import shutil import subprocess import sys -import tempfile script_dir = os.path.dirname(os.path.realpath(__file__)) @@ -16,46 +15,23 @@ chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(1, os.path.join(chrome_src, 'tools')) sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) +json_data_file = os.path.join(script_dir, 'win_toolchain.json') import gyp -def GetDesiredVsToolchainHashes(): - """Load a list of SHA1s corresponding to the toolchains that we want installed - to build with.""" - sha1path = os.path.join(script_dir, 'toolchain_vs2013.hash') - with open(sha1path, 'rb') as f: - return f.read().strip().splitlines() - - -def DownloadVsToolchain(): - """Download the Visual Studio toolchain on Windows. - - If on Windows, request that depot_tools install/update the automatic - toolchain, and then use it (unless opted-out) and return a tuple containing - the x64 and x86 paths. Otherwise return None. +def SetEnvironmentAndGetRuntimeDllDirs(): + """Sets up os.environ to use the depot_tools VS toolchain with gyp, and + returns the location of the VS runtime DLLs so they can be copied into + the output directory after gyp generation. """ vs2013_runtime_dll_dirs = None depot_tools_win_toolchain = \ bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain: - import find_depot_tools - depot_tools_path = find_depot_tools.add_depot_tools_to_path() - temp_handle, data_file = tempfile.mkstemp(suffix='.json') - os.close(temp_handle) - get_toolchain_args = [ - sys.executable, - os.path.join(depot_tools_path, - 'win_toolchain', - 'get_toolchain_if_necessary.py'), - '--output-json', data_file, - ] + GetDesiredVsToolchainHashes() - subprocess.check_call(get_toolchain_args) - - with open(data_file, 'r') as tempf: + with open(json_data_file, 'r') as tempf: toolchain_data = json.load(tempf) - os.unlink(data_file) toolchain = toolchain_data['path'] version = toolchain_data['version'] @@ -132,18 +108,58 @@ def CopyVsRuntimeDlls(output_dir, runtime_dirs): copy_runtime(out_release_nacl64, x64, 'msvc%s120.dll') +def _GetDesiredVsToolchainHashes(): + """Load a list of SHA1s corresponding to the toolchains that we want installed + to build with.""" + sha1path = os.path.join(script_dir, 'toolchain_vs2013.hash') + with open(sha1path, 'rb') as f: + return f.read().strip().splitlines() + + +def Update(): + """Requests an update of the toolchain to the specific hashes we have at + this revision. The update outputs a .json of the various configuration + information required to pass to gyp which we use in |GetToolchainDir()|. + """ + depot_tools_win_toolchain = \ + bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) + if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain: + import find_depot_tools + depot_tools_path = find_depot_tools.add_depot_tools_to_path() + json_data_file = os.path.join(script_dir, 'win_toolchain.json') + get_toolchain_args = [ + sys.executable, + os.path.join(depot_tools_path, + 'win_toolchain', + 'get_toolchain_if_necessary.py'), + '--output-json', json_data_file, + ] + _GetDesiredVsToolchainHashes() + subprocess.check_call(get_toolchain_args) + + return 0 + + +def GetToolchainDir(): + """Gets location information about the current toolchain (must have been + previously updated by 'update').""" + SetEnvironmentAndGetRuntimeDllDirs() + print '["%s", "%s"]' % ( + os.environ['GYP_MSVS_OVERRIDE_PATH'], os.environ['WINDOWSSDKDIR']) + + def main(): - if len(sys.argv) < 2: - print >>sys.stderr, 'Expected either "get_toolchain_dir" or "copy_dlls"' + if not sys.platform.startswith(('win32', 'cygwin')): + return 0 + commands = { + 'update': Update, + 'get_toolchain_dir': GetToolchainDir, + # TODO(scottmg): Add copy_dlls for GN builds (gyp_chromium calls + # CopyVsRuntimeDlls via import, currently). + } + if len(sys.argv) < 2 or sys.argv[1] not in commands: + print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) return 1 - if sys.argv[1] == 'get_toolchain_dir': - DownloadVsToolchain() - print '["%s", "%s"]' % ( - os.environ['GYP_MSVS_OVERRIDE_PATH'], os.environ['WINDOWSSDKDIR']) - else: - print >>sys.stderr, 'TODO: not implemented "%s"' % sys.argv[1] - return 1 - return 0 + return commands[sys.argv[1]]() if __name__ == '__main__': diff --git a/build/whitespace_file.txt b/build/whitespace_file.txt index 2cda1134fc..15334723e6 100644 --- a/build/whitespace_file.txt +++ b/build/whitespace_file.txt @@ -1,4 +1,4 @@ -Copyright 2014 The Chromium Authors. All rights reserved. +Copyright 20014 The Chromium Authors. All rights reserved. Use of this useless file is governed by a BSD-style license that can be found in the LICENSE file. @@ -8,7 +8,7 @@ any modification below this line. ===================================================================== -Let's make a story. Add one sentence for every commit: +Let's make a story. Add one sentence for every commit: CHÄPTER 1: It was a dark and blinky night; the rain fell in torrents -- except at @@ -76,10 +76,11 @@ BEING SURE OF YOURSELF MEANS YOU'RE A FOOL AM NOT ARE TOO IF AT FIRST YOU DON'T SUCCEED: TRY, EXCEPT, FINALLY -AND THEN, TIME LEAPT BACKWARDS +AND THEN, TIME LEAPT BACKWARDS AAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhh LOT I'm really tempted to change something above the line. Reeccciiiipppppeeeeeesssssss!!!!!!!!! PEOPLE SAY "FAILURE IS NOT AN OPTION", BUT FAILURE IS ALWAYS AN OPTION. +WHAT GOES UP MUST HAVE A NON-ZERO VELOCITY I can feel the heat closing in, feel them out there making their moves... |