From 64bcc326fb98a7ae8249cc50b6305166e8f3ac89 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 17:49:41 -0800 Subject: [PATCH 01/11] Improve format of output error messages --- toolsrc/src/vcpkg_Environment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index aaa6bb106..b6705cc47 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -155,7 +155,7 @@ namespace vcpkg::Environment System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { - System::println(path.generic_string()); + System::println(" %s", path.generic_string()); } exit(EXIT_FAILURE); } @@ -194,7 +194,7 @@ namespace vcpkg::Environment System::println("The following paths were examined:"); for (const fs::path& path : paths_examined) { - System::println(path.generic_string()); + System::println(" %s",path.generic_string()); } exit(EXIT_FAILURE); } From 2670075bf202529aa23b6c278b589e3c0541076e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:36:22 -0800 Subject: [PATCH 02/11] Extract method --- toolsrc/src/vcpkg_Environment.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index b6705cc47..76aa07fb6 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -46,6 +46,13 @@ namespace vcpkg::Environment } } + static std::wstring create_default_install_cmd(const vcpkg_paths& paths, const std::wstring& tool_name) + { + const fs::path script = paths.scripts / "fetchDependency.ps1"; + // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned + return Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency %s", script.native(), tool_name); + } + void ensure_git_on_path(const vcpkg_paths& paths) { const fs::path downloaded_git = paths.downloads / "PortableGit" / "cmd"; @@ -58,9 +65,7 @@ namespace vcpkg::Environment static constexpr std::array git_version = {2,0,0}; static const std::wstring version_check_cmd = L"git --version 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency git", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"git"); ensure_on_path(git_version, version_check_cmd, install_cmd); } @@ -76,9 +81,7 @@ namespace vcpkg::Environment static constexpr std::array cmake_version = {3,7,2}; static const std::wstring version_check_cmd = L"cmake --version 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency cmake", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"cmake"); ensure_on_path(cmake_version, version_check_cmd, install_cmd); } @@ -89,9 +92,7 @@ namespace vcpkg::Environment static constexpr std::array nuget_version = {1,0,0}; static const std::wstring version_check_cmd = L"nuget 2>&1"; - const fs::path script = paths.scripts / "fetchDependency.ps1"; - // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned - const std::wstring install_cmd = Strings::wformat(L"powershell -ExecutionPolicy Bypass %s -Dependency nuget", script.native()); + const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); ensure_on_path(nuget_version, version_check_cmd, install_cmd); } From 868a7623addee16f19b17718163b7719c4d739e2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:42:34 -0800 Subject: [PATCH 03/11] Bump nuget.exe version --- scripts/fetchDependency.ps1 | 8 ++++---- toolsrc/src/vcpkg_Environment.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 7e8e1d32c..eedfb15d1 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -130,11 +130,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "nuget") { - $requiredVersion = "1.0.0" - $downloadVersion = "3.4.3" - $url = "https://dist.nuget.org/win-x86-commandline/v3.4.3/nuget.exe" + $requiredVersion = "3.3.0" + $downloadVersion = "3.5.0" + $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" $downloadName = "nuget.exe" - $expectedDownloadedFileHash = "3B1EA72943968D7AF6BACDB4F2F3A048A25AFD14564EF1D8B1C041FDB09EBB0A" + $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" $executableFromDownload = "$downloadsDir\nuget.exe" $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 76aa07fb6..1a50a604a 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -90,7 +90,7 @@ namespace vcpkg::Environment const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); - static constexpr std::array nuget_version = {1,0,0}; + static constexpr std::array nuget_version = {3,3,0}; static const std::wstring version_check_cmd = L"nuget 2>&1"; const std::wstring install_cmd = create_default_install_cmd(paths, L"nuget"); ensure_on_path(nuget_version, version_check_cmd, install_cmd); From 7c9db95feccf6e9d01d2e1af6c7012685d8e46b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 18:47:38 -0800 Subject: [PATCH 04/11] Bump downloaded git version --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index eedfb15d1..e1ef184ab 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -141,10 +141,10 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) elseif($Dependency -eq "git") { $requiredVersion = "2.0.0" - $downloadVersion = "2.8.3" - $url = "https://github.com/git-for-windows/git/releases/download/v2.8.3.windows.1/PortableGit-2.8.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadName = "PortableGit-2.8.3-32-bit.7z.exe" - $expectedDownloadedFileHash = "DE52D070219E9C4EC1DB179F2ADBF4B760686C3180608F0382A1F8C7031E72AD" + $downloadVersion = "2.11.0" + $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version + $downloadName = "PortableGit-2.11.0.3-32-bit.7z.exe" + $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. $executableFromDownload = "$downloadsDir\PortableGit\cmd\git.exe" From 93c3c0648a782b1fa75bae1f200beca6ba871f9a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 19:25:47 -0800 Subject: [PATCH 05/11] [VS2017] Enable building with v141 toolset --- scripts/cmake/vcpkg_configure_cmake.cmake | 27 +++++++++++++++++------ toolsrc/include/vcpkg_Environment.h | 8 ++++++- toolsrc/src/commands_build.cpp | 7 +++--- toolsrc/src/vcpkg_Environment.cpp | 10 ++++----- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 179703172..128782075 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -4,20 +4,33 @@ function(vcpkg_configure_cmake) if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") # elseif(NOT vcpkg_configure_cmake_NINJA MATCHES "NOTFOUND") # set(GENERATOR "Ninja") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") - set(GENERATOR "Visual Studio 14 2015 ARM") + set(GENERATOR "Visual Studio 14 2015 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 Win64") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 ARM") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017 Win64") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm") + set(GENERATOR "Visual Studio 15 2017 ARM" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) @@ -33,7 +46,7 @@ function(vcpkg_configure_cmake) elseif(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL static) list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF) endif() - + list(APPEND _csc_OPTIONS "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 9161f7ce5..e4dd47472 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -17,5 +17,11 @@ namespace vcpkg::Environment const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); - const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths); + struct vcvarsall_and_platform_toolset + { + fs::path path; + std::wstring platform_toolset; + }; + + const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths); } diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index af1b3dc24..d9d5d2107 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -30,12 +30,13 @@ namespace vcpkg::Commands::Build const triplet& target_triplet = spec.target_triplet(); const fs::path ports_cmake_script_path = paths.ports_cmake; - const fs::path vcvarsall_bat = Environment::get_vcvarsall_bat(paths); - const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", - vcvarsall_bat.native(), + const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); + const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + vcvarsall_bat.path.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name), Strings::utf8_to_utf16(target_triplet.canonical_name()), + vcvarsall_bat.platform_toolset, port_dir.generic_wstring(), ports_cmake_script_path.generic_wstring()); diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index 1a50a604a..c204bfaf4 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -167,7 +167,7 @@ namespace vcpkg::Environment return dumpbin_exe; } - static fs::path find_vcvarsall_bat(const vcpkg_paths& paths) + static vcvarsall_and_platform_toolset find_vcvarsall_bat(const vcpkg_paths& paths) { const std::vector vs2017_installation_instances = get_VS2017_installation_instances(paths); std::vector paths_examined; @@ -179,7 +179,7 @@ namespace vcpkg::Environment paths_examined.push_back(vcvarsall_bat); if (fs::exists(vcvarsall_bat)) { - return vcvarsall_bat; + return { vcvarsall_bat , L"v141"}; } } @@ -188,7 +188,7 @@ namespace vcpkg::Environment paths_examined.push_back(vs2015_vcvarsall_bat); if (fs::exists(vs2015_vcvarsall_bat)) { - return vs2015_vcvarsall_bat; + return { vs2015_vcvarsall_bat, L"v140" }; } System::println(System::color::error, "Could not detect vccarsall.bat."); @@ -200,9 +200,9 @@ namespace vcpkg::Environment exit(EXIT_FAILURE); } - const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths) + const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths) { - static const fs::path vcvarsall_bat = find_vcvarsall_bat(paths); + static const vcvarsall_and_platform_toolset vcvarsall_bat = find_vcvarsall_bat(paths); return vcvarsall_bat; } } From ab33a7fd49904b5a4ff25af6f87d32ddf15fcd6c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 19:56:07 -0800 Subject: [PATCH 06/11] Update CHANGELOG and bump version to v0.0.70 --- CHANGELOG.md | 21 +++++++++++++++++++++ toolsrc/VERSION.txt | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 103417bad..3380cd074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +vcpkg (0.0.70) +-------------- + * Add ports: + - fltk 1.3.4-1 + - glib 2.50.2 + - lzo 2.09 + - uvatlas sept2016 + * Update ports: + - dx 1.0.0 -> 1.0.1 + - libmysql 5.7.16 -> 5.7.17 + * Add support for Visual Studio 2017 + - Previously, you could use Visual Studio 2017 for your own application and `vcpkg` integration would work, but you needed to have Visual Studio 2015 to build `vcpkg` itself as well as the libraries. This requirement has now been removed + - If both Visual Studio 2015 and Visual Studio 2017 are installed, Visual Studio 2017 tools will be preferred over those of Visual Studio 2015 + * Bump required version & auto-downloaded version of `cmake` to 3.7.2 (was 3.5.x), which includes generators for Visual Studio 2017 + * Bump auto-downloaded version of `nuget` to 3.5.0 (was 3.4.3) + * Bump auto-downloaded version of `git` to 2.11.0 (was 2.8.3) + * Fixes and improvements in existing portfiles and the `vcpkg` tool itself + +-- vcpkg team MON, 23 Jan 2017 19:50:00 -0800 + + vcpkg (0.0.67) -------------- * Add ports: diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 8afb66b09..1759b863b 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.67" \ No newline at end of file +"0.0.70" \ No newline at end of file From ccda20a8584a9fcc89c4dd631e5ef8d4189f1131 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:01:11 -0800 Subject: [PATCH 07/11] Remove $downloadName variable --- scripts/fetchDependency.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index e1ef184ab..9269dba8c 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -123,7 +123,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.7.2" $downloadVersion = "3.7.2" $url = "https://cmake.org/files/v3.7/cmake-3.7.2-win32-x86.zip" - $downloadName = "cmake-3.7.2-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.7.2-win32-x86.zip" $expectedDownloadedFileHash = "ec5e299d412e0272e01d4de5bf07718f42c96361f83d51cc39f91bf49cc3e5c3" $executableFromDownload = "$downloadsDir\cmake-3.7.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP @@ -133,7 +133,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.3.0" $downloadVersion = "3.5.0" $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" - $downloadName = "nuget.exe" + $downloadPath = "$downloadsDir\nuget.exe" $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" $executableFromDownload = "$downloadsDir\nuget.exe" $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED @@ -143,7 +143,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "2.0.0" $downloadVersion = "2.11.0" $url = "https://github.com/git-for-windows/git/releases/download/v2.11.0.windows.3/PortableGit-2.11.0.3-32-bit.7z.exe" # We choose the 32-bit version - $downloadName = "PortableGit-2.11.0.3-32-bit.7z.exe" + $downloadPath = "$downloadsDir\PortableGit-2.11.0.3-32-bit.7z.exe" $expectedDownloadedFileHash = "8bf3769c37945e991903dd1b988c6b1d97bbf0f3afc9851508974f38bf94dc01" # There is another copy of git.exe in PortableGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. @@ -155,7 +155,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } - $downloadPath = "$downloadsDir\$downloadName" performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash From d5e7a501e907f06ad1e8bb4ffdebce9a29179d2d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:30:14 -0800 Subject: [PATCH 08/11] Download nuget.exe in a version-including subfolder in Downloads\ --- scripts/fetchDependency.ps1 | 10 ++++++++-- toolsrc/src/vcpkg_Environment.cpp | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 9269dba8c..d05d16bea 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -133,9 +133,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "3.3.0" $downloadVersion = "3.5.0" $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" - $downloadPath = "$downloadsDir\nuget.exe" + $downloadPath = "$downloadsDir\nuget-3.5.0\nuget.exe" $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" - $executableFromDownload = "$downloadsDir\nuget.exe" + $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } elseif($Dependency -eq "git") @@ -155,6 +155,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } + $downloadSubdir = Split-path $downloadPath -Parent + if (!(Test-Path $downloadSubdir)) + { + New-Item -ItemType Directory -Path $downloadSubdir | Out-Null + } + performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp index c204bfaf4..66d33edeb 100644 --- a/toolsrc/src/vcpkg_Environment.cpp +++ b/toolsrc/src/vcpkg_Environment.cpp @@ -87,7 +87,8 @@ namespace vcpkg::Environment void ensure_nuget_on_path(const vcpkg_paths& paths) { - const std::wstring path_buf = Strings::wformat(L"%s;%s", paths.downloads.native(), System::wdupenv_str(L"PATH")); + const fs::path downloaded_nuget = paths.downloads / "nuget-3.5.0"; + const std::wstring path_buf = Strings::wformat(L"%s;%s", downloaded_nuget.native(), System::wdupenv_str(L"PATH")); _wputenv_s(L"PATH", path_buf.c_str()); static constexpr std::array nuget_version = {3,3,0}; From d96f56736e9696248584506f364ee31acf12ddc3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:32:03 -0800 Subject: [PATCH 09/11] Fix path to nuget.exe --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 1cb78fa9e..241b05bc1 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -11,7 +11,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" & $scriptsDir\fetchDependency.ps1 "nuget" -$nugetexe = "$downloadsDir\nuget.exe" +$nugetexe = "$downloadsDir\nuget-3.5.0\nuget.exe" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" From f2ac7a32aaf9e0f374cf3025f6f86561780951eb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 12:36:46 -0800 Subject: [PATCH 10/11] FetchDependency.ps1 now returns the downloaded exe's path --- scripts/fetchDependency.ps1 | 2 ++ scripts/findVisualStudioInstallationInstances.ps1 | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index d05d16bea..b56bf1087 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -202,6 +202,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { throw [System.IO.FileNotFoundException] ("Could not detect or download " + $Dependency) } + + return $downloadPath } SelectProgram $Dependency \ No newline at end of file diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 241b05bc1..d5faa57d3 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -10,8 +10,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -& $scriptsDir\fetchDependency.ps1 "nuget" -$nugetexe = "$downloadsDir\nuget-3.5.0\nuget.exe" +$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" From e3c3497dbc03607492f38e54122106bc8f00ca20 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Jan 2017 14:12:27 -0800 Subject: [PATCH 11/11] Suppress VS2017's vcvarsall.bat output --- toolsrc/src/commands_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index d9d5d2107..e7e005100 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -31,7 +31,7 @@ namespace vcpkg::Commands::Build const fs::path ports_cmake_script_path = paths.ports_cmake; const Environment::vcvarsall_and_platform_toolset vcvarsall_bat = Environment::get_vcvarsall_bat(paths); - const std::wstring command = Strings::wformat(LR"("%s" %s && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", + const std::wstring command = Strings::wformat(LR"("%s" %s >nul 2>&1 && cmake -DCMD=BUILD -DPORT=%s -DTARGET_TRIPLET=%s -DVCPKG_PLATFORM_TOOLSET=%s "-DCURRENT_PORT_DIR=%s/." -P "%s")", vcvarsall_bat.path.native(), Strings::utf8_to_utf16(target_triplet.architecture()), Strings::utf8_to_utf16(source_paragraph.name),