Revision: 18439
Author:   [email protected]
Date:     Thu Jan  2 13:50:50 2014 UTC
Log:      Don't modify the PWD in gyp_v8

When running gyp in parallel mode (soon the default), we need to be able
to find the script by looking at the path relative to the PWD when the
script was originally invoked.

Instead of changing the directory and relying on relative paths, just
use absolute paths (as gyp_chromium does).

BUG=v8:2973
[email protected]
LOG=n

Review URL: https://codereview.chromium.org/122183004
http://code.google.com/p/v8/source/detail?r=18439

Modified:
 /branches/bleeding_edge/build/gyp_v8

=======================================
--- /branches/bleeding_edge/build/gyp_v8        Thu Dec  5 11:19:10 2013 UTC
+++ /branches/bleeding_edge/build/gyp_v8        Thu Jan  2 13:50:50 2014 UTC
@@ -36,13 +36,8 @@
 import shlex
 import sys

-script_dir = os.path.dirname(__file__)
-v8_root = os.path.normpath(os.path.join(script_dir, os.pardir))
-
-if __name__ == '__main__':
-  os.chdir(v8_root)
-  script_dir = os.path.dirname(__file__)
-  v8_root = '.'
+script_dir = os.path.dirname(os.path.realpath(__file__))
+v8_root = os.path.abspath(os.path.join(script_dir, os.pardir))

 sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib'))
 import gyp
@@ -142,10 +137,7 @@
       # path separators even on Windows due to the use of shlex.split().
       args.extend(shlex.split(gyp_file))
     else:
-      # Note that this must not start with "./" or things break.
-      # So we rely on having done os.chdir(v8_root) above and use the
-      # relative path.
-      args.append(os.path.join('build', 'all.gyp'))
+      args.append(os.path.join(script_dir, 'all.gyp'))

   args.extend(['-I' + i for i in additional_include_files(args)])

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to