Skip to content

Commit 4049a4d

Browse files
committed
auto merge of #17109 : brson/rust/win64snap, r=alexcrichton
2 parents 8eee1b4 + 3ebf25e commit 4049a4d

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

Diff for: mk/dist.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ PKG_EXE = dist/$(PKG_NAME)-install.exe
123123
$(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
124124
$(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
125125
dist-prepare-win
126-
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin
126+
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin $(CFG_BUILD)
127127
@$(call E, ISCC: $@)
128128
$(Q)"$(CFG_ISCC)" $<
129129

Diff for: src/etc/copy-runtime-deps.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
import snapshot, sys, os, shutil
1414

15-
def copy_runtime_deps(dest_dir):
16-
for path in snapshot.get_winnt_runtime_deps():
15+
def copy_runtime_deps(dest_dir, triple):
16+
for path in snapshot.get_winnt_runtime_deps(snapshot.get_platform(triple)):
1717
shutil.copy(path, dest_dir)
1818

1919
lic_dest = os.path.join(dest_dir, "third-party")
2020
if os.path.exists(lic_dest):
2121
shutil.rmtree(lic_dest) # copytree() won't overwrite existing files
2222
shutil.copytree(os.path.join(os.path.dirname(__file__), "third-party"), lic_dest)
2323

24-
copy_runtime_deps(sys.argv[1])
24+
copy_runtime_deps(sys.argv[1], sys.argv[2])

Diff for: src/etc/snapshot.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ def scrub(b):
3939
"freebsd": ["bin/rustc"],
4040
}
4141

42-
winnt_runtime_deps = ["libgcc_s_dw2-1.dll",
43-
"libstdc++-6.dll"]
42+
winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll",
43+
"libstdc++-6.dll"]
44+
winnt_runtime_deps_64 = ["libgcc_s_seh-1.dll",
45+
"libstdc++-6.dll"]
4446

4547
def parse_line(n, line):
4648
global snapshotfile
@@ -146,10 +148,14 @@ def hash_file(x):
146148
return scrub(h.hexdigest())
147149

148150
# Returns a list of paths of Rust's system runtime dependencies
149-
def get_winnt_runtime_deps():
151+
def get_winnt_runtime_deps(platform):
152+
if platform == "winnt-x86_64":
153+
deps = winnt_runtime_deps_64
154+
else:
155+
deps = winnt_runtime_deps_32
150156
runtime_deps = []
151-
path_dirs = os.environ["PATH"].split(';')
152-
for name in winnt_runtime_deps:
157+
path_dirs = os.environ["PATH"].split(os.pathsep)
158+
for name in deps:
153159
for dir in path_dirs:
154160
matches = glob.glob(os.path.join(dir, name))
155161
if matches:
@@ -189,7 +195,7 @@ def in_tar_name(fn):
189195
"Please make a clean build." % "\n ".join(matches))
190196

191197
if kernel=="winnt":
192-
for path in get_winnt_runtime_deps():
198+
for path in get_winnt_runtime_deps(platform):
193199
tar.add(path, "rust-stage0/bin/" + os.path.basename(path))
194200
tar.add(os.path.join(os.path.dirname(__file__), "third-party"),
195201
"rust-stage0/bin/third-party")

0 commit comments

Comments
 (0)