Index: native_client_sdk/src/build_tools/buildbot_run.py |
diff --git a/native_client_sdk/src/build_tools/buildbot_run.py b/native_client_sdk/src/build_tools/buildbot_run.py |
index f5e4ba585dcf659a4db25364e505addc8b14770f..c74308e7247f39aabf94f3bc430a56f7a243e5aa 100755 |
--- a/native_client_sdk/src/build_tools/buildbot_run.py |
+++ b/native_client_sdk/src/build_tools/buildbot_run.py |
@@ -14,9 +14,12 @@ run. |
import buildbot_common |
import os |
+import subprocess |
import sys |
+ |
from buildbot_common import Run |
-from build_paths import SDK_SRC_DIR, SCRIPT_DIR |
+from build_paths import SRC_DIR, SDK_SRC_DIR, SCRIPT_DIR |
+import getos |
def StepRunUnittests(): |
@@ -33,7 +36,25 @@ def StepRunUnittests(): |
def StepBuildSDK(args): |
- Run([sys.executable, 'build_sdk.py'] + args, cwd=SCRIPT_DIR) |
+ is_win = getos.GetPlatform() == 'win' |
+ |
+ # Windows has a path length limit of 255 characters, after joining cwd with a |
+ # relative path. Use subst before building to keep the path lengths short. |
+ if is_win: |
+ subst_drive = 'S:' |
+ root_dir = os.path.dirname(SRC_DIR) |
+ new_root_dir = subst_drive + '\\' |
+ subprocess.check_call(['subst', subst_drive, root_dir]) |
+ new_script_dir = os.path.join(new_root_dir, |
+ os.path.relpath(SCRIPT_DIR, root_dir)) |
+ else: |
+ new_script_dir = SCRIPT_DIR |
+ |
+ try: |
+ Run([sys.executable, 'build_sdk.py'] + args, cwd=new_script_dir) |
+ finally: |
+ if is_win: |
+ subprocess.check_call(['subst', '/D', subst_drive]) |
def StepTestSDK(): |