Fix overwriting install_dir variable

This commit is contained in:
doylet 2023-08-12 12:53:22 +10:00
parent e9088a9650
commit 18e35fe11d

View File

@ -147,22 +147,22 @@ if args.with_dev_apps:
devenver.lprint(line) devenver.lprint(line)
devenver.lprint(f"Command: {command}") devenver.lprint(f"Command: {command}")
subprocess.run(command, cwd=temp_dir) run_result = subprocess.run(command, cwd=temp_dir, check=True)
# Merge the download MSVC installation to our unified install dir # Merge the download MSVC installation to our unified install dir
temp_msvc_dir = pathlib.Path(temp_dir, "msvc") temp_msvc_dir = pathlib.Path(temp_dir, "msvc")
for src_dir, dirs, files in os.walk(temp_msvc_dir): for src_dir, dirs, files in os.walk(temp_msvc_dir):
install_dir = src_dir.replace(str(temp_msvc_dir), str(msvc_install_dir), 1) msvc_working_dir = src_dir.replace(str(temp_msvc_dir), str(msvc_install_dir), 1)
if not os.path.exists(install_dir): if not os.path.exists(msvc_working_dir):
os.makedirs(install_dir) os.makedirs(msvc_working_dir)
for file_ in files: for file_ in files:
src = os.path.join(src_dir, file_) src = os.path.join(src_dir, file_)
dest = os.path.join(install_dir, file_) dest = os.path.join(msvc_working_dir, file_)
if os.path.exists(dest): if os.path.exists(dest):
if os.path.samefile(src, dest): if os.path.samefile(src, dest):
continue continue
os.remove(dest) os.remove(dest)
shutil.move(src, install_dir) shutil.move(src, msvc_working_dir)
devenver.lprint(f"MSVC {msvc_version} Windows 10 SDK {win10_sdk_version} installed: {msvc_install_dir}") devenver.lprint(f"MSVC {msvc_version} Windows 10 SDK {win10_sdk_version} installed: {msvc_install_dir}")
@ -194,12 +194,12 @@ if args.with_dev_apps:
# Odin # Odin
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
odin_git_hash = "9ae1bfb6" # odin_git_hash = "9ae1bfb6"
odin_install_dir = pathlib.Path(install_dir) / "Odin" # odin_install_dir = install_dir / "Odin"
git_clone(install_dir=odin_install_dir, # git_clone(install_dir=odin_install_dir,
git_exe=git_exe, # git_exe=git_exe,
url="https://github.com/odin-lang/odin.git", # url="https://github.com/odin-lang/odin.git",
commit_hash=odin_git_hash) # commit_hash=odin_git_hash)
# TODO: We can't do this yet because the odin build requires a registry hack so # TODO: We can't do this yet because the odin build requires a registry hack so
# that it knows where to find MSVC. # that it knows where to find MSVC.