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

Unified Diff: chrome/build_nacl_irt.py

Issue 7685042: Switching IRT to be built inside the chrome build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | « build/download_nacl_irt.py ('k') | chrome/nacl.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/build_nacl_irt.py
===================================================================
--- chrome/build_nacl_irt.py (revision 97773)
+++ chrome/build_nacl_irt.py (working copy)
@@ -79,11 +79,16 @@
filename = GPU_CMD_BUFFER_DIR + filename[len(NACL_CMD_BUFFER_DIR):]
inputs.add(filename)
# Check that everything exists and make it script relative.
+ # Exclude things above SRC_DIR.
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)
+ # If the relative path from SRC_DIR to the file starts with ../ ignore it.
+ # (i.e. the file is outside the client).
+ if RelativePath(nf, SRC_DIR).startswith('..' + os.sep):
+ continue
rel_inputs.add(RelativePath(nf, SCRIPT_DIR))
# Print it sorted.
rel_inputs = sorted(list(rel_inputs))
@@ -98,6 +103,8 @@
platforms: list of platform names to build for.
out_dir: directory to output the IRT to.
"""
+ # Make out_dir absolute.
+ out_dir = os.path.abspath(out_dir)
# Clean.
scons_out = os.path.join(NACL_DIR, 'scons-out')
if os.path.exists(scons_out):
@@ -110,7 +117,22 @@
'scons-out/nacl_irt-' + platform + '/staging/irt.nexe',
]
print 'Running: ' + ' '.join(cmd)
- p = subprocess.Popen(cmd, cwd=NACL_DIR)
+ # Work around the fact that python's readline module (used by scons),
+ # attempts to alter file handle state on stdin in a way that blocks if
+ # a process is not a member of a foreground job on a tty on OSX.
+ # e.g. On a Mac:
+ #
+ # hydric:test mseaborn$ python -c 'import readline' &
+ # [1] 67058
+ # hydric:test mseaborn$
+ # [1]+ Stopped python -c 'import readline'
+ #
+ # i.e. the process receives a stop signal when it's a background job.
+ if sys.platform == 'darwin':
+ devnull = open(os.devnull, 'r')
+ else:
+ devnull = None
+ p = subprocess.Popen(cmd, cwd=NACL_DIR, stdin=devnull)
p.wait()
if p.returncode != 0:
sys.exit(3)
Property changes on: chrome/build_nacl_irt.py
___________________________________________________________________
Added: svn:executable
+ *
« no previous file with comments | « build/download_nacl_irt.py ('k') | chrome/nacl.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698