summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 05:42:12 +0000
committerbradnelson@google.com <bradnelson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 05:42:12 +0000
commit805009ad9ffc979571f1d981a362358e32d4b054 (patch)
treebf336f066f63d22b702faec648965f5ebd7a72dd
parent96a2762c859e7eae719c4065de33da9851336d5d (diff)
downloadchromium_src-805009ad9ffc979571f1d981a362358e32d4b054.zip
chromium_src-805009ad9ffc979571f1d981a362358e32d4b054.tar.gz
chromium_src-805009ad9ffc979571f1d981a362358e32d4b054.tar.bz2
Revert 97429 - Switching IRT to be built inside the chrome build.
Dropping the IRT download step from the DEPS. Step3 of a many step plan to switch where ppapi + irt live / are built. BUG=None TEST=None R=noelallen@google.com,brettw@chromium.org Review URL: http://codereview.chromium.org/7669058 TBR=bradnelson@google.com Review URL: http://codereview.chromium.org/7687004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97431 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS33
-rw-r--r--chrome/build_nacl_irt.py164
-rw-r--r--chrome/nacl.gypi67
3 files changed, 44 insertions, 220 deletions
diff --git a/DEPS b/DEPS
index aedfea9..d673034 100644
--- a/DEPS
+++ b/DEPS
@@ -7,24 +7,28 @@ vars = {
"webkit_revision": "93328",
"chromium_git": "http://git.chromium.org/git",
"swig_revision": "69281",
+ # These hashes need to be updated when nacl_revision is changed.
+ # After changing nacl_revision, run 'gclient runhooks' to get the new values.
+ "nacl_irt_hash_x86_32": "96f8b8602ee43b05898fb22302fb5eb2dded4d5c",
+ "nacl_irt_hash_x86_64": "9b04a640e6216aea7153654dee1ab264fb537478",
"nacl_revision": "6459",
# After changing nacl_revision, run 'glient sync' and check native_client/DEPS
# to update other nacl_*_revision's.
# TODO(brettw) We should use the "From" syntax to avoid hardcoding the
# revisions here, but it makes checkdeps confused. We should fix checkdeps.
- "nacl_chrome_ppapi_revision": "97134", # native_client/DEPS: chrome_ppapi_rev
+ "nacl_chrome_ppapi_revision": "96903", # native_client/DEPS: chrome_ppapi_rev
"nacl_tools_revision": "5360", # native_client/DEPS: tools_rev
# These hashes need to be updated when nacl_toolchain_revision is changed.
# After changing nacl_toolchain_revision, run 'gclient runhooks' to get the
# new values.
"nacl_toolchain_mac_x86_newlib_hash":
- "82998a858c3b08554ad510f1992cf9a063855713",
+ "be4cc2baf6eb34c8fe155a1bb61e2acd8ca1e924",
"nacl_toolchain_win_x86_newlib_hash":
- "a29439ae7dc054641ee37771492a5ca7090504e8",
+ "56667d7f653b1005cd5116de3d8e9faf346053cf",
"nacl_toolchain_linux_x86_newlib_hash":
- "0529b0cb39e1470a609b8dfc11e1208baf8b35b1",
- "nacl_toolchain_revision": "6473",
+ "5e4876a1fa53c7701cdbeef969a99b3ff0b0ddc5",
+ "nacl_toolchain_revision": "6429",
"libjingle_revision": "77",
"libvpx_revision": "97420",
@@ -409,6 +413,20 @@ skip_child_includes = [
hooks = [
{
+ # A change to a .gyp, .gypi, or to GYP itself should run the generator.
+ "pattern": ".",
+ "action": ["python", "src/build/gyp_chromium"],
+ },
+ {
+ # This downloads binaries for Native Client's integrated runtime (IRT)
+ # library, which is built as NaCl untrusted code.
+ "pattern": ".",
+ "action": ["python", "src/build/download_nacl_irt.py",
+ "--nacl_revision", Var("nacl_revision"),
+ "--file_hash", "x86_32", Var("nacl_irt_hash_x86_32"),
+ "--file_hash", "x86_64", Var("nacl_irt_hash_x86_64")],
+ },
+ {
# This downloads binaries for Native Client's newlib toolchain.
# Done in lieu of building the toolchain from scratch as it can take
# anywhere from 30 minutes to 4 hours depending on platform to build.
@@ -425,9 +443,4 @@ hooks = [
Var("nacl_toolchain_linux_x86_newlib_hash"),
],
},
- {
- # A change to a .gyp, .gypi, or to GYP itself should run the generator.
- "pattern": ".",
- "action": ["python", "src/build/gyp_chromium"],
- },
]
diff --git a/chrome/build_nacl_irt.py b/chrome/build_nacl_irt.py
deleted file mode 100644
index 6489d39..0000000
--- a/chrome/build_nacl_irt.py
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2011 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 optparse
-import os
-import re
-import shutil
-import subprocess
-import sys
-
-
-# Where things are in relation to this script.
-SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
-SRC_DIR = os.path.dirname(SCRIPT_DIR)
-NACL_DIR = os.path.join(SRC_DIR, 'native_client')
-
-# Pathing to the two command_buffer directories (relative to native_client).
-NACL_CMD_BUFFER_DIR = os.path.join('src', 'shared',
- 'ppapi_proxy', 'command_buffer')
-GPU_CMD_BUFFER_DIR = os.path.join('..', 'gpu', 'command_buffer')
-
-
-def RelativePath(path, base):
- """Find the relative path.
-
- Arguments:
- path: path we want a relative path to.
- base: path we want a relative path from.
- Returns:
- The relative path from base to path.
- """
- path = os.path.abspath(path)
- base = os.path.abspath(base)
- path_parts = path.split(os.sep)
- base_parts = base.split(os.sep)
- while path_parts and base_parts and path_parts[0] == base_parts[0]:
- path_parts = path_parts[1:]
- base_parts = base_parts[1:]
- rel_parts = ['..'] * len(base_parts) + path_parts
- return os.sep.join(rel_parts)
-
-
-def PrintInputs(platforms):
- """Print all the transitive inputs required to build the IRT.
-
- Arguments:
- platforms: list of platform names to build for.
- """
- inputs = set()
- for platform in platforms:
- # Invoke scons to get dependency tree.
- cmd = [
- sys.executable, 'scons.py', '-n', '--tree=all',
- '--mode=nacl', 'platform=' + platform,
- 'scons-out/nacl_irt-' + platform + '/staging/irt.nexe',
- ]
- p = subprocess.Popen(cmd, cwd=NACL_DIR,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- (p_stdout, p_stderr) = p.communicate()
- if p.returncode != 0:
- sys.exit(2)
- # Extract unique inputs.
- for line in p_stdout.splitlines():
- m = re.match('^[ -+|]*\+\-(.+)', line)
- if not m:
- continue
- filename = m.group(1)
- if '[' in filename:
- continue
- if filename.startswith('scons-out'):
- continue
- if filename.endswith('.nexe'):
- continue
- # Apply the underlay of gpu/command_buffer (to match scons).
- if filename.startswith(NACL_CMD_BUFFER_DIR + os.sep):
- filename = GPU_CMD_BUFFER_DIR + filename[len(NACL_CMD_BUFFER_DIR):]
- inputs.add(filename)
- # Check that everything exists and make it script relative.
- rel_inputs = set()
- for f in inputs:
- nf = os.path.join(NACL_DIR, f)
- if not os.path.exists(nf):
- raise Exception('missing input file "%s"' % nf)
- rel_inputs.add(RelativePath(nf, SCRIPT_DIR))
- # Print it sorted.
- rel_inputs = sorted(list(rel_inputs))
- for f in rel_inputs:
- print f
-
-
-def BuildIRT(platforms, out_dir):
- """Build the IRT for several platforms.
-
- Arguments:
- platforms: list of platform names to build for.
- out_dir: directory to output the IRT to.
- """
- # Clean.
- scons_out = os.path.join(NACL_DIR, 'scons-out')
- if os.path.exists(scons_out):
- shutil.rmtree(scons_out)
- # Build for each platform.
- for platform in platforms:
- cmd = [
- sys.executable, 'scons.py', '--verbose', '-j8',
- '--mode=nacl', 'platform=' + platform,
- 'scons-out/nacl_irt-' + platform + '/staging/irt.nexe',
- ]
- print 'Running: ' + ' '.join(cmd)
- p = subprocess.Popen(cmd, cwd=NACL_DIR)
- p.wait()
- if p.returncode != 0:
- sys.exit(3)
- # Copy out each platform after stripping.
- for platform in platforms:
- uplatform = platform.replace('-', '_')
- platform2 = {'x86-32': 'i686', 'x86-64': 'x86_64'}.get(platform, platform)
- cplatform = {
- 'win32': 'win',
- 'cygwin': 'win',
- 'darwin': 'mac',
- }.get(sys.platform, 'linux')
- nexe = os.path.join(out_dir, 'nacl_irt_' + uplatform + '.nexe')
- cmd = [
- '../native_client/toolchain/' + cplatform + '_x86_newlib/bin/' +
- platform2 + '-nacl-strip',
- '--strip-debug',
- '../native_client/scons-out/nacl_irt-' + platform + '/staging/irt.nexe',
- '-o', nexe
- ]
- print 'Running: ' + ' '.join(cmd)
- p = subprocess.Popen(cmd, cwd=SCRIPT_DIR)
- p.wait()
- if p.returncode != 0:
- sys.exit(4)
-
-
-def Main(argv):
- parser = optparse.OptionParser()
- parser.add_option('--inputs', dest='inputs', default=False,
- action='store_true',
- help='only emit the transitive inputs to the irt build')
- parser.add_option('--platform', dest='platforms', action='append',
- default=[],
- help='add a platform to build for (x86-32|x86-64)')
- parser.add_option('--outdir', dest='outdir',
- help='directory to out irt to')
- (options, args) = parser.parse_args(argv[1:])
- if args or not options.platforms or (
- not options.inputs and not options.outdir):
- parser.print_help()
- sys.exit(1)
-
- if options.inputs:
- PrintInputs(options.platforms)
- else:
- BuildIRT(options.platforms, options.outdir)
-
-
-if __name__ == '__main__':
- Main(sys.argv)
diff --git a/chrome/nacl.gypi b/chrome/nacl.gypi
index 9317b92..bfc6652 100644
--- a/chrome/nacl.gypi
+++ b/chrome/nacl.gypi
@@ -79,52 +79,27 @@
'<@(nacl_defines)',
],
},
- 'actions': [
- {
- 'action_name': 'nacl_irt',
- 'message': 'Building NaCl IRT',
- 'variables': {
- 'irt_build_cmd': [
- 'python', 'build_nacl_irt.py', '--outdir', '<(PRODUCT_DIR)',
- ],
- 'irt_inputs_cmd':
- 'python build_nacl_irt.py --inputs',
- },
- 'conditions': [
- ['OS=="win"', {
- 'inputs': [
- '<!@(<(irt_inputs_cmd) --platform=x86-32 --platform=x86-64)',
- ],
- 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
- '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe'],
- 'action': [
- '<@(irt_build_cmd)',
- '--platform', 'x86-32',
- '--platform', 'x86-64',
- ],
- }, {
- 'conditions': [
- ['target_arch=="ia32"', {
- 'inputs': [
- '<!@(<(irt_inputs_cmd) --platform=x86-32)',
- ],
- 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_32.nexe'],
- 'action': [
- '<@(irt_build_cmd)', '--platform', 'x86-32',
- ],
- }, { # target_arch=="x64"
- 'inputs': [
- '<!@(<(irt_inputs_cmd) --platform=x86-64)',
- ],
- 'outputs': ['<(PRODUCT_DIR)/nacl_irt_x86_64.nexe'],
- 'action': [
- '<@(irt_build_cmd)', '--platform', 'x86-64',
- ],
- }],
- ],
- }],
- ],
- },
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)',
+ 'files': [
+ '../native_client/irt_binaries/nacl_irt_x86_32.nexe',
+ ],
+ },
+ ],
+ }],
+ ['target_arch=="x64" or OS=="win"', {
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)',
+ 'files': [
+ '../native_client/irt_binaries/nacl_irt_x86_64.nexe',
+ ],
+ },
+ ],
+ }],
],
},
],