Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix naming of windows installer #17135

Merged
merged 2 commits into from
Sep 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ distcheck-tar-src: dist-tar-src

ifdef CFG_ISCC

PKG_EXE = dist/$(PKG_NAME)-install.exe
PKG_EXE = dist/$(PKG_NAME)-$(CFG_BUILD).exe

%.iss: $(S)src/etc/pkg/%.iss
cp $< $@
Expand All @@ -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)" $<

Expand Down
6 changes: 3 additions & 3 deletions src/etc/copy-runtime-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

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")
if os.path.exists(lic_dest):
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])
3 changes: 2 additions & 1 deletion src/etc/pkg/rust.iss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define CFG_VERSION_WIN GetEnv("CFG_VERSION_WIN")
#define CFG_RELEASE GetEnv("CFG_RELEASE")
#define CFG_PACKAGE_NAME GetEnv("CFG_PACKAGE_NAME")
#define CFG_BUILD GetEnv("CFG_BUILD")

[Setup]

Expand All @@ -20,7 +21,7 @@ DisableStartupPrompt=true

OutputDir=.\dist\
SourceDir=.\
OutputBaseFilename={#CFG_PACKAGE_NAME}-install
OutputBaseFilename={#CFG_PACKAGE_NAME}-{#CFG_BUILD}
DefaultDirName={pf32}\Rust

Compression=lzma2/ultra
Expand Down
18 changes: 12 additions & 6 deletions src/etc/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ def scrub(b):
"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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -189,7 +195,7 @@ def in_tar_name(fn):
"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")
Expand Down