Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2725)

Unified Diff: build_apprtc_appengine_app.py

Issue 1305013003: Work around problem with corrupt npm cache on Mac. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/webrtc/webrtc.DEPS
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build_apprtc_appengine_app.py
diff --git a/build_apprtc_appengine_app.py b/build_apprtc_appengine_app.py
index c1f91b2035a7a603024d7b6dabe361799ded88b6..9d15b7557afed2b10a12461237269280b6f52f6e 100755
--- a/build_apprtc_appengine_app.py
+++ b/build_apprtc_appengine_app.py
@@ -12,6 +12,7 @@ the node toolchain we downloaded earlier.
import fileinput
import os
import shutil
+import subprocess
import sys
import utils
@@ -30,6 +31,14 @@ def _WorkaroundPhantomJsOnWin(samples_path):
sys.stdout.write(line)
+def _WorkAroundMacNpmCorruptedDataOnInstall(command):
+ print 'Wiping .npm folder and trying again...'
+ npm_storage = os.path.expanduser('~/.npm')
+ assert npm_storage.endswith('.npm')
+ shutil.rmtree(npm_storage, ignore_errors=True)
+ utils.RunSubprocessWithRetry(command)
+
+
def main():
node_path = os.path.abspath('node')
if not os.path.exists(node_path):
@@ -48,7 +57,14 @@ def main():
npm_bin = os.path.join(node_path, 'bin', 'npm')
node_bin = os.path.join(node_path, 'bin', 'node')
- utils.RunSubprocessWithRetry([npm_bin, 'install'])
+ command = [npm_bin, 'install']
+ try:
+ utils.RunSubprocessWithRetry(command)
+ except subprocess.CalledProcessError:
+ if utils.GetPlatform() is not 'mac':
+ raise
+ _WorkAroundMacNpmCorruptedDataOnInstall(command)
+
local_grunt_bin = os.path.join('node_modules', 'grunt-cli', 'bin', 'grunt')
if not os.path.exists(local_grunt_bin):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698