diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-29 01:16:22 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-29 01:16:22 +0000 |
commit | 564c99137aeb3b64c8be6847b9f79b78b484c7bb (patch) | |
tree | e4e7b0eb662b60fe13a66bb5419b7bbd464d13e0 /native_client_sdk | |
parent | 3ce5797c5647c455f65ef970fffd0e7e0c1e53cb (diff) | |
download | chromium_src-564c99137aeb3b64c8be6847b9f79b78b484c7bb.zip chromium_src-564c99137aeb3b64c8be6847b9f79b78b484c7bb.tar.gz chromium_src-564c99137aeb3b64c8be6847b9f79b78b484c7bb.tar.bz2 |
Revert "Restructuring SDK so that it builds inside a normal chrome checkout."
This reverts commit f93e934130f674cde671d49f17dc152793e943ca.
Revert "Make archiving source independent of which buildbot_run.py is run from."
This reverts commit c4ab747a752ee8228bfb78f71b54df8ef9104c7e.
BUG=105658
Review URL: http://codereview.chromium.org/8664018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
23 files changed, 236 insertions, 246 deletions
diff --git a/native_client_sdk/src/DEPS b/native_client_sdk/src/DEPS index f495abd..efe627b 100644 --- a/native_client_sdk/src/DEPS +++ b/native_client_sdk/src/DEPS @@ -1,3 +1,124 @@ vars = { "chrome_milestone": "17", + "chrome_rev": "109032", + "chromium_trunk": "http://src.chromium.org/svn/trunk", + # Get PPAPI directly from Chrome, not via the NaCl repo. + "gmock_trunk": "http://googlemock.googlecode.com/svn/trunk/", + "gmock_version": "382", + "gtest_trunk": "http://googletest.googlecode.com/svn/trunk/", + "gtest_version": "570", + "native_client_trunk": "http://src.chromium.org/native_client/trunk", + "native_client_version": "7141", + # Note: The following version should exactly match the toolchain version in + # the native_client DEPS file at version native_client_version + # TODO(mball) find some clever way to extract this from NaCl DEPS + "pnacl_toolchain_version": "7107", + "x86_toolchain_version": "7098", + # ARM is not supported, this number can stay pinned at 6645. + "arm_trusted_toolchain_version": "6645", + "pymox": "http://pymox.googlecode.com/svn/trunk", + "pymox_version": "61", } +# When we have ARM and PNaCl support, we'll need to add toolchain support +# for those too. + +deps = { + "nacl_deps": + File(Var("native_client_trunk") + "/src/native_client/DEPS@" + + Var("native_client_version")), + # Please keep these in alphabetical order, by path + "src/site_scons": + Var("native_client_trunk") + "/src/native_client/site_scons@" + + Var("native_client_version"), + "src/third_party/gmock": + Var("gmock_trunk") + "@" + Var("gmock_version"), + "src/third_party/gtest": + Var("gtest_trunk") + "@" + Var("gtest_version"), + "src/third_party/native_client/base": + Var("chromium_trunk") + "/src/base@" + Var("chrome_rev"), + "src/third_party/native_client/build": + Var("chromium_trunk") + "/src/build@" + Var("chrome_rev"), + "src/third_party/native_client/gpu": + Var("chromium_trunk") + "/src/gpu@" + Var("chrome_rev"), + "src/third_party/native_client/native_client": + Var("native_client_trunk") + "/src/native_client/@" + + Var("native_client_version"), + "src/third_party/native_client/ppapi": + Var("chromium_trunk") + "/src/ppapi@" + Var("chrome_rev"), + "src/third_party/pymox": + Var("pymox") + "@" + Var("pymox_version"), + "src/third_party/scons-2.0.1": + Var("native_client_trunk") + "/src/third_party/scons-2.0.1@" + + Var("native_client_version"), + "src/third_party/native_client/third_party/pylib": + Var("native_client_trunk") + "/src/third_party/pylib@" + + Var("native_client_version"), + "src/third_party/native_client/third_party/scons-2.0.1": + Var("native_client_trunk") + "/src/third_party/scons-2.0.1@" + + Var("native_client_version"), + "src/third_party/native_client/third_party/simplejson": + (Var("chromium_trunk") + "/tools/build/third_party/simplejson@" + + Var("chrome_rev")), + "src/third_party/native_client/tools/valgrind": + Var("chromium_trunk") + "/src/tools/valgrind@" + Var("chrome_rev"), +} + +deps_os = { + # Please keep these in alphabetical order, by path + "win": { + "src/experimental/visual_studio_plugin/third_party/native_client/" + "src/shared/gio": + Var("native_client_trunk") + "/src/native_client/src/shared/gio@" + + Var("native_client_version"), + "src/experimental/visual_studio_plugin/third_party/native_client/" + "src/shared/platform": + Var("native_client_trunk") + "/src/native_client/src/shared/platform@" + + Var("native_client_version"), + "src/experimental/visual_studio_plugin/third_party/native_client/" + "src/trusted/debug_stub": + Var("native_client_trunk") + "/src/native_client/src/trusted/debug_stub@" + + Var("native_client_version"), + "src/experimental/visual_studio_plugin/third_party/native_client/" + "src/trusted/service_runtime/include": + Var("native_client_trunk") + + "/src/native_client/src/trusted/service_runtime/include@" + + Var("native_client_version"), + "src/experimental/visual_studio_plugin/third_party/native_client/" + "src/include": + Var("native_client_trunk") + "/src/native_client/src/include@" + + Var("native_client_version"), + "src/experimental/visual_studio_plugin/third_party/native_client/" + "src/trusted/port": + Var("native_client_trunk") + "/src/native_client/src/trusted/port@" + + Var("native_client_version"), + "src/experimental/visual_studio_plugin/third_party/native_client/" + "src/trusted/gdb_rsp": + Var("native_client_trunk") + "/src/native_client/src/trusted/gdb_rsp@" + + Var("native_client_version"), + "src/third_party/native_client/third_party/mingw-w64/mingw/bin": + From("nacl_deps", "third_party/mingw-w64/mingw/bin"), + }, +} + +hooks = [ + { + "pattern": ".", + "action": [ + "python", + "src/third_party/native_client/native_client/build/" + "download_toolchains.py", + "--x86-version", Var("x86_toolchain_version"), + "--pnacl-version", Var("pnacl_toolchain_version"), + "--arm-trusted-version", Var("arm_trusted_toolchain_version"), + "--toolchain-dir", "src/toolchain", + "--save-downloads-dir", "src/build_tools/toolchain_archives", + ] + }, + { + "pattern": ".", + "action": [ + "python", + "src/build_tools/install_third_party.py", "--all-toolchains", + ] + } +] diff --git a/native_client_sdk/src/build_tools/build.scons b/native_client_sdk/src/build_tools/build.scons index d0d2185..16d86f1 100644 --- a/native_client_sdk/src/build_tools/build.scons +++ b/native_client_sdk/src/build_tools/build.scons @@ -132,7 +132,10 @@ if env['IS_WINDOWS']: import gyp_extract -ppapi_base = os.path.join(env['SRC_DIR'], 'ppapi') +ppapi_base = os.path.join(env['ROOT_DIR'], + 'third_party', + 'native_client', + 'ppapi') # Load ppapi_cpp.gypi ppapi_cpp_gypi = gyp_extract.LoadGypFile(os.path.join(ppapi_base, @@ -253,7 +256,7 @@ def build_nacl_tools(env, target, source): '--jobs', env['JOB_COUNT'], '--nacl_dir', - env['SRC_DIR'], + os.path.join(env['ROOT_DIR'], 'third_party', 'native_client'), ] if env.GetOption('clean'): make_nacl_tools_args.extend(['--clean']) diff --git a/native_client_sdk/src/build_tools/build_utils.py b/native_client_sdk/src/build_tools/build_utils.py index 60bdc80..28cd095 100644 --- a/native_client_sdk/src/build_tools/build_utils.py +++ b/native_client_sdk/src/build_tools/build_utils.py @@ -110,12 +110,7 @@ def NormalizeToolchain(toolchain=TOOLCHAIN_AUTODETECT, variant=nacl_utils.DEFAULT_TOOLCHAIN_VARIANT): if toolchain == TOOLCHAIN_AUTODETECT: if base_dir is None: - script_path = os.path.abspath(__file__) - script_dir = os.path.dirname(script_path) - sdk_src_dir = os.path.dirname(script_dir) - sdk_dir = os.path.dirname(sdk_src_dir) - src_dir = os.path.dirname(sdk_dir) - base_dir = os.path.join(src_dir, 'native_client') + base_dir = os.getenv('NACL_SDK_ROOT', '') normalized_toolchain = nacl_utils.ToolchainPath(base_dir=base_dir, arch=arch, variant=variant) @@ -240,7 +235,11 @@ class BotAnnotator: self._stream.flush() def BuildStep(self, name): - self.Print("@@@BUILD_STEP %s@@@" % name) + self.Print("BUILD_STEP %s" % name) + # mball: Disabling buildbot annotations because it's more confusing than + # useful when running multiple jobs simultaneously. To re-enable + # annotations, using the following line instead of the previous: + # self.Print("@@@BUILD_STEP %s@@@" % name) def BuildStepFailure(self): '''Signal a failure in the current build step to the annotator''' diff --git a/native_client_sdk/src/build_tools/buildbot_run.py b/native_client_sdk/src/build_tools/buildbot_run.py index a1fb494..ddaf723 100755 --- a/native_client_sdk/src/build_tools/buildbot_run.py +++ b/native_client_sdk/src/build_tools/buildbot_run.py @@ -10,11 +10,8 @@ import subprocess import sys # Add scons to the python path (as nacl_utils.py requires it). -SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -SDK_SRC_DIR = os.path.dirname(SCRIPT_DIR) -SDK_DIR = os.path.dirname(SDK_SRC_DIR) -SRC_DIR = os.path.dirname(SDK_DIR) -sys.path.append(os.path.join(SRC_DIR, 'third_party/scons-2.0.1/engine')) +PARENT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.append(os.path.join(PARENT_DIR, 'third_party/scons-2.0.1/engine')) import build_utils @@ -37,11 +34,10 @@ def Archive(revision, chrome_milestone): dst = 'naclsdk_linux.tgz' bucket_path = 'nativeclient-mirror/nacl/nacl_sdk/pepper_%s_%s/%s' % ( chrome_milestone, revision, dst) - full_src = os.path.join(SDK_DIR, src) full_dst = 'gs://%s' % bucket_path subprocess.check_call( '/b/build/scripts/slave/gsutil cp -a public-read %s %s' % ( - full_src, full_dst), shell=True) + src, full_dst), shell=True) url = 'https://commondatastorage.googleapis.com/%s' % bucket_path print '@@@STEP_LINK@download@%s@@@' % url sys.stdout.flush() @@ -62,19 +58,11 @@ def main(argv): sys.stdout.flush() subprocess.check_call(' '.join(parameters), shell=True, cwd=parent_dir) - print '@@@BUILD_STEP install third party@@@' - sys.stdout.flush() - subprocess.check_call(' '.join([ - sys.executable, - 'build_tools/install_third_party.py', - '--all-toolchains', - ]), shell=True, cwd=parent_dir) - print '@@@BUILD_STEP generate sdk@@@' sys.stdout.flush() Run(params + ['-c']) - Run(params + ['bot', '-j1']) + Run(params + ['bot']) # Archive on non-trybots. if '-sdk' in os.environ.get('BUILDBOT_BUILDERNAME', ''): diff --git a/native_client_sdk/src/build_tools/generate_installers.py b/native_client_sdk/src/build_tools/generate_installers.py index 9160a1d..b83f491 100755 --- a/native_client_sdk/src/build_tools/generate_installers.py +++ b/native_client_sdk/src/build_tools/generate_installers.py @@ -83,28 +83,19 @@ def main(argv): else: all_contents += installer_contents.LINUX_ONLY_CONTENTS - total_contents = ( + all_contents_string = string.join( installer_contents.GetFilesFromPathList(all_contents) + - installer_contents.GetDirectoriesFromPathList(all_contents) - ) - for item in total_contents: - itemf = installer_contents.FilterPathLayout(item) - src = itemf[0] - src_dir = os.path.join(tar_src_dir, itemf[1]) - dst_dir = os.path.join(installer_dir, itemf[2]) - print 'Tarring "%s" in "%s" then untarring in "%s"' % ( - src, src_dir, dst_dir) - if not os.path.exists(dst_dir): - os.makedirs(dst_dir) - tar_cf = subprocess.Popen('tar cf - %s' % src, - bufsize=-1, - cwd=src_dir, env=env, shell=True, - stdout=subprocess.PIPE) - tar_xf = subprocess.Popen('tar xfv -', - cwd=dst_dir, env=env, shell=True, - stdin=tar_cf.stdout) - assert tar_xf.wait() == 0 - assert tar_cf.poll() == 0 + installer_contents.GetDirectoriesFromPathList(all_contents), + ' ') + tar_cf = subprocess.Popen('tar cf - %s' % all_contents_string, + bufsize=-1, + cwd=tar_src_dir, env=env, shell=True, + stdout=subprocess.PIPE) + tar_xf = subprocess.Popen('tar xfv -', + cwd=installer_dir, env=env, shell=True, + stdin=tar_cf.stdout) + assert tar_xf.wait() == 0 + assert tar_cf.poll() == 0 # This loop prunes the result of os.walk() at each excluded dir, so that it # doesn't descend into the excluded dir. diff --git a/native_client_sdk/src/build_tools/generate_windows_installer.py b/native_client_sdk/src/build_tools/generate_windows_installer.py index cf6db7d..a87b19e 100755 --- a/native_client_sdk/src/build_tools/generate_windows_installer.py +++ b/native_client_sdk/src/build_tools/generate_windows_installer.py @@ -38,7 +38,7 @@ def main(argv): # Create a temporary directory using the version string, then move the # contents of src to that directory, clean the directory of unwanted # stuff and finally create an installer. - temp_dir = '/naclsdk_temp' + temp_dir = os.path.join(script_dir, 'installers_temp') installer_dir = os.path.join(temp_dir, version_dir) bot.Print('generate_windows_installer chose installer directory: %s' % (installer_dir)) @@ -53,15 +53,12 @@ def main(argv): env['NACL_TARGET_PLATFORM'] = '.' # Use the repo's toolchain. # Build the experimental projects. - # DISABLED FOR NOW. - if False: - bot.BuildStep('build experimental') - bot.Print('generate_windows_installer is ' - 'building the experimental projects.') - experimental_path = os.path.join(home_dir, 'src', 'experimental') - scons_path = os.path.join(experimental_path, 'scons.bat') - scons_cmd = scons_path + ' --nacl-platform="."' - subprocess.check_call(scons_cmd, cwd=experimental_path, env=env) + bot.BuildStep('build experimental') + bot.Print('generate_windows_installer is building the experimental projects.') + experimental_path = os.path.join(home_dir, 'src', 'experimental') + scons_path = os.path.join(experimental_path, 'scons.bat') + scons_cmd = scons_path + ' --nacl-platform="."' + subprocess.check_call(scons_cmd, cwd=experimental_path, env=env) # On windows we use copytree to copy the SDK into the build location # because there is no native tar and using cygwin's version has proven @@ -77,11 +74,7 @@ def main(argv): installer_contents.WINDOWS_ONLY_CONTENTS for copy_source_dir in installer_contents.GetDirectoriesFromPathList( all_contents): - itemf = installer_contents.FilterPathLayout(copy_source_dir) - dst_dir = os.path.join(installer_dir, itemf[2]) - if not os.path.exists(dst_dir): - os.makedirs(dst_dir) - copy_target_dir = os.path.join(dst_dir, itemf[0]) + copy_target_dir = os.path.join(installer_dir, copy_source_dir) bot.Print("Copying %s to %s" % (copy_source_dir, copy_target_dir)) shutil.copytree(copy_source_dir, copy_target_dir, @@ -89,8 +82,7 @@ def main(argv): ignore=shutil.ignore_patterns(*IGNORE_PATTERN)) for copy_source_file in installer_contents.GetFilesFromPathList( all_contents): - itemf = installer_contents.FilterPathLayout(copy_source_file) - copy_target_file = os.path.join(installer_dir, itemf[2], itemf[0]) + copy_target_file = os.path.join(installer_dir, copy_source_file) bot.Print("Copying %s to %s" % (copy_source_file, copy_target_file)) if not os.path.exists(os.path.dirname(copy_target_file)): os.makedirs(os.path.dirname(copy_target_file)) diff --git a/native_client_sdk/src/build_tools/install_nsis.py b/native_client_sdk/src/build_tools/install_nsis.py index 793d5c5..99f3bea 100644 --- a/native_client_sdk/src/build_tools/install_nsis.py +++ b/native_client_sdk/src/build_tools/install_nsis.py @@ -10,25 +10,18 @@ import subprocess import zipfile -SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -SDK_SRC_DIR = os.path.dirname(SCRIPT_DIR) -SRC_DIR = os.path.dirname(os.path.dirname(SDK_SRC_DIR)) -THIRD_PARTY_DIR = os.path.join(SRC_DIR, 'third_party') -BIN_DIR = os.path.join(THIRD_PARTY_DIR, 'nacl_sdk_binaries') - # The name of the archive that contains the AccessControl extensions. -ACCESS_CONTROL_ZIP = os.path.join(BIN_DIR, 'AccessControl.zip') +ACCESS_CONTROL_ZIP = 'AccessControl.zip' # The AccessControl plugin. The installer check for this before installing. ACCESS_CONTROL_DLL = 'AccessControl.dll' # The name of the MkLnk extension DLL. This is checked into the SDK repo. -MKLINK_DLL = os.path.join(SCRIPT_DIR, - 'MkLink', 'Release Unicode', 'MkLink.dll') +MKLINK_DLL = os.path.join('MkLink', 'Release Unicode', 'MkLink.dll') # The NSIS compiler. The installer checks for this before installing. NSIS_COMPILER = 'makensis.exe' # The default directory name for the NSIS installation. NSIS_DIR = 'NSIS' # The name of the NSIS installer. This file is checked into the SDK repo. -NSIS_INSTALLER = os.path.join(BIN_DIR, 'nsis-2.46-Unicode-setup.exe') +NSIS_INSTALLER = 'nsis-2.46-Unicode-setup.exe' def MakeDirsIgnoreExist(dir_path, mode=0755): '''Recursively make a directory path. diff --git a/native_client_sdk/src/build_tools/install_third_party.py b/native_client_sdk/src/build_tools/install_third_party.py index 6510f4b6..431a684 100755 --- a/native_client_sdk/src/build_tools/install_third_party.py +++ b/native_client_sdk/src/build_tools/install_third_party.py @@ -19,10 +19,8 @@ from optparse import OptionParser # Append to PYTHONPATH in this very non-compliant way so that this script can be # run from a DEPS hook, where the normal path rules don't apply. -SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -SDK_SRC_DIR = os.path.dirname(SCRIPT_DIR) -SRC_DIR = os.path.dirname(os.path.dirname(SDK_SRC_DIR)) -THIRD_PARTY_DIR = os.path.join(SRC_DIR, 'third_party') +SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) +THIRD_PARTY_DIR = os.path.join(os.path.dirname(SCRIPT_DIR), 'third_party') SCONS_DIR = os.path.join(THIRD_PARTY_DIR, 'scons-2.0.1', 'engine') sys.path.append(SCRIPT_DIR) sys.path.append(SCONS_DIR) diff --git a/native_client_sdk/src/build_tools/installer_contents.py b/native_client_sdk/src/build_tools/installer_contents.py index 8304ce8..f9e5549 100644 --- a/native_client_sdk/src/build_tools/installer_contents.py +++ b/native_client_sdk/src/build_tools/installer_contents.py @@ -51,30 +51,29 @@ INSTALLER_CONTENTS = [ 'project_templates/init_project.py', 'project_templates/scons', 'project_templates/vs/', - '../../third_party/scons-2.0.1/', + 'third_party/scons-2.0.1/', ] -INSTALLER_CONTENTS.append('%s/' % nacl_utils.ToolchainPath( - base_dir='../../native_client', variant='newlib')) -INSTALLER_CONTENTS.append('%s/' % nacl_utils.ToolchainPath( - base_dir='../../native_client', variant='glibc')) +INSTALLER_CONTENTS.append('%s/' % nacl_utils.ToolchainPath(base_dir='', + variant='newlib')) +INSTALLER_CONTENTS.append('%s/' % nacl_utils.ToolchainPath(base_dir='', + variant='glibc')) LINUX_ONLY_CONTENTS = [ - '../../ppapi/', + 'third_party/ppapi/', ] MAC_ONLY_CONTENTS = [ - '../../ppapi/', + 'third_party/ppapi/', ] WINDOWS_ONLY_CONTENTS = [ 'examples/httpd.cmd', 'examples/scons.bat', 'project_templates/scons.bat', -# Dropping debugger. -# 'debugger/nacl-gdb_server/x64/Release/', -# 'debugger/nacl-gdb_server/Release/', -# 'debugger/nacl-bpad/x64/Release/' + 'debugger/nacl-gdb_server/x64/Release/', + 'debugger/nacl-gdb_server/Release/', + 'debugger/nacl-bpad/x64/Release/' ] # These files are user-readable documentation files, and as such get some @@ -179,35 +178,3 @@ def GetFilesFromPathList(path_list): ''' return ConvertToOSPaths( [dir for dir in path_list if not dir.endswith('/')]) - - -def FilterPathLayout(path): - '''Given a path, decide how it should be copied. - - The SDK was originally layed out homogeneously with the generated - installer. Inside the chromium tree, this is not longer desireable. - This function compenstates. - - Args: - path: A path to install. - - Returns: - A list of [src path to tar, cwd when taring src, dst to untar in]. - ''' - # Toolchain moved up to top of tree. - nacl_dir = '../../native_client/'.replace('/', os.sep) - top_dir = '../../'.replace('/', os.sep) - ppapi_dir = '../../ppapi/'.replace('/', os.sep) - - # Use toolchain from nacl_dir. - if path.startswith(nacl_dir): - return [os.path.join('.', path[len(nacl_dir):]), nacl_dir, '.'] - # Use ppapi directly, but put in third_party. - if path.startswith(ppapi_dir): - return [os.path.join('.', path[len(ppapi_dir):]), ppapi_dir, - 'third_party/ppapi'] - # Third party is used from top of tree (for scons). - if path.startswith(top_dir): - return [os.path.join('.', path[len(top_dir):]), top_dir, '.'] - # Normal case. - return [path, '.', '.'] diff --git a/native_client_sdk/src/build_tools/sdk_tools/set_nacl_env.py b/native_client_sdk/src/build_tools/sdk_tools/set_nacl_env.py index f2a65a8..1cc3581 100755 --- a/native_client_sdk/src/build_tools/sdk_tools/set_nacl_env.py +++ b/native_client_sdk/src/build_tools/sdk_tools/set_nacl_env.py @@ -137,9 +137,7 @@ def GetNaclSdkRoot(): if 'NACL_SDK_ROOT' in os.environ: return os.environ['NACL_SDK_ROOT'] else: - SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) - SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR))) - return os.path.join(SRC_DIR, 'native_client') + return os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def GetToolchainPath(options): diff --git a/native_client_sdk/src/build_tools/tests/build_utils_test.py b/native_client_sdk/src/build_tools/tests/build_utils_test.py index 8f7ddb4..67f0092 100755 --- a/native_client_sdk/src/build_tools/tests/build_utils_test.py +++ b/native_client_sdk/src/build_tools/tests/build_utils_test.py @@ -45,7 +45,7 @@ class TestBuildUtils(unittest.TestCase): stdout_mock = self.mock_factory.CreateMock(sys.stdout) stdout_mock.write("My Bot Message\n") stdout_mock.flush() - stdout_mock.write("@@@BUILD_STEP MyBuildStep@@@\n") + stdout_mock.write("BUILD_STEP MyBuildStep\n") stdout_mock.flush() self.mock_factory.ReplayAll() bot = build_utils.BotAnnotator(stdout_mock) diff --git a/native_client_sdk/src/build_tools/tests/installer_contents_test.py b/native_client_sdk/src/build_tools/tests/installer_contents_test.py index b1f903e..de07dd2 100755 --- a/native_client_sdk/src/build_tools/tests/installer_contents_test.py +++ b/native_client_sdk/src/build_tools/tests/installer_contents_test.py @@ -45,7 +45,7 @@ class TestInstallerContents(unittest.TestCase): self.assertEqual(output[2], '') self.assertEqual(output[3], os.path.join('abs', 'path')) - def DISABLEDtestGetToolchainManifest(self): + def testGetToolchainManifest(self): self.assertRaises(KeyError, installer_contents.GetToolchainManifest, 'notatoolchain') diff --git a/native_client_sdk/src/build_tools/tests/set_nacl_env_test.py b/native_client_sdk/src/build_tools/tests/set_nacl_env_test.py index f1ad4e7..143a584 100755 --- a/native_client_sdk/src/build_tools/tests/set_nacl_env_test.py +++ b/native_client_sdk/src/build_tools/tests/set_nacl_env_test.py @@ -18,8 +18,6 @@ from build_tools.sdk_tools import set_nacl_env SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) SDK_ROOT_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR)) -SRC_DIR = os.path.dirname(os.path.dirname(SDK_ROOT_DIR)) -NACL_DIR = os.path.join(SRC_DIR, 'native_client') class FakeOptions(object): @@ -33,14 +31,14 @@ class TestSetNaclEnv(unittest.TestCase): self._options = FakeOptions() self._options.host = 'mac' self._options.lib_variant = 'newlib' - self._options.sdk_root = NACL_DIR + self._options.sdk_root = SDK_ROOT_DIR self._options.sdk_platform = 'pepper_17' self._options.build_type = 'debug' self._options.no_ppapi = False self._options.merge = False self._env = {} - self._env['NACL_SDK_ROOT'] = NACL_DIR + self._env['NACL_SDK_ROOT'] = SDK_ROOT_DIR self._temp_dir = tempfile.mkdtemp(prefix='tmp_set_nacl_env_test') diff --git a/native_client_sdk/src/codereview.settings b/native_client_sdk/src/codereview.settings new file mode 100644 index 0000000..2f625f4 --- /dev/null +++ b/native_client_sdk/src/codereview.settings @@ -0,0 +1,9 @@ +# This file is used by gcl to get repository specific information. +CODE_REVIEW_SERVER: codereview.chromium.org +CC_LIST: native-client-reviews@googlegroups.com +VIEW_VC: http://code.google.com/p/nativeclient-sdk/source/detail?r= +STATUS: http://naclsdk-status.appspot.com/status +TRY_ON_UPLOAD: True +TRYSERVER_PROJECT: naclsdkm +TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl +DEPTH: 0 diff --git a/native_client_sdk/src/examples/scons b/native_client_sdk/src/examples/scons index d4daf81..7742fd7 100755 --- a/native_client_sdk/src/examples/scons +++ b/native_client_sdk/src/examples/scons @@ -4,9 +4,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. + readonly SCRIPT_DIR="$(dirname "$0")" readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)" -readonly SRC_DIR="$(dirname $(dirname $(dirname ${SCRIPT_DIR_ABS})))" # NACL_SDK_ROOT must be set. if [ x"${NACL_SDK_ROOT}"x == "xx" ] ; then @@ -25,23 +25,15 @@ if [ x"${NACL_TARGET_PLATFORM}"x == "xx" ] ; then fi readonly NACL_PLATFORM_DIR="${NACL_SDK_ROOT}/${NACL_TARGET_PLATFORM}" +readonly BASE_SCRIPT="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/script/scons" -SCONS_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1" - -if [ ! -f ${SCONS_DIR}/script/scons ]; then - SCONS_DIR="${SRC_DIR}/third_party/scons-2.0.1" -fi - -BASE_SCRIPT="${SCONS_DIR}/script/scons" - -export SCONS_LIB_DIR="${SCONS_DIR}/engine" -export PYTHONPATH="${SCONS_LIB_DIR}" -export PYTHONPATH="${PYTHONPATH}:${NACL_PLATFORM_DIR}/build_tools" - +export SCONS_LIB_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine" +export PYTHONPATH="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine" # We have to do this because scons overrides PYTHONPATH and does not preserve # what is provided by the OS. The custom variable name won't be overwritten. -export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox/src" +export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox" "${BASE_SCRIPT}" --file=build.scons \ - --site-dir="${SCRIPT_DIR_ABS}/../build_tools/nacl_sdk_scons" \ + --site-dir="${NACL_PLATFORM_DIR}/build_tools/nacl_sdk_scons" \ $* + diff --git a/native_client_sdk/src/examples/scons.bat b/native_client_sdk/src/examples/scons.bat index d3c6c06..2a67758 100755 --- a/native_client_sdk/src/examples/scons.bat +++ b/native_client_sdk/src/examples/scons.bat @@ -27,24 +27,17 @@ if not defined NACL_TARGET_PLATFORM ( set NACL_PLATFORM_DIR=%NACL_SDK_ROOT%\%NACL_TARGET_PLATFORM% -set SCONS_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1 -if exist %SCONS_DIR% goto gotscons -set SCONS_DIR=%~dp0..\..\..\third_party\scons-2.0.1 -:gotscons - -set SCONS_LIB_DIR=%SCONS_DIR%\engine -set PYTHONPATH=%SCONS_LIB_DIR%;%NACL_PLATFORM_DIR%\build_tools +set SCONS_LIB_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine +set PYTHONPATH=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine :: We have to do this because scons overrides PYTHONPATH and does not preserve :: what is provided by the OS. The custom variable name won't be overwritten. -set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox\src - -set BASE_SCRIPT=%SCONS_DIR%\script\scons +set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox :: Run the included copy of scons. -python -O -OO %BASE_SCRIPT% ^ +python -O -OO "%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\script\scons" ^ --warn no-visual-c-missing ^ --file=build.scons ^ ---site-dir="%~dp0..\build_tools\nacl_sdk_scons" %* +--site-dir="%NACL_PLATFORM_DIR%\build_tools\nacl_sdk_scons" %* :end diff --git a/native_client_sdk/src/libraries/scons b/native_client_sdk/src/libraries/scons index d4daf81..053e32d 100755 --- a/native_client_sdk/src/libraries/scons +++ b/native_client_sdk/src/libraries/scons @@ -6,7 +6,6 @@ readonly SCRIPT_DIR="$(dirname "$0")" readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)" -readonly SRC_DIR="$(dirname $(dirname $(dirname ${SCRIPT_DIR_ABS})))" # NACL_SDK_ROOT must be set. if [ x"${NACL_SDK_ROOT}"x == "xx" ] ; then @@ -25,23 +24,15 @@ if [ x"${NACL_TARGET_PLATFORM}"x == "xx" ] ; then fi readonly NACL_PLATFORM_DIR="${NACL_SDK_ROOT}/${NACL_TARGET_PLATFORM}" +readonly BASE_SCRIPT="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/script/scons" -SCONS_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1" - -if [ ! -f ${SCONS_DIR}/script/scons ]; then - SCONS_DIR="${SRC_DIR}/third_party/scons-2.0.1" -fi - -BASE_SCRIPT="${SCONS_DIR}/script/scons" - -export SCONS_LIB_DIR="${SCONS_DIR}/engine" -export PYTHONPATH="${SCONS_LIB_DIR}" -export PYTHONPATH="${PYTHONPATH}:${NACL_PLATFORM_DIR}/build_tools" - +export SCONS_LIB_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine" +export PYTHONPATH="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine:${NACL_PLATFORM_DIR}/build_tools" # We have to do this because scons overrides PYTHONPATH and does not preserve # what is provided by the OS. The custom variable name won't be overwritten. -export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox/src" +export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox" "${BASE_SCRIPT}" --file=build.scons \ - --site-dir="${SCRIPT_DIR_ABS}/../build_tools/nacl_sdk_scons" \ + --site-dir="${NACL_PLATFORM_DIR}/build_tools/nacl_sdk_scons" \ $* + diff --git a/native_client_sdk/src/libraries/scons.bat b/native_client_sdk/src/libraries/scons.bat index d3c6c06..889a757 100755 --- a/native_client_sdk/src/libraries/scons.bat +++ b/native_client_sdk/src/libraries/scons.bat @@ -27,24 +27,17 @@ if not defined NACL_TARGET_PLATFORM ( set NACL_PLATFORM_DIR=%NACL_SDK_ROOT%\%NACL_TARGET_PLATFORM% -set SCONS_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1 -if exist %SCONS_DIR% goto gotscons -set SCONS_DIR=%~dp0..\..\..\third_party\scons-2.0.1 -:gotscons - -set SCONS_LIB_DIR=%SCONS_DIR%\engine -set PYTHONPATH=%SCONS_LIB_DIR%;%NACL_PLATFORM_DIR%\build_tools +set SCONS_LIB_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine +set PYTHONPATH=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine;%NACL_PLATFORM_DIR%\build_tools :: We have to do this because scons overrides PYTHONPATH and does not preserve :: what is provided by the OS. The custom variable name won't be overwritten. -set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox\src - -set BASE_SCRIPT=%SCONS_DIR%\script\scons +set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox :: Run the included copy of scons. -python -O -OO %BASE_SCRIPT% ^ +python -O -OO "%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\script\scons" ^ --warn no-visual-c-missing ^ --file=build.scons ^ ---site-dir="%~dp0..\build_tools\nacl_sdk_scons" %* +--site-dir="%NACL_PLATFORM_DIR%\build_tools\nacl_sdk_scons" %* :end diff --git a/native_client_sdk/src/main.scons b/native_client_sdk/src/main.scons index d9eac4e..c83e448 100644 --- a/native_client_sdk/src/main.scons +++ b/native_client_sdk/src/main.scons @@ -101,7 +101,6 @@ base_env = Environment( build_utils.NormalizeToolchain(arch='x86', variant='glibc'), }, ROOT_DIR = os.path.abspath(os.getcwd()), - SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))), IS_WINDOWS = sys.platform in ['cygwin', 'win32'], IS_LINUX = sys.platform == 'linux2', IS_MAC = sys.platform == 'darwin', diff --git a/native_client_sdk/src/project_templates/scons b/native_client_sdk/src/project_templates/scons index d4daf81..2b7e0d3 100755 --- a/native_client_sdk/src/project_templates/scons +++ b/native_client_sdk/src/project_templates/scons @@ -4,44 +4,29 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. + readonly SCRIPT_DIR="$(dirname "$0")" readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)" -readonly SRC_DIR="$(dirname $(dirname $(dirname ${SCRIPT_DIR_ABS})))" - -# NACL_SDK_ROOT must be set. -if [ x"${NACL_SDK_ROOT}"x == "xx" ] ; then - echo "Error: NACL_SDK_ROOT is not set." - exit 1; -fi +export NACL_SDK_ROOT=<NACL_SDK_ROOT> # NACL_TARGET_PLATFORM is really the name of a folder with the base dir - # usually NACL_SDK_ROOT - within which the toolchain for the target platform # are found. # Replace the platform with the name of your target platform. For example, to # build applications that target the pepper_17 API, set # NACL_TARGET_PLATFORM="pepper_17" -if [ x"${NACL_TARGET_PLATFORM}"x == "xx" ] ; then - export NACL_TARGET_PLATFORM="pepper_17" -fi +export NACL_TARGET_PLATFORM="<NACL_PLATFORM>" readonly NACL_PLATFORM_DIR="${NACL_SDK_ROOT}/${NACL_TARGET_PLATFORM}" +readonly BASE_SCRIPT="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/script/scons" -SCONS_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1" - -if [ ! -f ${SCONS_DIR}/script/scons ]; then - SCONS_DIR="${SRC_DIR}/third_party/scons-2.0.1" -fi - -BASE_SCRIPT="${SCONS_DIR}/script/scons" - -export SCONS_LIB_DIR="${SCONS_DIR}/engine" -export PYTHONPATH="${SCONS_LIB_DIR}" -export PYTHONPATH="${PYTHONPATH}:${NACL_PLATFORM_DIR}/build_tools" - +export SCONS_LIB_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine" +export PYTHONPATH="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine" # We have to do this because scons overrides PYTHONPATH and does not preserve # what is provided by the OS. The custom variable name won't be overwritten. -export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox/src" +export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox" "${BASE_SCRIPT}" --file=build.scons \ - --site-dir="${SCRIPT_DIR_ABS}/../build_tools/nacl_sdk_scons" \ + --site-dir="${NACL_PLATFORM_DIR}/build_tools/nacl_sdk_scons" \ $* + diff --git a/native_client_sdk/src/project_templates/scons.bat b/native_client_sdk/src/project_templates/scons.bat index d3c6c06..f487e28 100755 --- a/native_client_sdk/src/project_templates/scons.bat +++ b/native_client_sdk/src/project_templates/scons.bat @@ -6,45 +6,26 @@ setlocal -:: NACL_SDK_ROOT must be set. -if not defined NACL_SDK_ROOT ( - echo Error: NACL_SDK_ROOT is not set. - echo Please set NACL_SDK_ROOT to the full path of the Native Client SDK. - echo For example: - echo set NACL_SDK_ROOT=D:\nacl_sdk - goto end -) - +set NACL_SDK_ROOT=<NACL_SDK_ROOT> :: NACL_TARGET_PLATFORM is really the name of a folder with the base dir - :: usually NACL_SDK_ROOT - within which the toolchain for the target platform :: are found. :: Replace the platform with the name of your target platform. For example, to :: build applications that target the pepper_17 API, set :: NACL_TARGET_PLATFORM=pepper_17 -if not defined NACL_TARGET_PLATFORM ( - set NACL_TARGET_PLATFORM=pepper_17 -) +set NACL_TARGET_PLATFORM=<NACL_PLATFORM> set NACL_PLATFORM_DIR=%NACL_SDK_ROOT%\%NACL_TARGET_PLATFORM% -set SCONS_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1 -if exist %SCONS_DIR% goto gotscons -set SCONS_DIR=%~dp0..\..\..\third_party\scons-2.0.1 -:gotscons - -set SCONS_LIB_DIR=%SCONS_DIR%\engine -set PYTHONPATH=%SCONS_LIB_DIR%;%NACL_PLATFORM_DIR%\build_tools +:: Set the PYTHONPATH and SCONS_LIB_DIR so we can import SCons modules +set SCONS_LIB_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine +set PYTHONPATH=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine :: We have to do this because scons overrides PYTHONPATH and does not preserve :: what is provided by the OS. The custom variable name won't be overwritten. -set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox\src - -set BASE_SCRIPT=%SCONS_DIR%\script\scons +set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox :: Run the included copy of scons. -python -O -OO %BASE_SCRIPT% ^ ---warn no-visual-c-missing ^ +python -O -OO "%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\script\scons" ^ --file=build.scons ^ ---site-dir="%~dp0..\build_tools\nacl_sdk_scons" %* - -:end +--site-dir="%NACL_PLATFORM_DIR%\build_tools\nacl_sdk_scons" %* diff --git a/native_client_sdk/src/scons b/native_client_sdk/src/scons index ff5918d..c14f666 100755 --- a/native_client_sdk/src/scons +++ b/native_client_sdk/src/scons @@ -7,7 +7,6 @@ readonly SCRIPT_DIR="$(dirname "$0")" readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)" -readonly SRC_DIR="$(dirname $(dirname ${SCRIPT_DIR_ABS}))" # Use the batch file as an entry point if on cygwin. if [ "x${OSTYPE}" = "xcygwin" ]; then @@ -24,15 +23,15 @@ if [ "x${OSTYPE}" = "xcygwin" ]; then exit fi -readonly BASE_SCRIPT="${SRC_DIR}/third_party/scons-2.0.1/script/scons" +readonly BASE_SCRIPT="${SCRIPT_DIR_ABS}/third_party/scons-2.0.1/script/scons" -export NACL_SDK_ROOT="${SCRIPT_DIR_ABS}/../../native_client" +export NACL_SDK_ROOT="${SCRIPT_DIR_ABS}" -export SCONS_LIB_DIR="${SRC_DIR}/third_party/scons-2.0.1/engine" -export PYTHONPATH="${SCONS_LIB_DIR}:${SRC_DIR}/native_client/build:${SCRIPT_DIR_ABS}" +export SCONS_LIB_DIR="${NACL_SDK_ROOT}/third_party/scons-2.0.1/engine" +export PYTHONPATH="${SCRIPT_DIR_ABS}/third_party/scons-2.0.1/engine:${SCRIPT_DIR_ABS}/third_party/native_client/native_client/build" # We have to do this because scons overrides PYTHONPATH and does not preserve # what is provided by the OS. The custom variable name won't be overwritten. -export PYMOX="${SRC_DIR}/third_party/pymox/src" +export PYMOX="${NACL_SDK_ROOT}/third_party/pymox" "${BASE_SCRIPT}" --file=main.scons $* diff --git a/native_client_sdk/src/scons.bat b/native_client_sdk/src/scons.bat index 7407b68..0a6d3db 100755 --- a/native_client_sdk/src/scons.bat +++ b/native_client_sdk/src/scons.bat @@ -6,23 +6,23 @@ setlocal
-set NACL_SDK_ROOT=%~dp0..\..\native_client
+set NACL_SDK_ROOT=%~dp0
:: Preserve a copy of the PATH (in case we need it later, mainly for cygwin).
set PRESCONS_PATH=%PATH%
:: Set the PYTHONPATH and SCONS_LIB_DIR so we can import SCons modules
-set SCONS_LIB_DIR=%~dp0..\..\third_party\scons-2.0.1\engine
-set PYTHONPATH=%~dp0..\..\third_party\scons-2.0.1\engine;%~dp0..\..\native_client\build;%~dp0
+set SCONS_LIB_DIR=%~dp0third_party\scons-2.0.1\engine
+set PYTHONPATH=%~dp0third_party\scons-2.0.1\engine;%~dp0third_party\native_client\native_client\build
:: We have to do this because scons overrides PYTHONPATH and does not preserve
:: what is provided by the OS. The custom variable name won't be overwritten.
-set PYMOX=%~dp0..\..\third_party\pymox\src
+set PYMOX=%~dp0third_party\pymox
:: Stop incessant CYGWIN complains about "MS-DOS style path"
set CYGWIN=nodosfilewarning %CYGWIN%
:: Run the included copy of scons.
-python -O -OO "%~dp0..\..\third_party\scons-2.0.1\script\scons" --file=main.scons %*
+python -O -OO "%~dp0third_party\scons-2.0.1\script\scons" --file=main.scons %*
:end
|