From 9ee6208e02128f0d22859ffe91cb29ac49a13f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Wed, 1 Feb 2017 12:49:09 -0500 Subject: [PATCH 01/20] Install grpc_cpp_plugin.exe into tools folder --- ports/grpc/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index ffd71d137..90915976c 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -53,6 +53,8 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets-release.cmake ${C file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake) file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/grpc_cpp_plugin.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) From bfc7a36e923434b000f9d16c621d850444c7125b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 14:38:49 -0800 Subject: [PATCH 02/20] [cpprestsdk] Use websocketpp from vcpkg instead of cpprest's copy --- ports/cpprestsdk/CONTROL | 4 ++-- ports/cpprestsdk/portfile.cmake | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/cpprestsdk/CONTROL b/ports/cpprestsdk/CONTROL index b3438026f..f284f2b53 100644 --- a/ports/cpprestsdk/CONTROL +++ b/ports/cpprestsdk/CONTROL @@ -1,5 +1,5 @@ Source: cpprestsdk -Version: 2.9.0-1 -Build-Depends: zlib [windows], openssl [windows], boost [windows] +Version: 2.9.0-2 +Build-Depends: zlib [windows], openssl [windows], boost [windows], websocketpp [windows] Description: C++11 JSON, REST, and OAuth library The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services. \ No newline at end of file diff --git a/ports/cpprestsdk/portfile.cmake b/ports/cpprestsdk/portfile.cmake index d1b5fa7f6..f92c5147a 100644 --- a/ports/cpprestsdk/portfile.cmake +++ b/ports/cpprestsdk/portfile.cmake @@ -15,9 +15,13 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch ) +SET(WEBSOCKETPP_PATH "${CURRENT_INSTALLED_DIR}/share/websocketpp") + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/Release OPTIONS + -DWEBSOCKETPP_CONFIG=${WEBSOCKETPP_PATH} + -DWEBSOCKETPP_CONFIG_VERSION=${WEBSOCKETPP_PATH} -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCPPREST_EXCLUDE_WEBSOCKETS=OFF From ac44d930696cfc190c33f88c9ffa673918166cf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 14:39:16 -0800 Subject: [PATCH 03/20] [webscoketpp] Fix dependencies --- ports/websocketpp/CONTROL | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/websocketpp/CONTROL b/ports/websocketpp/CONTROL index c11e64d3e..f812dc565 100644 --- a/ports/websocketpp/CONTROL +++ b/ports/websocketpp/CONTROL @@ -1,3 +1,4 @@ Source: websocketpp Version: 0.7.0 +Build-Depends: zlib, openssl, boost Description: Library that implements RFC6455 The WebSocket Protocol \ No newline at end of file From f7dcbe97fffdb5e4a005de7513816fc476aeef81 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 3 Feb 2017 17:46:09 -0800 Subject: [PATCH 04/20] [vcpkg] Disable Intel MKL for all internal builds. Fixes #609. --- scripts/cmake/vcpkg_build_cmake.cmake | 11 ++++++++--- scripts/cmake/vcpkg_build_msbuild.cmake | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 6d7cfe643..3e8363a2c 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,9 +1,14 @@ function(vcpkg_build_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - set(MSVC_EXTRA_ARGS) + set(MSVC_EXTRA_ARGS + "/p:VCPkgLocalAppDataDisabled=true" + "/p:UseIntelMKL=No" + ) # Specifies the architecture of the toolset, NOT the architecture of the produced binary + # This can help libraries that cause the linker to run out of memory. + # https://support.microsoft.com/en-us/help/2891057/linker-fatal-error-lnk1102-out-of-memory if (_bc_MSVC_64_TOOLSET) list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") endif() @@ -14,7 +19,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel ) @@ -22,7 +27,7 @@ function(vcpkg_build_cmake) message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- /p:VCPkgLocalAppDataDisabled=true ${MSVC_EXTRA_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug -- ${MSVC_EXTRA_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index df255c745..f4a809e7f 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -55,6 +55,7 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_RELEASE_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME build-${TARGET_TRIPLET}-rel @@ -67,6 +68,7 @@ function(vcpkg_build_msbuild) /p:Configuration=${_csc_DEBUG_CONFIGURATION} /p:Platform=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true + /p:UseIntelMKL=No /m WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME build-${TARGET_TRIPLET}-dbg From 5fa7aba4d21ce35b65da02243697319bd23bf2f6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Feb 2017 18:25:43 -0800 Subject: [PATCH 05/20] [vcpkg remove] Fix remove --purge not applying to not-installed packages --- toolsrc/src/commands_remove.cpp | 39 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 7e8608e72..f49104d1e 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -196,26 +196,29 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& action : remove_plan) { - if (action.plan.plan_type == remove_plan_type::NOT_INSTALLED) - { - System::println(System::color::success, "Package %s is not installed", action.spec); - } - else if (action.plan.plan_type == remove_plan_type::REMOVE) - { - const std::string display_name = action.spec.display_name(); - System::println("Removing package %s... ", display_name); - remove_package(paths, action.spec, &status_db); - System::println(System::color::success, "Removing package %s... done", display_name); + const std::string display_name = action.spec.display_name(); - if (alsoRemoveFolderFromPackages) - { - System::println("Purging package %s... ", display_name); - delete_directory(paths.packages / action.spec.dir()); - System::println(System::color::success, "Purging package %s... done", display_name); - } + switch (action.plan.plan_type) + { + case remove_plan_type::NOT_INSTALLED: + System::println(System::color::success, "Package %s is not installed", display_name); + break; + case remove_plan_type::REMOVE: + System::println("Removing package %s... ", display_name); + remove_package(paths, action.spec, &status_db); + System::println(System::color::success, "Removing package %s... done", display_name); + break; + case remove_plan_type::UNKNOWN: + default: + Checks::unreachable(); + } + + if (alsoRemoveFolderFromPackages) + { + System::println("Purging package %s... ", display_name); + delete_directory(paths.packages / action.spec.dir()); + System::println(System::color::success, "Purging package %s... done", display_name); } - else - Checks::unreachable(); } exit(EXIT_SUCCESS); From 20ac877b5e6e182ca449c633516636c173e71f94 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 3 Feb 2017 18:54:38 -0800 Subject: [PATCH 06/20] [wt] Apply upstream patch to fix boost 1.63 compat. Fixes #626. --- ports/wt/CONTROL | 2 +- ports/wt/portfile.cmake | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/wt/CONTROL b/ports/wt/CONTROL index 1a89dd378..d7ac2c535 100644 --- a/ports/wt/CONTROL +++ b/ports/wt/CONTROL @@ -1,4 +1,4 @@ Source: wt -Version: 3.3.6-2 +Version: 3.3.6-3 Description: Wt is a C++ library for developing web applications Build-Depends: boost, openssl diff --git a/ports/wt/portfile.cmake b/ports/wt/portfile.cmake index f762eface..7e2bdb47c 100644 --- a/ports/wt/portfile.cmake +++ b/ports/wt/portfile.cmake @@ -7,10 +7,15 @@ vcpkg_download_distfile(ARCHIVE_FILE SHA512 d6135713d300bcd3956a4fd673af73be0561eb5d6aa91c47255b966950ddb411217e6a826c1d11c0d941dbb6d006c9926231d7334b21de6256cca331066e18a6 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) - +vcpkg_download_distfile(PATCH_FILE + URLS "https://github.com/emweb/wt/commit/b944cdc0961f683cd12fc6e60db3d0b328cd46dd.diff" + FILENAME "wt-fix-boost-1-63.diff" + SHA512 0766837ed8852da675b02b45bfbe7a6705ab20f67aa20849df4cc4b93b00dec0b73acea3568bca1046e203119445044c5ea06e33bac5d5d991f6a56b8fe282e1 +) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/add-disable-boost-autolink-option.patch + ${PATCH_FILE} ) vcpkg_configure_cmake( From 85cab47ea46f255dd6c3528e309191ed7c3fd2ff Mon Sep 17 00:00:00 2001 From: sdcb Date: Sat, 4 Feb 2017 11:18:04 +0800 Subject: [PATCH 07/20] [aws-sdk-cpp] upgrade to 1.0.61 1. upgrade to 1.0.61 2. disable warning as error temply(fix https://github.com/Microsoft/vcpkg/issues/629 before https://github.com/aws/aws-sdk-cpp/issues/438) 3. using cmake file(append) instead of patch to define #define USE_IMPORT_EXPORT in SDKConfig.h (simplified code) --- ports/aws-sdk-cpp/disable_warning_as_error.patch | 13 +++++++++++++ ports/aws-sdk-cpp/portfile.cmake | 15 ++++++--------- ports/aws-sdk-cpp/shared_define.patch | 10 ---------- 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 ports/aws-sdk-cpp/disable_warning_as_error.patch delete mode 100644 ports/aws-sdk-cpp/shared_define.patch diff --git a/ports/aws-sdk-cpp/disable_warning_as_error.patch b/ports/aws-sdk-cpp/disable_warning_as_error.patch new file mode 100644 index 000000000..ec5587eb8 --- /dev/null +++ b/ports/aws-sdk-cpp/disable_warning_as_error.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/compiler_settings.cmake b/cmake/compiler_settings.cmake +index 36795a2..77334ee 100644 +--- a/cmake/compiler_settings.cmake ++++ b/cmake/compiler_settings.cmake +@@ -57,7 +57,7 @@ endif() + if(MSVC) + # warnings as errors, max warning level (4) + if(NOT CMAKE_CXX_FLAGS MATCHES "/WX") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") ++ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + endif() + + # taken from http://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake diff --git a/ports/aws-sdk-cpp/portfile.cmake b/ports/aws-sdk-cpp/portfile.cmake index 5313e85b7..21219c3c9 100644 --- a/ports/aws-sdk-cpp/portfile.cmake +++ b/ports/aws-sdk-cpp/portfile.cmake @@ -1,9 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.47) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aws-sdk-cpp-1.0.61) vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.47.tar.gz" - FILENAME "aws-sdk-cpp-1.0.47.tar.gz" - SHA512 ce7471bafe2763f1c382eed8afeaf6422058599a3aa11ae52909da668c45d12827fcd06b9b3ce34e3c2fa33297fd2e09421b8a89833d581efaf62b7108232acf + URLS "https://github.com/aws/aws-sdk-cpp/archive/1.0.61.tar.gz" + FILENAME "aws-sdk-cpp-1.0.61.tar.gz" + SHA512 aef0a85a32db24dc4fba0fc49c2533074580f3df628e787ff0808f03deea5dac42e19b1edc966706784e98cfed17a350c3eff4f222df7cc756065be56d1fc6a6 ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -11,6 +11,7 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/drop_git.patch + ${CMAKE_CURRENT_LIST_DIR}/disable_warning_as_error.patch ) if(VCPKG_CRT_LINKAGE STREQUAL static) @@ -44,11 +45,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES}) - vcpkg_apply_patches( #define USE_IMPORT_EXPORT in SDKConfig.h - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include - PATCHES - ${CMAKE_CURRENT_LIST_DIR}/shared_define.patch - ) + file(APPEND ${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h "#define USE_IMPORT_EXPORT") endif() # Handle copyright diff --git a/ports/aws-sdk-cpp/shared_define.patch b/ports/aws-sdk-cpp/shared_define.patch deleted file mode 100644 index 96657b33e..000000000 --- a/ports/aws-sdk-cpp/shared_define.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/aws/core/SDKConfig.h b/aws/core/SDKConfig.h -index 130c9dd..66b2630 100644 ---- a/aws/core/SDKConfig.h -+++ b/aws/core/SDKConfig.h -@@ -17,3 +17,4 @@ - - #define JSON_USE_EXCEPTION 0 - -+#define USE_IMPORT_EXPORT -\ No newline at end of file From 504545d2c864623ebddf169b1e402326bfe136f4 Mon Sep 17 00:00:00 2001 From: Ben Harper Date: Mon, 6 Feb 2017 14:44:59 +0200 Subject: [PATCH 08/20] Add a workaround for another BITS code path The fix from last week (ce9927f7327bc71ade246108a7d984deda6293fd) worked for downloading most dependencies, but there is still one BITS transfer code path, which this fix addresses. --- .../findVisualStudioInstallationInstances.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index a2ce66522..9d54990a2 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -20,7 +20,21 @@ $downloadPath = "$downloadsDir\$downloadName" if (!(Test-Path $downloadPath)) { - Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue + try { + Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop + } + catch [System.Exception] { + # If BITS fails for any reason, delete any potentially partially downloaded files and continue + if (Test-Path $downloadPath) + { + Remove-Item $downloadPath + } + } +} +if (!(Test-Path $downloadPath)) +{ + Write-Host("Downloading $downloadName...") + (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) } $nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 From 7207316ed405c334be1ac507d76dd45a5979903d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Feb 2017 15:26:35 -0800 Subject: [PATCH 09/20] Don't download nupkg. nuget.exe auto-downloads it --- .../findVisualStudioInstallationInstances.ps1 | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 9d54990a2..2c42ef420 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -14,29 +14,6 @@ $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.3.269-rc" -$url = "https://api.nuget.org/packages/microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" -$downloadName = "microsoft.visualstudio.setup.configuration.native.$SetupAPIVersion.nupkg" -$downloadPath = "$downloadsDir\$downloadName" - -if (!(Test-Path $downloadPath)) -{ - try { - Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop - } - catch [System.Exception] { - # If BITS fails for any reason, delete any potentially partially downloaded files and continue - if (Test-Path $downloadPath) - { - Remove-Item $downloadPath - } - } -} -if (!(Test-Path $downloadPath)) -{ - Write-Host("Downloading $downloadName...") - (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) -} - $nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" From 1bfd72480d46845a941f891d232eb8c67b9d146c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 6 Feb 2017 15:52:48 -0800 Subject: [PATCH 10/20] [poco] Fix #475 by adding include path to public interface. --- ports/poco/CONTROL | 2 +- ports/poco/foundation-public-include-pcre.patch | 12 ++++++++++++ ports/poco/portfile.cmake | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ports/poco/foundation-public-include-pcre.patch diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 6f4f7e3b1..ae2758c1f 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco -Version: 1.7.6-2 +Version: 1.7.6-3 Build-Depends: zlib, pcre, sqlite3, expat Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/foundation-public-include-pcre.patch b/ports/poco/foundation-public-include-pcre.patch new file mode 100644 index 000000000..ab4403ad8 --- /dev/null +++ b/ports/poco/foundation-public-include-pcre.patch @@ -0,0 +1,12 @@ +diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt +index 76005b1..efc99b6 100644 +--- a/Foundation/CMakeLists.txt ++++ b/Foundation/CMakeLists.txt +@@ -166,6 +166,7 @@ target_link_libraries( "${LIBNAME}" ${SYSLIBS}) + target_include_directories( "${LIBNAME}" + PUBLIC + $ ++ $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src + ) diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index 413f19c7e..e774c3c17 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_apply_patches( PATCHES ${CMAKE_CURRENT_LIST_DIR}/config_h.patch ${CMAKE_CURRENT_LIST_DIR}/find_pcre.patch + ${CMAKE_CURRENT_LIST_DIR}/foundation-public-include-pcre.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) From acc669e86942dd569884d5241b023a91eed61908 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 6 Feb 2017 15:55:39 -0800 Subject: [PATCH 11/20] Update SetupAPI version. Explicitly specify version. Use -nocache --- scripts/findVisualStudioInstallationInstances.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 2c42ef420..260ee73fe 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -13,8 +13,8 @@ $downloadsDir = "$vcpkgRootDir\downloads" $nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" -$SetupAPIVersion = "1.3.269-rc" -$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1 +$SetupAPIVersion = "1.5.125-rc" +$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -nocache 2>&1 $SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" From 8d5cbff2954a425731057a206a8e769a5bc53e16 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 7 Feb 2017 15:04:07 -0800 Subject: [PATCH 12/20] [examples] Add the manual-link directories to the Examples documentation --- docs/EXAMPLES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 6302dab07..cc100c4ca 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -150,9 +150,9 @@ PS D:\src\cmake-test\build> .\Debug\main.exe Libraries are installed into the `installed\` subfolder, partitioned by architecture (e.g. x86-windows): * The header files are installed to `installed\x86-windows\include` -* Release `.lib` files are installed to `installed\x86-windows\lib` +* Release `.lib` files are installed to `installed\x86-windows\lib` or `installed\x86-windows\lib\manual-link` * Release `.dll` files are installed to `installed\x86-windows\bin` -* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` +* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` or `installed\x86-windows\debug\lib\manual-link` * Debug `.dll` files are installed to `installed\x86-windows\debug\bin` See your build system specific documentation for how to use prebuilt binaries. From f9616c6994ccf66e2a64e2d62e6a1408694c190c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 17:02:57 -0800 Subject: [PATCH 13/20] Add new Policy: Empty Package --- scripts/ports.cmake | 3 + toolsrc/include/PostBuildLint_BuildPolicies.h | 5 +- toolsrc/src/PostBuildLint.cpp | 92 +++++++++++-------- toolsrc/src/PostBuildLint_BuildPolicies.cpp | 13 ++- 4 files changed, 72 insertions(+), 41 deletions(-) diff --git a/scripts/ports.cmake b/scripts/ports.cmake index cc01a0619..c03b005ea 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -79,6 +79,9 @@ if(CMD MATCHES "^BUILD$") if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n") endif() + if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n") + endif() elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h index 8298ffe2d..187ba6d64 100644 --- a/toolsrc/include/PostBuildLint_BuildPolicies.h +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -6,6 +6,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies enum class backing_enum_t { UNKNOWN = 0, + EMPTY_PACKAGE, DLLS_WITHOUT_LIBS }; @@ -22,10 +23,12 @@ namespace vcpkg::PostBuildLint::BuildPolicies backing_enum_t backing_enum; }; - static constexpr int value_count = 2; + static constexpr int value_count = 3; const std::vector& values(); + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type EMPTY_PACKAGE(backing_enum_t::EMPTY_PACKAGE); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); type parse(const std::string& s); diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 5954089e9..533e28fcf 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -582,16 +582,21 @@ namespace vcpkg::PostBuildLint left += static_cast(right); } - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + static size_t perform_all_checks_and_return_error_count(const package_spec& spec, const vcpkg_paths& paths) { const fs::path dumpbin_exe = Environment::get_dumpbin_exe(paths); - System::println("-- Performing post-build validation"); - BuildInfo build_info = read_build_info(paths.build_info_file_path(spec)); const fs::path package_dir = paths.package_dir(spec); size_t error_count = 0; + + auto it = build_info.policies.find(BuildPolicies::EMPTY_PACKAGE); + if (it != build_info.policies.cend() && it->second == opt_bool_t::ENABLED) + { + return error_count; + } + error_count += check_for_files_in_include_directory(package_dir); error_count += check_for_files_in_debug_include_directory(package_dir); error_count += check_for_files_in_debug_share_directory(package_dir); @@ -620,56 +625,65 @@ namespace vcpkg::PostBuildLint switch (linkage_type_value_of(build_info.library_linkage)) { - case LinkageType::DYNAMIC: - { - const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + case LinkageType::DYNAMIC: + { + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); - error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); - std::vector dlls; - dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); - dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); + std::vector dlls; + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls, dumpbin_exe); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); - error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); + error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); - break; - } - case LinkageType::STATIC: - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); - error_count += check_no_dlls_present(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); + break; + } + case LinkageType::STATIC: + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + error_count += check_no_dlls_present(dlls); - error_count += check_bin_folders_are_not_present_in_static_build(package_dir); + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); - break; - } - case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } - default: - Checks::unreachable(); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + break; + } + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } + default: + Checks::unreachable(); } #if 0 - error_count += check_no_subdirectories(package_dir / "lib"); - error_count += check_no_subdirectories(package_dir / "debug" / "lib"); + error_count += check_no_subdirectories(package_dir / "lib"); + error_count += check_no_subdirectories(package_dir / "debug" / "lib"); #endif error_count += check_no_empty_folders(package_dir); error_count += check_no_files_in_package_dir_and_debug_dir(package_dir); + return error_count; + } + + void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths) + { + System::println("-- Performing post-build validation"); + + const size_t error_count = perform_all_checks_and_return_error_count(spec, paths); + if (error_count != 0) { const fs::path portfile = paths.ports / spec.name() / "portfile.cmake"; diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp index d7d67c991..4e5ac3cea 100644 --- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp +++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp @@ -5,12 +5,15 @@ namespace vcpkg::PostBuildLint::BuildPolicies { static const std::string NAME_UNKNOWN = "PolicyUnknown"; + static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; const std::string& type::toString() const { switch (this->backing_enum) { + case EMPTY_PACKAGE: + return NAME_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; case UNKNOWN: @@ -22,10 +25,13 @@ namespace vcpkg::PostBuildLint::BuildPolicies const std::string& type::cmake_variable() const { + static const std::string CMAKE_VARIABLE_EMPTY_PACKAGE = "VCPKG_POLICY_EMPTY_PACKAGE"; static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; switch (this->backing_enum) { + case EMPTY_PACKAGE: + return CMAKE_VARIABLE_EMPTY_PACKAGE; case DLLS_WITHOUT_LIBS: return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS; case UNKNOWN: @@ -39,12 +45,17 @@ namespace vcpkg::PostBuildLint::BuildPolicies const std::vector& values() { - static const std::vector& v = {UNKNOWN, DLLS_WITHOUT_LIBS}; + static const std::vector& v = {UNKNOWN, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS}; return v; } type parse(const std::string& s) { + if (s == NAME_EMPTY_PACKAGE) + { + return BuildPolicies::EMPTY_PACKAGE; + } + if (s == NAME_DLLS_WITHOUT_LIBS) { return BuildPolicies::DLLS_WITHOUT_LIBS; From d4fa0b34c08dcfb11bd285846ee5cc061885033d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 17:04:24 -0800 Subject: [PATCH 14/20] Add CUDA portfile The intention of this package is for other packages to declare a dependency on CUDA --- ports/cuda/CONTROL | 3 +++ ports/cuda/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 ports/cuda/CONTROL create mode 100644 ports/cuda/portfile.cmake diff --git a/ports/cuda/CONTROL b/ports/cuda/CONTROL new file mode 100644 index 000000000..00df3011c --- /dev/null +++ b/ports/cuda/CONTROL @@ -0,0 +1,3 @@ +Source: cuda +Version: 8.0 +Description: A parallel computing platform and programming model \ No newline at end of file diff --git a/ports/cuda/portfile.cmake b/ports/cuda/portfile.cmake new file mode 100644 index 000000000..3b20afe0f --- /dev/null +++ b/ports/cuda/portfile.cmake @@ -0,0 +1,34 @@ +# Due to the complexity involved, this package doesn't install CUDA. It instead verifies that CUDA is installed. +# Other packages can depend on this package to declare a dependency on CUDA. +# If this package is installed, we assume that CUDA is properly installed. + +execute_process( + COMMAND nvcc --version + OUTPUT_VARIABLE NVCC_OUTPUT + RESULT_VARIABLE error_code) + +# Sample output +# NVIDIA (R) Cuda compiler driver +# Copyright (c) 2005-2016 NVIDIA Corporation +# Built on Sat_Sep__3_19:05:48_CDT_2016 +# Cuda compilation tools, release 8.0, V8.0.44 +set(CUDA_REQUIRED_VERSION "V8.0.0") + +if (${error_code}) + message(FATAL_ERROR "CUDA is not installed. Before continuing, please download and install CUDA (${CUDA_REQUIRED_VERSION} or higher) from:" + "\n https://developer.nvidia.com/cuda-downloads \n") +endif() + +string(REGEX MATCH "V([0-9]+)\\.([0-9]+)\\.([0-9]+)" CUDA_VERSION ${NVCC_OUTPUT}) +message(STATUS "Found CUDA ${CUDA_VERSION}") +set(CUDA_VERSION_MAJOR ${CMAKE_MATCH_1}) +#set(CUDA_VERSION_MINOR ${CMAKE_MATCH_2}) +#set(CUDA_VERSION_PATCH ${CMAKE_MATCH_3}) + + +if (${CUDA_VERSION_MAJOR} LESS 8) + message(FATAL_ERROR "CUDA ${CUDA_VERSION} but ${CUDA_REQUIRED_VERSION} is required. Please download and install a more recent version of CUDA from:" + "\n https://developer.nvidia.com/cuda-downloads \n") +endif() + +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file From 994ebec3ea29994197be64084f33d3653ec428c5 Mon Sep 17 00:00:00 2001 From: sdflysha Date: Wed, 8 Feb 2017 10:50:01 +0800 Subject: [PATCH 15/20] [aws-sdk-cpp] bump version to 1.0.61 I created a PR here: https://github.com/Microsoft/vcpkg/pull/631 but forgot to bump the aws-sdk-cpp version, I fixed it here. --- ports/aws-sdk-cpp/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/aws-sdk-cpp/CONTROL b/ports/aws-sdk-cpp/CONTROL index 989d3a9eb..18de04d46 100644 --- a/ports/aws-sdk-cpp/CONTROL +++ b/ports/aws-sdk-cpp/CONTROL @@ -1,3 +1,3 @@ Source: aws-sdk-cpp -Version: 1.0.47 +Version: 1.0.61 Description: AWS SDK for C++ From d36a1b7cb0b8be59e7826a7a699d9951e91abc2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 22:57:37 -0800 Subject: [PATCH 16/20] Remove OutdatedDynamicCrt enum. Replace with vector --- .../PostBuildLint_OutdatedDynamicCrt.h | 59 ---------- toolsrc/src/PostBuildLint.cpp | 107 +++++++++++------- .../src/PostBuildLint_OutdatedDynamicCrt.cpp | 35 ------ toolsrc/vcpkglib/vcpkglib.vcxproj | 2 - toolsrc/vcpkglib/vcpkglib.vcxproj.filters | 6 - 5 files changed, 69 insertions(+), 140 deletions(-) delete mode 100644 toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h delete mode 100644 toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp diff --git a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h deleted file mode 100644 index 484f74cf0..000000000 --- a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once -#include -#include - -namespace vcpkg::PostBuildLint -{ - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) { } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; -} diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 533e28fcf..7986d913a 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -7,7 +7,6 @@ #include "coff_file_reader.h" #include "PostBuildLint_BuildInfo.h" #include "PostBuildLint_BuildType.h" -#include "PostBuildLint_OutdatedDynamicCrt.h" namespace vcpkg::PostBuildLint { @@ -17,6 +16,38 @@ namespace vcpkg::PostBuildLint ERROR_DETECTED = 1 }; + struct OutdatedDynamicCrt + { + std::string name; + std::regex regex; + }; + + const std::vector& get_outdated_dynamic_crts() + { + static const std::vector v = { + {"msvcp100.dll", std::regex(R"(msvcp100\.dll)")}, + {"msvcp100d.dll", std::regex(R"(msvcp100d\.dll)")}, + {"msvcp110.dll", std::regex(R"(msvcp110\.dll)")}, + {"msvcp110_win.dll", std::regex(R"(msvcp110_win\.dll)")}, + {"msvcp120.dll", std::regex(R"(msvcp120\.dll)")}, + {"msvcp120_clr0400.dll", std::regex(R"(msvcp120_clr0400\.dll)")}, + {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + + {"msvcr100.dll", std::regex(R"(msvcr100\.dll)")}, + {"msvcr100d.dll", std::regex(R"(msvcr100d\.dll)")}, + {"msvcr100_clr0400.dll", std::regex(R"(msvcr100_clr0400\.dll)")}, + {"msvcr110.dll", std::regex(R"(msvcr110\.dll)")}, + {"msvcr120.dll", std::regex(R"(msvcr120\.dll)")}, + {"msvcr120_clr0400.dll", std::regex(R"(msvcr120_clr0400\.dll)")}, + {"msvcrt.dll", std::regex(R"(msvcrt\.dll)")}, + {"msvcrt20.dll", std::regex(R"(msvcrt20\.dll)")}, + {"msvcrt40.dll", std::regex(R"(msvcrt40\.dll)")} + }; + + return v; + } + static lint_status check_for_files_in_include_directory(const fs::path& package_dir) { const fs::path include_dir = package_dir / "include"; @@ -516,7 +547,7 @@ namespace vcpkg::PostBuildLint static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls, const fs::path dumpbin_exe) { - const std::vector& outdated_crts = OutdatedDynamicCrt::values(); + const std::vector& outdated_crts = get_outdated_dynamic_crts(); std::vector dlls_with_outdated_crt; @@ -528,7 +559,7 @@ namespace vcpkg::PostBuildLint for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) { - if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.crt_regex())) + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.regex)) { dlls_with_outdated_crt.push_back({dll, outdated_crt}); break; @@ -542,7 +573,7 @@ namespace vcpkg::PostBuildLint System::println(""); for (const OutdatedDynamicCrt_and_file btf : dlls_with_outdated_crt) { - System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.toString()); + System::println(" %s: %s", btf.file.generic_string(), btf.outdated_crt.name); } System::println(""); @@ -625,47 +656,47 @@ namespace vcpkg::PostBuildLint switch (linkage_type_value_of(build_info.library_linkage)) { - case LinkageType::DYNAMIC: - { - const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); - const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); + case LinkageType::DYNAMIC: + { + const std::vector debug_dlls = Files::recursive_find_files_with_extension_in_dir(debug_bin_dir, ".dll"); + const std::vector release_dlls = Files::recursive_find_files_with_extension_in_dir(release_bin_dir, ".dll"); - error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); + error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); - std::vector dlls; - dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); - dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); + std::vector dlls; + dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); + dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); - error_count += check_exports_of_dlls(dlls, dumpbin_exe); - error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); - error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + error_count += check_exports_of_dlls(dlls, dumpbin_exe); + error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe); + error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); - error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); - break; - } - case LinkageType::STATIC: - { - std::vector dlls; - Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); - error_count += check_no_dlls_present(dlls); + error_count += check_outdated_crt_linkage_of_dlls(dlls, dumpbin_exe); + break; + } + case LinkageType::STATIC: + { + std::vector dlls; + Files::recursive_find_files_with_extension_in_dir(package_dir, ".dll", &dlls); + error_count += check_no_dlls_present(dlls); - error_count += check_bin_folders_are_not_present_in_static_build(package_dir); + error_count += check_bin_folders_are_not_present_in_static_build(package_dir); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); - error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); - break; - } - case LinkageType::UNKNOWN: - { - error_count += 1; - System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); - break; - } - default: - Checks::unreachable(); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs, dumpbin_exe); + error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs, dumpbin_exe); + break; + } + case LinkageType::UNKNOWN: + { + error_count += 1; + System::println(System::color::warning, "Unknown library_linkage architecture: [ %s ]", build_info.library_linkage); + break; + } + default: + Checks::unreachable(); } #if 0 error_count += check_no_subdirectories(package_dir / "lib"); diff --git a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp b/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp deleted file mode 100644 index 67965cd93..000000000 --- a/toolsrc/src/PostBuildLint_OutdatedDynamicCrt.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "pch.h" -#include "PostBuildLint_OutdatedDynamicCrt.h" - -namespace vcpkg::PostBuildLint -{ - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100_DLL = OutdatedDynamicCrt("msvcp100.dll", R"(msvcp100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP100D_DLL = OutdatedDynamicCrt("msvcp100d.dll", R"(msvcp100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_DLL = OutdatedDynamicCrt("msvcp110.dll", R"(msvcp110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP110_WIN_DLL = OutdatedDynamicCrt("msvcp110_win.dll", R"(msvcp110_win\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_DLL = OutdatedDynamicCrt("msvcp120.dll", R"(msvcp120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP120_CLR0400_DLL = OutdatedDynamicCrt("msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP60_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCP_WIN_DLL = OutdatedDynamicCrt("msvcp60.dll", R"(msvcp60\.dll)");; - - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_DLL = OutdatedDynamicCrt("msvcr100.dll", R"(msvcr100\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100D_DLL = OutdatedDynamicCrt("msvcr100d.dll", R"(msvcr100d\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR100_CLR0400_DLL = OutdatedDynamicCrt("msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR110_DLL = OutdatedDynamicCrt("msvcr110.dll", R"(msvcr110\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_DLL = OutdatedDynamicCrt("msvcr120.dll", R"(msvcr120\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCR120_CLR0400_DLL = OutdatedDynamicCrt("msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT_DLL = OutdatedDynamicCrt("msvcrt.dll", R"(msvcrt\.dll)"); - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT20_DLL = OutdatedDynamicCrt("msvcrt20.dll", R"(msvcrt20\.dll)");; - const OutdatedDynamicCrt OutdatedDynamicCrt::MSVCRT40_DLL = OutdatedDynamicCrt("msvcrt40.dll", R"(msvcrt40\.dll)");; - - std::regex OutdatedDynamicCrt::crt_regex() const - { - const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); - return r; - } - - const std::string& OutdatedDynamicCrt::toString() const - { - return this->m_dll_name; - } -} diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index d002f8d5f..2a651e294 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -154,7 +154,6 @@ - @@ -214,7 +213,6 @@ - diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 3359d9ada..99cbf7037 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -165,9 +165,6 @@ Source Files - - Source Files - Source Files @@ -293,8 +290,5 @@ Header Files - - Header Files - \ No newline at end of file From e1aea256b84d2c1ac5c29db0e5e40ed536e3157f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 02:07:53 -0800 Subject: [PATCH 17/20] Fix variable name and guard against 0 instances --- scripts/findVisualStudioInstallationInstances.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 260ee73fe..951975758 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -25,8 +25,9 @@ if (!(Test-Path $SetupConsoleExe)) $instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 $instanceCount = $instances.Length + # The last item can be empty -if ($instances[$entryCount - 1] -eq "") +if ($instanceCount -gt 0 -and $instances[$instanceCount - 1] -eq "") { $instances = $instances[0..($instanceCount - 2)] } From 5e588ddb5be9e6e27cebcc3be2e1a27f3ca83a50 Mon Sep 17 00:00:00 2001 From: Oleksii Mandrychenko Date: Wed, 8 Feb 2017 19:11:00 +0000 Subject: [PATCH 18/20] Improved formatting of doc/EXAMPLES.md - added "./" so that commands can be copy-pasted into the PowerShel --- docs/EXAMPLES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index d991d87f9..f67ce3313 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -3,7 +3,7 @@ ## Overview Vcpkg helps you get C and C++ libraries on Windows. -For short description of available commands, run `vcpkg help`. +For short description of available commands, run `./vcpkg help`. ## Table of Contents - Example 1: Using the C++ REST SDK @@ -87,7 +87,7 @@ To install for other architectures and platforms such as Universal Windows Platf PS D:\src\vcpkg> .\vcpkg install cpprestsdk:x86-uwp zlib:x64-windows ``` -See `vcpkg help triplet` for all supported targets. +See `.\vcpkg help triplet` for all supported targets. ### Step 2: Use @@ -105,7 +105,7 @@ Installing new libraries will make them instantly available. ``` *Note: You will need to restart Visual Studio or perform a Build to update intellisense with the changes.* -To remove the integration for your user, you can use `vcpkg integrate remove`. +To remove the integration for your user, you can use `./vcpkg integrate remove`. #### Option B: CMake (Toolchain File) From a9f7fc6e90feaad50c1221ef9bd56e2620302215 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 8 Feb 2017 12:36:32 -0800 Subject: [PATCH 19/20] Make regex for OutdatedDyanmicCRTs case insensitive --- toolsrc/src/PostBuildLint.cpp | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 7986d913a..90bd55843 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -20,29 +20,32 @@ namespace vcpkg::PostBuildLint { std::string name; std::regex regex; + + OutdatedDynamicCrt(const std::string& name, const std::string& regex_as_string) + : name(name), regex(std::regex(regex_as_string, std::regex_constants::icase)) {} }; const std::vector& get_outdated_dynamic_crts() { static const std::vector v = { - {"msvcp100.dll", std::regex(R"(msvcp100\.dll)")}, - {"msvcp100d.dll", std::regex(R"(msvcp100d\.dll)")}, - {"msvcp110.dll", std::regex(R"(msvcp110\.dll)")}, - {"msvcp110_win.dll", std::regex(R"(msvcp110_win\.dll)")}, - {"msvcp120.dll", std::regex(R"(msvcp120\.dll)")}, - {"msvcp120_clr0400.dll", std::regex(R"(msvcp120_clr0400\.dll)")}, - {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, - {"msvcp60.dll", std::regex(R"(msvcp60\.dll)")}, + {"msvcp100.dll", R"(msvcp100\.dll)"}, + {"msvcp100d.dll", R"(msvcp100d\.dll)"}, + {"msvcp110.dll", R"(msvcp110\.dll)"}, + {"msvcp110_win.dll", R"(msvcp110_win\.dll)"}, + {"msvcp120.dll", R"(msvcp120\.dll)"}, + {"msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"}, + {"msvcp60.dll", R"(msvcp60\.dll)"}, + {"msvcp60.dll", R"(msvcp60\.dll)"}, - {"msvcr100.dll", std::regex(R"(msvcr100\.dll)")}, - {"msvcr100d.dll", std::regex(R"(msvcr100d\.dll)")}, - {"msvcr100_clr0400.dll", std::regex(R"(msvcr100_clr0400\.dll)")}, - {"msvcr110.dll", std::regex(R"(msvcr110\.dll)")}, - {"msvcr120.dll", std::regex(R"(msvcr120\.dll)")}, - {"msvcr120_clr0400.dll", std::regex(R"(msvcr120_clr0400\.dll)")}, - {"msvcrt.dll", std::regex(R"(msvcrt\.dll)")}, - {"msvcrt20.dll", std::regex(R"(msvcrt20\.dll)")}, - {"msvcrt40.dll", std::regex(R"(msvcrt40\.dll)")} + {"msvcr100.dll", R"(msvcr100\.dll)"}, + {"msvcr100d.dll", R"(msvcr100d\.dll)"}, + {"msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"}, + {"msvcr110.dll", R"(msvcr110\.dll)"}, + {"msvcr120.dll", R"(msvcr120\.dll)"}, + {"msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"}, + {"msvcrt.dll", R"(msvcrt\.dll)"}, + {"msvcrt20.dll", R"(msvcrt20\.dll)"}, + {"msvcrt40.dll", R"(msvcrt40\.dll)"} }; return v; From 7cba4eb1a5c458a0c3a716c2808a7a8318a40005 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Feb 2017 15:14:29 -0800 Subject: [PATCH 20/20] [examples] Replace ./ with .\ to preserve copy-paste into cmd. --- docs/EXAMPLES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index b6a219b4f..1a2bacc99 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -3,7 +3,7 @@ ## Overview Vcpkg helps you get C and C++ libraries on Windows. -For short description of available commands, run `./vcpkg help`. +For short description of available commands, run `.\vcpkg help`. ## Table of Contents - Example 1: Using Sqlite