From e291ec68456f13af3df7b5616cf32d4674fb289d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 16:42:46 -0800 Subject: [build-checks] Finding no crt is no longer an error --- toolsrc/src/post_build_lint.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 9cd88bff1..62f97b88e 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -509,7 +509,6 @@ namespace vcpkg lint_status output_status = lint_status::SUCCESS; - std::vector libs_with_no_crts; std::vector libs_with_multiple_crts; BuildInfo_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); @@ -532,7 +531,7 @@ namespace vcpkg if (crts_found_count == 0) { - libs_with_no_crts.push_back(lib); + // It can be valid for no crt to be detected. For example: openssl continue; } @@ -563,13 +562,6 @@ namespace vcpkg libs_with_release_dynamic_crt.files.push_back(lib); } - if (!libs_with_no_crts.empty()) - { - System::println(System::color::warning, "Could not detect the crt linkage in the following libs:"); - print_vector_of_files(libs_with_no_crts); - output_status = lint_status::ERROR_DETECTED; - } - if (!libs_with_multiple_crts.empty()) { System::println(System::color::warning, "Detected multiple crt linkages for the following libs:"); @@ -658,10 +650,8 @@ namespace vcpkg error_count += check_bin_folders_are_not_present_in_static_build(spec, paths); -#if 0 error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::DEBUG, linkage_type_value_of(build_info.crt_linkage)), debug_libs); error_count += check_crt_linkage_of_libs(BuildType::value_of(ConfigurationType::RELEASE, linkage_type_value_of(build_info.crt_linkage)), release_libs); -#endif break; } case LinkageType::UNKNOWN: -- cgit v1.2.3 From 968fb2768d7ba8ab7c5c5f352cd63d18dcc3bde3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 17:15:50 -0800 Subject: Rename struct --- toolsrc/src/post_build_lint.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 62f97b88e..1f1351ffd 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -489,9 +489,9 @@ namespace vcpkg return lint_status::SUCCESS; } - struct BuildInfo_and_files + struct BuildType_and_files { - explicit BuildInfo_and_files(const BuildType& build_type) : build_type(build_type) + explicit BuildType_and_files(const BuildType& build_type) : build_type(build_type) { } @@ -511,10 +511,10 @@ namespace vcpkg std::vector libs_with_multiple_crts; - BuildInfo_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); - BuildInfo_and_files libs_with_debug_dynamic_crt(BuildType::DEBUG_DYNAMIC); - BuildInfo_and_files libs_with_release_static_crt(BuildType::RELEASE_STATIC); - BuildInfo_and_files libs_with_release_dynamic_crt(BuildType::RELEASE_DYNAMIC); + BuildType_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); + BuildType_and_files libs_with_debug_dynamic_crt(BuildType::DEBUG_DYNAMIC); + BuildType_and_files libs_with_release_static_crt(BuildType::RELEASE_STATIC); + BuildType_and_files libs_with_release_dynamic_crt(BuildType::RELEASE_DYNAMIC); for (const fs::path& lib : libs) { @@ -569,11 +569,11 @@ namespace vcpkg output_status = lint_status::ERROR_DETECTED; } - std::vector group_for_iteration = { + std::vector group_for_iteration = { libs_with_debug_static_crt, libs_with_debug_dynamic_crt, libs_with_release_static_crt, libs_with_release_dynamic_crt}; - for (const BuildInfo_and_files& bif : group_for_iteration) + for (const BuildType_and_files& bif : group_for_iteration) { if (!bif.files.empty() && bif.build_type != expected_build_type) { -- cgit v1.2.3 From bf7978dcf962c8ff37b3319121e60eb1629be684 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 18:44:11 -0800 Subject: [post-build-checks] Rework crt linkage checks --- toolsrc/include/BuildInfo.h | 25 +++++++++-- toolsrc/src/BuildInfo.cpp | 31 +++++++++++--- toolsrc/src/post_build_lint.cpp | 94 +++++++++-------------------------------- 3 files changed, 64 insertions(+), 86 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 870001474..235c83837 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -2,6 +2,7 @@ #include #include "Paragraphs.h" +#include namespace fs = std::tr2::sys; @@ -35,17 +36,33 @@ namespace vcpkg static const BuildType RELEASE_STATIC; static const BuildType RELEASE_DYNAMIC; - const ConfigurationType config; - const LinkageType linkage; + static constexpr int length() + { + return 4; + } + + static const std::vector& values() + { + static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; + return v; + } BuildType() = delete; - std::string toString() const; + const ConfigurationType& config() const; + const LinkageType& linkage() const; + const std::regex& crt_regex() const; + const std::string& toString() const; private: - BuildType(const ConfigurationType& config, const LinkageType& linkage) : config(config), linkage(linkage) + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) { } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; }; bool operator ==(const BuildType& lhs, const BuildType& rhs); diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 2e74eefc3..4b533ca8f 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -4,14 +4,31 @@ namespace vcpkg { - std::string BuildType::toString() const + const ConfigurationType& BuildType::config() const { - return Strings::format("[%s,%s]", to_string(config), to_string(linkage)); + return this->m_config; + } + + const LinkageType& BuildType::linkage() const + { + return this->m_linkage; + } + + const std::regex& BuildType::crt_regex() const + { + static const std::regex r(this->m_crt_regex_as_string); + return r; + } + + const std::string& BuildType::toString() const + { + static const std::string s = Strings::format("[%s,%s]", to_string(this->m_config), to_string(this->m_linkage)); + return s; } bool operator==(const BuildType& lhs, const BuildType& rhs) { - return lhs.config == rhs.config && lhs.linkage == rhs.linkage; + return lhs.config() == rhs.config() && lhs.linkage() == rhs.linkage(); } bool operator!=(const BuildType& lhs, const BuildType& rhs) @@ -35,10 +52,10 @@ namespace vcpkg return build_info; } - const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC); - const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC); - const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC); - const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC); + const BuildType BuildType::DEBUG_STATIC = BuildType(ConfigurationType::DEBUG, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMTD)"); + const BuildType BuildType::DEBUG_DYNAMIC = BuildType(ConfigurationType::DEBUG, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRTD)"); + const BuildType BuildType::RELEASE_STATIC = BuildType(ConfigurationType::RELEASE, LinkageType::STATIC, R"(/DEFAULTLIB:LIBCMT[^D])"); + const BuildType BuildType::RELEASE_DYNAMIC = BuildType(ConfigurationType::RELEASE, LinkageType::DYNAMIC, R"(/DEFAULTLIB:MSVCRT[^D])"); LinkageType linkage_type_value_of(const std::string& as_string) diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index 1f1351ffd..c7bdf7d21 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -489,32 +489,18 @@ namespace vcpkg return lint_status::SUCCESS; } - struct BuildType_and_files + struct BuildType_and_file { - explicit BuildType_and_files(const BuildType& build_type) : build_type(build_type) - { - } - + fs::path file; BuildType build_type; - std::vector files; }; static lint_status check_crt_linkage_of_libs(const BuildType& expected_build_type, const std::vector& libs) { - static const std::regex DEBUG_STATIC_CRT(R"(/DEFAULTLIB:LIBCMTD)"); - static const std::regex DEBUG_DYNAMIC_CRT(R"(/DEFAULTLIB:MSVCRTD)"); - - static const std::regex RELEASE_STATIC_CRT(R"(/DEFAULTLIB:LIBCMT[^D])"); - static const std::regex RELEASE_DYNAMIC_CRT(R"(/DEFAULTLIB:MSVCRT[^D])"); + std::vector bad_build_types = BuildType::values(); + bad_build_types.erase(std::remove(bad_build_types.begin(), bad_build_types.end(), expected_build_type), bad_build_types.end()); - lint_status output_status = lint_status::SUCCESS; - - std::vector libs_with_multiple_crts; - - BuildType_and_files libs_with_debug_static_crt(BuildType::DEBUG_STATIC); - BuildType_and_files libs_with_debug_dynamic_crt(BuildType::DEBUG_DYNAMIC); - BuildType_and_files libs_with_release_static_crt(BuildType::RELEASE_STATIC); - BuildType_and_files libs_with_release_dynamic_crt(BuildType::RELEASE_DYNAMIC); + std::vector libs_with_invalid_crt; for (const fs::path& lib : libs) { @@ -522,73 +508,31 @@ namespace vcpkg System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); - bool found_debug_static_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), DEBUG_STATIC_CRT); - bool found_debug_dynamic_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), DEBUG_DYNAMIC_CRT); - bool found_release_static_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), RELEASE_STATIC_CRT); - bool found_release_dynamic_crt = std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), RELEASE_DYNAMIC_CRT); - - const size_t crts_found_count = found_debug_static_crt + found_debug_dynamic_crt + found_release_static_crt + found_release_dynamic_crt; - - if (crts_found_count == 0) - { - // It can be valid for no crt to be detected. For example: openssl - continue; - } - - if (crts_found_count > 1) - { - libs_with_multiple_crts.push_back(lib); - continue; - } - - // now we have exactly 1 crt - if (found_debug_static_crt) - { - libs_with_debug_static_crt.files.push_back(lib); - continue; - } - if (found_debug_dynamic_crt) + for (const BuildType& bad_build_type : bad_build_types) { - libs_with_debug_dynamic_crt.files.push_back(lib); - continue; - } - - if (found_release_static_crt) - { - libs_with_release_static_crt.files.push_back(lib); - continue; + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), bad_build_type.crt_regex())) + { + libs_with_invalid_crt.push_back({lib, bad_build_type}); + break; + } } - - libs_with_release_dynamic_crt.files.push_back(lib); } - if (!libs_with_multiple_crts.empty()) + if (!libs_with_invalid_crt.empty()) { - System::println(System::color::warning, "Detected multiple crt linkages for the following libs:"); - print_vector_of_files(libs_with_multiple_crts); - output_status = lint_status::ERROR_DETECTED; - } - - std::vector group_for_iteration = { - libs_with_debug_static_crt, libs_with_debug_dynamic_crt, - libs_with_release_static_crt, libs_with_release_dynamic_crt}; - - for (const BuildType_and_files& bif : group_for_iteration) - { - if (!bif.files.empty() && bif.build_type != expected_build_type) + System::println(System::color::warning, "Expected %s crt linkage, but the following libs had invalid crt linkage:", expected_build_type.toString()); + System::println(""); + for (const BuildType_and_file btf : libs_with_invalid_crt) { - System::println(System::color::warning, "Expected %s crt linkage, but the following libs had %s crt linkage:", expected_build_type.toString(), bif.build_type.toString()); - print_vector_of_files(bif.files); - output_status = lint_status::ERROR_DETECTED; + System::println(" %s: %s", btf.file.generic_string(), btf.build_type.toString()); } - } + System::println(""); - if (output_status == lint_status::ERROR_DETECTED) - { System::println(System::color::warning, "To inspect the lib files, use:\n dumpbin.exe /directives mylibfile.lib"); + return lint_status::ERROR_DETECTED; } - return output_status; + return lint_status::SUCCESS; } static void operator +=(size_t& left, const lint_status& right) -- cgit v1.2.3 From 02b7c87e6e77dde6ade191ee92befba854bd9d07 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 10 Nov 2016 15:48:32 +0800 Subject: [chakracore] Upgrade version to official lastest 1.3.0 --- ports/chakracore/CONTROL | 2 +- ports/chakracore/portfile.cmake | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ports/chakracore/CONTROL b/ports/chakracore/CONTROL index c0ea61800..addb84aa2 100644 --- a/ports/chakracore/CONTROL +++ b/ports/chakracore/CONTROL @@ -1,3 +1,3 @@ Source: chakracore -Version: 1.2.0.0 +Version: 1.3.0 Description: Core part of the Chakra Javascript engine \ No newline at end of file diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index ea4a3d7ff..b937b17b4 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -5,21 +5,14 @@ endif() include(vcpkg_common_functions) find_program(POWERSHELL powershell) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.2.0.0) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.0) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://github.com/Microsoft/ChakraCore/archive/v1.2.0.0.tar.gz" - FILENAME "ChakraCore-1.2.0.0.tar.gz" - SHA512 53e487028a30605a4e2589c40b65da060ca4884617fdba8877557e4db75f911be4433d260132cce3526647622bdc742a0aacda1443a16dfed3d3fdd442539528 + URLS "https://github.com/Microsoft/ChakraCore/archive/v1.3.0.tar.gz" + FILENAME "ChakraCore-1.3.0.tar.gz" + SHA512 d00757e25f5c62bfc29721bd8f715df8dbaf0ac14c1dbdb0735227535cb4f2a209ec3957f24bb6a7e2bced540475bbf3e54712a930fb517fdfd5adb4d56cea07 ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -message(STATUS "Patching JavascriptPromise.cpp for https://github.com/Microsoft/ChakraCore/issues/1429") -vcpkg_execute_required_process( - COMMAND ${POWERSHELL} -command (gc lib/runtime/library/JavascriptPromise.cpp -encoding utf7) -replace('«', '^<^<') -replace('»', '^>^>') | Set-Content lib/runtime/library/JavascriptPromise.cpp - WORKING_DIRECTORY ${SOURCE_PATH} -) -message(STATUS "Patching done.") - vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/Build/Chakra.Core.sln ) -- cgit v1.2.3 From 59a879be2b99dc0e9aff31ce4e2709f533a2f892 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 10 Nov 2016 15:50:57 +0800 Subject: [chakracore] Delete useless code: find_program(powershell). --- ports/chakracore/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/chakracore/portfile.cmake b/ports/chakracore/portfile.cmake index b937b17b4..bdba23809 100644 --- a/ports/chakracore/portfile.cmake +++ b/ports/chakracore/portfile.cmake @@ -3,7 +3,6 @@ set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -find_program(POWERSHELL powershell) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ChakraCore-1.3.0) vcpkg_download_distfile(ARCHIVE_FILE -- cgit v1.2.3 From 22f681c82d584a9962a0133ef086326f41df9cc1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 00:04:44 -0800 Subject: Make crt search case insensitive --- toolsrc/src/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 4b533ca8f..5fcf8ac09 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -16,7 +16,7 @@ namespace vcpkg const std::regex& BuildType::crt_regex() const { - static const std::regex r(this->m_crt_regex_as_string); + static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); return r; } -- cgit v1.2.3 From eb7ca47d4839a6bf8cea36cba8507750cd5d7746 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 11:04:33 -0800 Subject: Add checks for outdated crts --- toolsrc/include/BuildInfo.h | 42 +++++++++++++++++++++++++++++++----- toolsrc/src/BuildInfo.cpp | 21 +++++++++++++++++- toolsrc/src/post_build_lint.cpp | 47 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 6 deletions(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 235c83837..5a85d92d8 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -36,11 +36,6 @@ namespace vcpkg static const BuildType RELEASE_STATIC; static const BuildType RELEASE_DYNAMIC; - static constexpr int length() - { - return 4; - } - static const std::vector& values() { static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; @@ -69,6 +64,43 @@ namespace vcpkg bool operator !=(const BuildType& lhs, const BuildType& rhs); + struct OutdatedDynamicCrt + { + 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; + + 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 + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + const 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; + }; + struct BuildInfo { static BuildInfo create(const std::unordered_map& pgh); diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index 5fcf8ac09..f262df56f 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -87,7 +87,6 @@ namespace vcpkg } std::string to_string(const ConfigurationType& conf) - { switch (conf) { @@ -132,4 +131,24 @@ namespace vcpkg return BuildInfo::create(pghs[0]); } + + 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 std::regex& OutdatedDynamicCrt::crt_regex() const + { + static 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/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index c7bdf7d21..1a5f22f0a 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -535,6 +535,51 @@ namespace vcpkg return lint_status::SUCCESS; } + struct OutdatedDynamicCrt_and_file + { + fs::path file; + OutdatedDynamicCrt outdated_crt; + }; + + static lint_status check_outdated_crt_linkage_of_dlls(const std::vector& dlls) + { + const std::vector outdated_crts = OutdatedDynamicCrt::values(); + + std::vector dlls_with_outdated_crt; + + for (const fs::path& dll : dlls) + { + const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", DUMPBIN_EXE.native(), dll.native()); + System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + Checks::check_exit(ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); + + for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) + { + if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.crt_regex())) + { + dlls_with_outdated_crt.push_back({dll, outdated_crt}); + break; + } + } + } + + if (!dlls_with_outdated_crt.empty()) + { + System::println(System::color::warning, "Detected outdated dynamic CRT in the following files:"); + 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(""); + + System::println(System::color::warning, "To inspect the dll files, use:\n dumpbin.exe /dependents mydllfile.dll"); + return lint_status::ERROR_DETECTED; + } + + return lint_status::SUCCESS; + } + static void operator +=(size_t& left, const lint_status& right) { left += static_cast(right); @@ -584,6 +629,8 @@ namespace vcpkg error_count += check_exports_of_dlls(dlls); error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls); error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls); + + error_count += check_outdated_crt_linkage_of_dlls(dlls); break; } case LinkageType::STATIC: -- cgit v1.2.3 From ea6ac1bd453ae940913bff930d88c0240125a0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 11 Nov 2016 01:11:31 +0100 Subject: [zeromq] Fix source path --- ports/zeromq/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zeromq/portfile.cmake b/ports/zeromq/portfile.cmake index f27738488..9abd4ed74 100644 --- a/ports/zeromq/portfile.cmake +++ b/ports/zeromq/portfile.cmake @@ -1,5 +1,5 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libzmq-1a02b1b3f2fde6288579cbb0ff9a0b1f195e1812) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/zeromq-4.2.0) vcpkg_download_distfile(ARCHIVE URLS "https://github.com/zeromq/libzmq/releases/download/v4.2.0/zeromq-4.2.0.tar.gz" FILENAME "zeromq-4.2.0.tar.gz" -- cgit v1.2.3 From d852d3b6f230a55878d7be26fba210cfc67689d1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 16:28:10 -0800 Subject: Add more blacklisted outdated crts --- toolsrc/include/BuildInfo.h | 20 +++++++++++++++++++- toolsrc/src/BuildInfo.cpp | 10 ++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 5a85d92d8..22b4bed7d 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -66,6 +66,7 @@ namespace vcpkg struct OutdatedDynamicCrt { + // Old CPP static const OutdatedDynamicCrt MSVCP100_DLL; static const OutdatedDynamicCrt MSVCP100D_DLL; static const OutdatedDynamicCrt MSVCP110_DLL; @@ -75,13 +76,30 @@ namespace vcpkg 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 + 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; } diff --git a/toolsrc/src/BuildInfo.cpp b/toolsrc/src/BuildInfo.cpp index f262df56f..1f802869f 100644 --- a/toolsrc/src/BuildInfo.cpp +++ b/toolsrc/src/BuildInfo.cpp @@ -141,6 +141,16 @@ namespace vcpkg 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)");; + const std::regex& OutdatedDynamicCrt::crt_regex() const { static const std::regex r(this->m_crt_regex_as_string, std::regex_constants::icase); -- cgit v1.2.3