]> git.lizzy.rs Git - rust.git/commitdiff
Fix snapshot.py for win64
authorBrian Anderson <banderson@mozilla.com>
Mon, 8 Sep 2014 23:38:05 +0000 (16:38 -0700)
committerBrian Anderson <banderson@mozilla.com>
Tue, 9 Sep 2014 20:29:55 +0000 (13:29 -0700)
mk/dist.mk
src/etc/copy-runtime-deps.py
src/etc/snapshot.py

index 99fad94bf76ab95911b8581cf07f41e1be1b0662..a203dd8b63991e1104884585358f082df78508ef 100644 (file)
@@ -123,7 +123,7 @@ PKG_EXE = dist/$(PKG_NAME)-install.exe
 $(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
             $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
             dist-prepare-win
-       $(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin
+       $(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin $(CFG_BUILD)
        @$(call E, ISCC: $@)
        $(Q)"$(CFG_ISCC)" $<
 
index 8aab3f18bdad016c0734809cb4bee4d5873dbe8f..fd829cd0ab70f93227099db1396e8c8975a8a935 100644 (file)
@@ -12,8 +12,8 @@
 
 import snapshot, sys, os, shutil
 
-def copy_runtime_deps(dest_dir):
-    for path in snapshot.get_winnt_runtime_deps():
+def copy_runtime_deps(dest_dir, triple):
+    for path in snapshot.get_winnt_runtime_deps(snapshot.get_platform(triple)):
         shutil.copy(path, dest_dir)
 
     lic_dest = os.path.join(dest_dir, "third-party")
@@ -21,4 +21,4 @@ def copy_runtime_deps(dest_dir):
         shutil.rmtree(lic_dest) # copytree() won't overwrite existing files
     shutil.copytree(os.path.join(os.path.dirname(__file__), "third-party"), lic_dest)
 
-copy_runtime_deps(sys.argv[1])
+copy_runtime_deps(sys.argv[1], sys.argv[2])
index 82302da17b85082d016f23dbd13700d5ff160a11..24255c0cc5df2c706d3a935f0aceda06d83b9159 100644 (file)
@@ -39,8 +39,10 @@ snapshot_files = {
     "freebsd": ["bin/rustc"],
     }
 
-winnt_runtime_deps = ["libgcc_s_dw2-1.dll",
-                      "libstdc++-6.dll"]
+winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll",
+                         "libstdc++-6.dll"]
+winnt_runtime_deps_64 = ["libgcc_s_seh-1.dll",
+                         "libstdc++-6.dll"]
 
 def parse_line(n, line):
   global snapshotfile
@@ -146,10 +148,14 @@ def hash_file(x):
     return scrub(h.hexdigest())
 
 # Returns a list of paths of Rust's system runtime dependencies
-def get_winnt_runtime_deps():
+def get_winnt_runtime_deps(platform):
+    if platform == "winnt-x86_64":
+      deps = winnt_runtime_deps_64
+    else:
+      deps = winnt_runtime_deps_32
     runtime_deps = []
-    path_dirs = os.environ["PATH"].split(';')
-    for name in winnt_runtime_deps:
+    path_dirs = os.environ["PATH"].split(os.pathsep)
+    for name in deps:
       for dir in path_dirs:
         matches = glob.glob(os.path.join(dir, name))
         if matches:
@@ -189,7 +195,7 @@ def make_snapshot(stage, triple):
                         "Please make a clean build." % "\n  ".join(matches))
 
     if kernel=="winnt":
-      for path in get_winnt_runtime_deps():
+      for path in get_winnt_runtime_deps(platform):
         tar.add(path, "rust-stage0/bin/" + os.path.basename(path))
       tar.add(os.path.join(os.path.dirname(__file__), "third-party"),
               "rust-stage0/bin/third-party")