Fix include of isolate.gypi

Recent changes in GYP seem to have broken our previous
"hack" for getting the GYP rule for .isolate files
imported from the Chromium build/isolate.gypi.

The best solution for now is to remove the hack
and check in a copy of Chromium's src/build/isolate.gypi
in WebRTC's build/ dir instead. A similar approach is
used for our build/protoc.gypi file.

TEST=On Linux, I successfully ran:
gclient runhooks
ninja -C out/Release
and verified a bunch of .isolated files were created in
out/Release (which didn't happen before this patch).

I also renamed the build/isolate.gypi from Chromium to
ensure that our own is used and not that one (in case any
paths would be incorrect).

I also ran build/gyp_chromium in a Chromium checkout
with WebRTC in third_party/webrtc having this patch applied
to ensure GYP processing was still working.

Finally, I verified that the same project generation and
compilation from a Chromium checkout worked the way we build
our Android native tests, using:
. build/android/envsetup.sh
GYP_DEFINES="$GYP_DEFINES include_tests=1 enable_tracing=1" gclient runhooks
ninja -C out/Release android_builder_webrtc

BUG=1916
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2338004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4907 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org
2013-10-02 19:31:16 +00:00
parent f8f78b1316
commit 2a97317953
19 changed files with 134 additions and 68 deletions

View File

@@ -25,13 +25,11 @@
'build_with_libjingle': 1,
'webrtc_root%': '<(DEPTH)/third_party/webrtc',
'apk_tests_path%': '<(DEPTH)/third_party/webrtc/build/apk_tests.gyp',
'import_isolate_path%': '<(DEPTH)/third_party/webrtc/build/import_isolate_chromium.gyp',
'modules_java_gyp_path%': '<(DEPTH)/third_party/webrtc/modules/modules_java_chromium.gyp',
}, {
'build_with_libjingle%': 0,
'webrtc_root%': '<(DEPTH)/webrtc',
'apk_tests_path%': '<(DEPTH)/webrtc/build/apk_test_noop.gyp',
'import_isolate_path%': '<(DEPTH)/webrtc/build/import_isolate_webrtc.gyp',
'modules_java_gyp_path%': '<(DEPTH)/webrtc/modules/modules_java.gyp',
}],
],
@@ -40,7 +38,6 @@
'build_with_libjingle%': '<(build_with_libjingle)',
'webrtc_root%': '<(webrtc_root)',
'apk_tests_path%': '<(apk_tests_path)',
'import_isolate_path%': '<(import_isolate_path)',
'modules_java_gyp_path%': '<(modules_java_gyp_path)',
'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
@@ -51,7 +48,6 @@
'build_with_libjingle%': '<(build_with_libjingle)',
'webrtc_root%': '<(webrtc_root)',
'apk_tests_path%': '<(apk_tests_path)',
'import_isolate_path%': '<(import_isolate_path)',
'modules_java_gyp_path%': '<(modules_java_gyp_path)',
'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
'include_opus%': '<(include_opus)',

View File

@@ -1,22 +0,0 @@
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# See webrtc/build/import_isolate_webrtc.gyp for information about this file.
{
'targets': [
{
'target_name': 'import_isolate_gypi',
'type': 'none',
'includes': [
# Relative path to isolate.gypi when WebRTC is built from inside
# Chromium (i.e. the webrtc/ folder is checked out into third_party/).
'../../../build/apk_test.gypi',
],
},
],
}

View File

@@ -1,25 +0,0 @@
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# This file exists so we can find the isolate.gypi both when WebRTC is built
# stand-alone and when built as a part of Chrome.
# This is needed since GYP does not support evaluating variables in the
# includes sections of a target, so we cannot use <(DEPTH) or <(webrtc_root).
{
'targets': [
{
'target_name': 'import_isolate_gypi',
'type': 'none',
'includes': [
# Relative path to isolate.gypi when WebRTC built as a stand-alone
# project (i.e. Chromium's build/ folder is checked out into the root).
'../../build/isolate.gypi',
],
},
],
}

117
webrtc/build/isolate.gypi Normal file
View File

@@ -0,0 +1,117 @@
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# Copied from Chromium's src/build/isolate.gypi
#
# It was necessary to copy this file to WebRTC, because the path to
# build/common.gypi is different for the standalone and Chromium builds. Gyp
# doesn't permit conditional inclusion or variable expansion in include paths.
# http://code.google.com/p/gyp/wiki/InputFormatReference#Including_Other_Files
# This file is meant to be included into a target to provide a rule
# to "build" .isolate files into a .isolated file.
#
# To use this, create a gyp target with the following form:
# 'conditions': [
# ['test_isolation_mode != "noop"', {
# 'targets': [
# {
# 'target_name': 'foo_test_run',
# 'type': 'none',
# 'dependencies': [
# 'foo_test',
# ],
# 'includes': [
# '../build/isolate.gypi',
# 'foo_test.isolate',
# ],
# 'sources': [
# 'foo_test.isolate',
# ],
# },
# ],
# }],
# ],
#
# Note: foo_test.isolate is included and a source file. It is an inherent
# property of the .isolate format. This permits to define GYP variables but is
# a stricter format than GYP so isolate.py can read it.
#
# The generated .isolated file will be:
# <(PRODUCT_DIR)/foo_test.isolated
{
'rules': [
{
'rule_name': 'isolate',
'extension': 'isolate',
'inputs': [
# Files that are known to be involved in this step.
'<(DEPTH)/tools/swarm_client/isolate.py',
'<(DEPTH)/tools/swarm_client/run_isolated.py',
'<(DEPTH)/tools/swarm_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
# dependency. This improves the runtime of the build driver since it
# doesn't have to stat() all these files.
#
# More importantly, it means that even if a isolate_dependency_tracked
# file is missing, for example if a file was deleted and the .isolate
# file was not updated, that won't break the build, especially in the
# case where foo_tests_run is not built! This should be reenabled once
# the switch-over to running tests on Swarm is completed.
#'<@(isolate_dependency_tracked)',
],
'outputs': [
'<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
],
'conditions': [
["test_isolation_outdir==''", {
'action': [
'python',
'<(DEPTH)/tools/swarm_client/isolate.py',
'<(test_isolation_mode)',
# 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.
#
# Other variables should use the -V FOO=<(FOO) form so frequent
# values, like '0' or '1', aren't stripped out by GYP.
'--outdir', '<(PRODUCT_DIR)/ ',
'--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ',
'--variable', 'OS=<(OS)',
'--result', '<@(_outputs)',
'--isolate', '<(RULE_INPUT_PATH)',
],
}, {
'action': [
'python',
'<(DEPTH)/tools/swarm_client/isolate.py',
'<(test_isolation_mode)',
'--outdir', '<(test_isolation_outdir)',
# See comment above.
'--variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ',
'--variable', 'OS=<(OS)',
'--result', '<@(_outputs)',
'--isolate', '<(RULE_INPUT_PATH)',
],
}],
['test_isolation_fail_on_missing == 0', {
'action': ['--ignore_broken_items'],
},
],
],
'msvs_cygwin_shell': 0,
},
],
}

View File

@@ -236,10 +236,10 @@
'target_name': 'common_audio_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'common_audio_unittests',
],
'includes': [
'../build/isolate.gypi',
'common_audio_unittests.isolate',
],
'sources': [

View File

@@ -114,10 +114,10 @@
'target_name': 'common_video_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'common_video_unittests',
],
'includes': [
'../build/isolate.gypi',
'common_video_unittests.isolate',
],
'sources': [

View File

@@ -251,10 +251,10 @@
'target_name': 'neteq_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'neteq_unittests',
],
'includes': [
'../../../build/isolate.gypi',
'neteq_unittests.isolate',
],
'sources': [

View File

@@ -200,10 +200,10 @@
'target_name': 'audio_decoder_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'audio_decoder_unittests',
],
'includes': [
'../../../build/isolate.gypi',
'audio_decoder_unittests.isolate',
],
'sources': [

View File

@@ -241,10 +241,10 @@
'target_name': 'audio_device_tests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'audio_device_tests',
],
'includes': [
'../../build/isolate.gypi',
'audio_device_tests.isolate',
],
'sources': [

View File

@@ -349,10 +349,10 @@
'target_name': 'modules_tests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'modules_tests',
],
'includes': [
'../build/isolate.gypi',
'modules_tests.isolate',
],
'sources': [
@@ -363,10 +363,10 @@
'target_name': 'modules_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'modules_unittests',
],
'includes': [
'../build/isolate.gypi',
'modules_unittests.isolate',
],
'sources': [

View File

@@ -185,10 +185,10 @@
'target_name': 'video_capture_tests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'video_capture_tests',
],
'includes': [
'../../build/isolate.gypi',
'video_capture_tests.isolate',
],
'sources': [

View File

@@ -228,10 +228,10 @@
'target_name': 'video_render_tests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'video_render_tests',
],
'includes': [
'../../build/isolate.gypi',
'video_render_tests.isolate',
],
'sources': [

View File

@@ -79,10 +79,10 @@
'target_name': 'system_wrappers_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'system_wrappers_unittests',
],
'includes': [
'../../build/isolate.gypi',
'system_wrappers_unittests.isolate',
],
'sources': [

View File

@@ -70,10 +70,10 @@
'target_name': 'metrics_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'metrics_unittests',
],
'includes': [
'../build/isolate.gypi',
'metrics_unittests.isolate',
],
'sources': [

View File

@@ -208,10 +208,10 @@
'target_name': 'test_support_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'test_support_unittests',
],
'includes': [
'../build/isolate.gypi',
'test_support_unittests.isolate',
],
'sources': [

View File

@@ -150,10 +150,10 @@
'target_name': 'tools_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'tools_unittests',
],
'includes': [
'../build/isolate.gypi',
'tools_unittests.isolate',
],
'sources': [

View File

@@ -133,10 +133,10 @@
'target_name': 'vie_auto_test_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'vie_auto_test',
],
'includes': [
'../../../build/isolate.gypi',
'vie_auto_test.isolate',
],
'sources': [

View File

@@ -185,10 +185,10 @@
'target_name': 'video_engine_core_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'video_engine_core_unittests',
],
'includes': [
'../build/isolate.gypi',
'video_engine_core_unittests.isolate',
],
'sources': [

View File

@@ -303,10 +303,10 @@
'target_name': 'voice_engine_unittests_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'voice_engine_unittests',
],
'includes': [
'../build/isolate.gypi',
'voice_engine_unittests.isolate',
],
'sources': [
@@ -317,10 +317,10 @@
'target_name': 'voe_auto_test_run',
'type': 'none',
'dependencies': [
'<(import_isolate_path):import_isolate_gypi',
'voe_auto_test',
],
'includes': [
'../build/isolate.gypi',
'voe_auto_test.isolate',
],
'sources': [