Reviewers: ulan,
Description:
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
Please review this at https://codereview.chromium.org/122183004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+3, -11 lines):
M build/gyp_v8
Index: build/gyp_v8
diff --git a/build/gyp_v8 b/build/gyp_v8
index
40c377de61581239d6f0d208171553c54fe6b54d..7874d1444eb639bf7f2ff417ef1e76cfee7ca95c
100755
--- a/build/gyp_v8
+++ b/build/gyp_v8
@@ -36,13 +36,8 @@ import platform
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 @@ if __name__ == '__main__':
# 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.