diff options
| author | Phil Christensen <philc@microsoft.com> | 2018-12-04 14:05:12 -0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2018-12-04 14:05:12 -0800 |
| commit | e712374b2831c4d04fc3b37373ed5cf041a3713e (patch) | |
| tree | 3c1be3898e52d0e01cfc842be7ea553e8fe0bafb /toolsrc | |
| parent | 7f80cbdeb02a126a610f3a3262eaefa9c9f9b938 (diff) | |
| parent | f6d32cc644a6f0fb9adb1bb3c3fd4905e8d61e2e (diff) | |
| download | vcpkg-e712374b2831c4d04fc3b37373ed5cf041a3713e.tar.gz vcpkg-e712374b2831c4d04fc3b37373ed5cf041a3713e.zip | |
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4889
Diffstat (limited to 'toolsrc')
23 files changed, 356 insertions, 228 deletions
diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt index 6833d4427..ce62ec959 100644 --- a/toolsrc/VERSION.txt +++ b/toolsrc/VERSION.txt @@ -1 +1 @@ -"0.0.113"
\ No newline at end of file +"2018.11.23"
\ No newline at end of file diff --git a/toolsrc/dirs.proj b/toolsrc/dirs.proj index 17d9fa1b0..7729c9897 100644 --- a/toolsrc/dirs.proj +++ b/toolsrc/dirs.proj @@ -3,8 +3,8 @@ <SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir> </PropertyGroup> <ItemGroup> - <ProjectFile Include="vcpkg\vcpkg.vcxproj"/> <ProjectFile Include="vcpkglib\vcpkglib.vcxproj"/> + <ProjectFile Include="vcpkg\vcpkg.vcxproj"/> <ProjectFile Include="vcpkgmetricsuploader\vcpkgmetricsuploader.vcxproj"/> </ItemGroup> diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index 7266fbbc6..65ce02b99 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -72,18 +72,6 @@ namespace vcpkg::Util } template<class Container, class Pred> - void stable_keep_if(Container& cont, Pred pred) - { - cont.erase(std::stable_partition(cont.begin(), cont.end(), pred), cont.end()); - } - - template<class Container, class Pred> - void unstable_keep_if(Container& cont, Pred pred) - { - cont.erase(std::partition(cont.begin(), cont.end(), pred), cont.end()); - } - - template<class Container, class Pred> void erase_remove_if(Container& cont, Pred pred) { cont.erase(std::remove_if(cont.begin(), cont.end(), pred), cont.end()); diff --git a/toolsrc/src/vcpkg/base/downloads.cpp b/toolsrc/src/vcpkg/base/downloads.cpp index 1d7b3527d..571562244 100644 --- a/toolsrc/src/vcpkg/base/downloads.cpp +++ b/toolsrc/src/vcpkg/base/downloads.cpp @@ -42,6 +42,28 @@ namespace vcpkg::Downloads 0); Checks::check_exit(VCPKG_LINE_INFO, hSession, "WinHttpOpen() failed: %d", GetLastError()); + // Win7 IE Proxy fallback + if (IsWindows7OrGreater() && !IsWindows8Point1OrGreater()) { + // First check if any proxy has been found automatically + WINHTTP_PROXY_INFO proxyInfo;
+ DWORD proxyInfoSize = sizeof(WINHTTP_PROXY_INFO);
+ auto noProxyFound =
+ !WinHttpQueryOption(hSession, WINHTTP_OPTION_PROXY, &proxyInfo, &proxyInfoSize)
+ || proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NO_PROXY;
+
+ // If no proxy was found automatically, use IE's proxy settings, if any
+ if (noProxyFound) { + WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ieProxy; + if (WinHttpGetIEProxyConfigForCurrentUser(&ieProxy) && ieProxy.lpszProxy != nullptr) { + WINHTTP_PROXY_INFO proxy; + proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; + proxy.lpszProxy = ieProxy.lpszProxy; + proxy.lpszProxyBypass = ieProxy.lpszProxyBypass; + WinHttpSetOption(hSession, WINHTTP_OPTION_PROXY, &proxy, sizeof(proxy)); + } + } + } + // Use Windows 10 defaults on Windows 7 DWORD secure_protocols(WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2); @@ -102,7 +124,17 @@ namespace vcpkg::Downloads const fs::path& path, const std::string& sha512) { - const std::string actual_hash = vcpkg::Hash::get_file_hash(fs, path, "SHA512"); + std::string actual_hash = vcpkg::Hash::get_file_hash(fs, path, "SHA512"); + + // <HACK to handle NuGet.org changing nupkg hashes.> + // This is the NEW hash for 7zip + if (actual_hash == "a9dfaaafd15d98a2ac83682867ec5766720acf6e99d40d1a00d480692752603bf3f3742623f0ea85647a92374df" + "405f331afd6021c5cf36af43ee8db198129c0") + // This is the OLD hash for 7zip + actual_hash = "8c75314102e68d2b2347d592f8e3eb05812e1ebb525decbac472231633753f1d4ca31c8e6881a36144a8da26b257" + "1305b3ae3f4e2b85fc4a290aeda63d1a13b8"; + // </HACK> + Checks::check_exit(VCPKG_LINE_INFO, sha512 == actual_hash, "File does not have the expected hash:\n" diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index 31bd8d05e..7a74371db 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -174,21 +174,14 @@ namespace vcpkg::Hash return hash_type.substr(3, hash_type.length() - 3); } - static std::string run_shasum_and_post_process(const std::string& cmd_line) + static std::string parse_shasum_output(const std::string& shasum_output) { - const auto ec_data = System::cmd_execute_and_capture_output(cmd_line); - Checks::check_exit(VCPKG_LINE_INFO, - ec_data.exit_code == 0, - "Failed to run:\n" - " %s", - cmd_line); - - std::vector<std::string> split = Strings::split(ec_data.output, " "); + std::vector<std::string> split = Strings::split(shasum_output, " "); Checks::check_exit(VCPKG_LINE_INFO, split.size() == 3, "Expected output of the form [hash filename\n] (3 tokens), but got\n" "[%s] (%s tokens)", - ec_data.output, + shasum_output, std::to_string(split.size())); return split[0]; @@ -198,8 +191,28 @@ namespace vcpkg::Hash { const std::string digest_size = get_digest_size(hash_type); Checks::check_exit(VCPKG_LINE_INFO, fs.exists(path), "File %s does not exist", path.u8string()); - const std::string cmd_line = Strings::format(R"(shasum -a %s "%s")", digest_size, path.u8string()); - return run_shasum_and_post_process(cmd_line); + + // Try hash-specific tools, like sha512sum + { + const auto ec_data = System::cmd_execute_and_capture_output( + Strings::format(R"(sha%ssum "%s")", digest_size, path.u8string())); + if (ec_data.exit_code == 0) + { + return parse_shasum_output(ec_data.output); + } + } + + // Try shasum + { + const auto ec_data = System::cmd_execute_and_capture_output( + Strings::format(R"(shasum -a %s "%s")", digest_size, path.u8string())); + if (ec_data.exit_code == 0) + { + return parse_shasum_output(ec_data.output); + } + } + + Checks::exit_with_message(VCPKG_LINE_INFO, "Could not hash file %s with %s", path.u8string(), hash_type); } std::string get_string_hash(const std::string& s, const std::string& hash_type) @@ -207,8 +220,27 @@ namespace vcpkg::Hash const std::string digest_size = get_digest_size(hash_type); verify_has_only_allowed_chars(s); - const std::string cmd_line = Strings::format(R"(echo -n "%s" | shasum -a %s)", s, digest_size); - return run_shasum_and_post_process(cmd_line); + // Try hash-specific tools, like sha512sum + { + const auto ec_data = + System::cmd_execute_and_capture_output(Strings::format(R"(echo -n "%s" | sha%ssum)", s, digest_size)); + if (ec_data.exit_code == 0) + { + return parse_shasum_output(ec_data.output); + } + } + + // Try shasum + { + const auto ec_data = System::cmd_execute_and_capture_output( + Strings::format(R"(echo -n "%s" | shasum -a %s)", s, digest_size)); + if (ec_data.exit_code == 0) + { + return parse_shasum_output(ec_data.output); + } + } + + Checks::exit_with_message(VCPKG_LINE_INFO, "Could not hash input string with %s", hash_type); } #endif } diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp index d95752bba..9c72f8401 100644 --- a/toolsrc/src/vcpkg/base/system.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -117,10 +117,7 @@ namespace vcpkg::System } #if defined(_WIN32) - static void windows_create_clean_process(const CStringView cmd_line, - const std::unordered_map<std::string, std::string>& extra_env, - PROCESS_INFORMATION& process_info, - DWORD dwCreationFlags) noexcept + static std::wstring compute_clean_environment(const std::unordered_map<std::string, std::string>& extra_env) { static const std::string SYSTEM_ROOT = get_environment_variable("SystemRoot").value_or_exit(VCPKG_LINE_INFO); static const std::string SYSTEM_32 = SYSTEM_ROOT + R"(\system32)"; @@ -171,11 +168,10 @@ namespace vcpkg::System L"CUDA_PATH", // Environmental variable generated automatically by CUDA after installation L"NVCUDASAMPLES_ROOT", + // Enables find_package(Vulkan) in CMake. Environmental variable generated by Vulkan SDK installer + L"VULKAN_SDK", }; - // Flush stdout before launching external process - fflush(nullptr); - std::wstring env_cstr; for (auto&& env_wstring : env_wstrings) @@ -206,10 +202,27 @@ namespace vcpkg::System env_cstr.push_back(L'\0'); } + return env_cstr; + } +#endif + +#if defined(_WIN32) + /// <param name="maybe_environment">If non-null, an environment block to use for the new process. If null, the new + /// process will inherit the current environment.</param> + static void windows_create_process(const CStringView cmd_line, + const wchar_t* maybe_environment, + DWORD dwCreationFlags, + PROCESS_INFORMATION* process_info) noexcept + { + Checks::check_exit(VCPKG_LINE_INFO, process_info != nullptr); + STARTUPINFOW startup_info; memset(&startup_info, 0, sizeof(STARTUPINFOW)); startup_info.cb = sizeof(STARTUPINFOW); + // Flush stdout before launching external process + fflush(nullptr); + // Wrapping the command in a single set of quotes causes cmd.exe to correctly execute const std::string actual_cmd_line = Strings::format(R"###(cmd.exe /c "%s")###", cmd_line); Debug::println("CreateProcessW(%s)", actual_cmd_line); @@ -219,10 +232,10 @@ namespace vcpkg::System nullptr, FALSE, IDLE_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT | dwCreationFlags, - env_cstr.data(), + (void*)maybe_environment, nullptr, &startup_info, - &process_info); + process_info); Checks::check_exit(VCPKG_LINE_INFO, succeeded, "Process creation failed with error code: %lu", GetLastError()); } @@ -236,7 +249,7 @@ namespace vcpkg::System PROCESS_INFORMATION process_info; memset(&process_info, 0, sizeof(PROCESS_INFORMATION)); - windows_create_clean_process(cmd_line, {}, process_info, DETACHED_PROCESS); + windows_create_process(cmd_line, nullptr, DETACHED_PROCESS, &process_info); CloseHandle(process_info.hThread); CloseHandle(process_info.hProcess); @@ -255,7 +268,8 @@ namespace vcpkg::System memset(&process_info, 0, sizeof(PROCESS_INFORMATION)); GlobalState::g_ctrl_c_state.transition_to_spawn_process(); - windows_create_clean_process(cmd_line, extra_env, process_info, NULL); + auto clean_env = compute_clean_environment(extra_env); + windows_create_process(cmd_line, clean_env.c_str(), NULL, &process_info); CloseHandle(process_info.hThread); diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 7569f340f..0e60fd50e 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -63,7 +63,7 @@ namespace vcpkg::Build::Command spec.name()); const StatusParagraphs status_db = database_load_check(paths); - const Build::BuildPackageOptions build_package_options { + const Build::BuildPackageOptions build_package_options{ Build::UseHeadVersion::NO, Build::AllowDownloads::YES, Build::CleanBuildtrees::NO, @@ -76,8 +76,8 @@ namespace vcpkg::Build::Command std::set<std::string> features_as_set(full_spec.features.begin(), full_spec.features.end()); features_as_set.emplace("core"); - const Build::BuildPackageConfig build_config { - *scf, spec.triplet(), fs::path {port_dir}, build_package_options, features_as_set}; + const Build::BuildPackageConfig build_config{ + *scf, spec.triplet(), fs::path{port_dir}, build_package_options, features_as_set}; const auto build_timer = Chrono::ElapsedTimer::create_started(); const auto result = Build::build_package(paths, build_config, status_db); @@ -468,24 +468,24 @@ namespace vcpkg::Build const Triplet& triplet = config.triplet; const std::string& name = config.scf.core_paragraph->name; - std::vector<AbiEntry> abi_tag_entries; + std::vector<AbiEntry> abi_tag_entries(dependency_abis.begin(), dependency_abis.end()); - abi_tag_entries.emplace_back(AbiEntry {"cmake", paths.get_tool_version(Tools::CMAKE)}); - - abi_tag_entries.insert(abi_tag_entries.end(), dependency_abis.begin(), dependency_abis.end()); + abi_tag_entries.emplace_back(AbiEntry{"cmake", paths.get_tool_version(Tools::CMAKE)}); abi_tag_entries.emplace_back( - AbiEntry {"portfile", vcpkg::Hash::get_file_hash(fs, config.port_dir / "portfile.cmake", "SHA1")}); + AbiEntry{"portfile", vcpkg::Hash::get_file_hash(fs, config.port_dir / "portfile.cmake", "SHA1")}); abi_tag_entries.emplace_back( - AbiEntry {"control", vcpkg::Hash::get_file_hash(fs, config.port_dir / "CONTROL", "SHA1")}); + AbiEntry{"control", vcpkg::Hash::get_file_hash(fs, config.port_dir / "CONTROL", "SHA1")}); + + abi_tag_entries.emplace_back(AbiEntry{"vcpkg_fixup_cmake_targets", "1"}); - abi_tag_entries.emplace_back(AbiEntry {"triplet", pre_build_info.triplet_abi_tag}); + abi_tag_entries.emplace_back(AbiEntry{"triplet", pre_build_info.triplet_abi_tag}); const std::string features = Strings::join(";", config.feature_list); - abi_tag_entries.emplace_back(AbiEntry {"features", features}); + abi_tag_entries.emplace_back(AbiEntry{"features", features}); if (config.build_package_options.use_head_version == UseHeadVersion::YES) - abi_tag_entries.emplace_back(AbiEntry {"head", ""}); + abi_tag_entries.emplace_back(AbiEntry{"head", ""}); Util::sort(abi_tag_entries); @@ -503,7 +503,7 @@ namespace vcpkg::Build } auto abi_tag_entries_missing = abi_tag_entries; - Util::stable_keep_if(abi_tag_entries_missing, [](const AbiEntry& p) { return p.value.empty(); }); + Util::erase_remove_if(abi_tag_entries_missing, [](const AbiEntry& p) { return !p.value.empty(); }); if (abi_tag_entries_missing.empty()) { @@ -512,7 +512,7 @@ namespace vcpkg::Build const auto abi_file_path = paths.buildtrees / name / (triplet.canonical_name() + ".vcpkg_abi_info.txt"); fs.write_contents(abi_file_path, full_abi_info); - return AbiTagAndFile {Hash::get_file_hash(fs, abi_file_path, "SHA1"), abi_file_path}; + return AbiTagAndFile{Hash::get_file_hash(fs, abi_file_path, "SHA1"), abi_file_path}; } System::println( @@ -581,8 +581,8 @@ namespace vcpkg::Build Util::sort_unique_erase(dep_pspecs); // Find all features that aren't installed. This mutates required_fspecs. - Util::unstable_keep_if(required_fspecs, [&](FeatureSpec const& fspec) { - return !status_db.is_installed(fspec) && fspec.name() != name; + Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) { + return status_db.is_installed(fspec) || fspec.name() == name; }); if (!required_fspecs.empty()) @@ -602,7 +602,7 @@ namespace vcpkg::Build const auto status_it = status_db.find_installed(pspec); Checks::check_exit(VCPKG_LINE_INFO, status_it != status_db.end()); dependency_abis.emplace_back( - AbiEntry {status_it->get()->package.spec.name(), status_it->get()->package.abi}); + AbiEntry{status_it->get()->package.spec.name(), status_it->get()->package.abi}); } const auto pre_build_info = PreBuildInfo::from_triplet_file(paths, triplet); @@ -648,7 +648,7 @@ namespace vcpkg::Build System::println("Could not locate cached archive: %s", archive_path.u8string()); ExtendedBuildResult result = do_build_package_and_clean_buildtrees( - paths, pre_build_info, spec, maybe_abi_tag_and_file.value_or(AbiTagAndFile {}).tag, config); + paths, pre_build_info, spec, maybe_abi_tag_and_file.value_or(AbiTagAndFile{}).tag, config); std::error_code ec; fs.create_directories(paths.package_dir(spec) / "share" / spec.name(), ec); @@ -685,7 +685,7 @@ namespace vcpkg::Build } return do_build_package_and_clean_buildtrees( - paths, pre_build_info, spec, maybe_abi_tag_and_file.value_or(AbiTagAndFile {}).tag, config); + paths, pre_build_info, spec, maybe_abi_tag_and_file.value_or(AbiTagAndFile{}).tag, config); } const std::string& to_string(const BuildResult build_result) @@ -850,21 +850,21 @@ namespace vcpkg::Build if (variable_name == "VCPKG_PLATFORM_TOOLSET") { pre_build_info.platform_toolset = - variable_value.empty() ? nullopt : Optional<std::string> {variable_value}; + variable_value.empty() ? nullopt : Optional<std::string>{variable_value}; continue; } if (variable_name == "VCPKG_VISUAL_STUDIO_PATH") { pre_build_info.visual_studio_path = - variable_value.empty() ? nullopt : Optional<fs::path> {variable_value}; + variable_value.empty() ? nullopt : Optional<fs::path>{variable_value}; continue; } if (variable_name == "VCPKG_CHAINLOAD_TOOLCHAIN_FILE") { pre_build_info.external_toolchain_file = - variable_value.empty() ? nullopt : Optional<std::string> {variable_value}; + variable_value.empty() ? nullopt : Optional<std::string>{variable_value}; continue; } diff --git a/toolsrc/src/vcpkg/commands.autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp index 564404421..3b353feec 100644 --- a/toolsrc/src/vcpkg/commands.autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -40,26 +40,25 @@ namespace vcpkg::Commands::Autocomplete const std::string requested_command = match[1].str(); // First try public commands - std::vector<std::string> public_commands = { - "install", - "search", - "remove", - "list", - "update", - "hash", - "help", - "integrate", - "export", - "edit", - "create", - "owns", - "cache", - "version", - "contact", - }; - - Util::unstable_keep_if(public_commands, [&](const std::string& s) { - return Strings::case_insensitive_ascii_starts_with(s, requested_command); + std::vector<std::string> public_commands = {"install", + "search", + "remove", + "list", + "update", + "hash", + "help", + "integrate", + "export", + "edit", + "create", + "owns", + "cache", + "version", + "contact", + "upgrade"}; + + Util::erase_remove_if(public_commands, [&](const std::string& s) { + return !Strings::case_insensitive_ascii_starts_with(s, requested_command); }); if (!public_commands.empty()) @@ -78,8 +77,8 @@ namespace vcpkg::Commands::Autocomplete "portsdiff", }; - Util::unstable_keep_if(private_commands, [&](const std::string& s) { - return Strings::case_insensitive_ascii_starts_with(s, requested_command); + Util::erase_remove_if(private_commands, [&](const std::string& s) { + return !Strings::case_insensitive_ascii_starts_with(s, requested_command); }); output_sorted_results_and_exit(VCPKG_LINE_INFO, std::move(private_commands)); @@ -98,8 +97,8 @@ namespace vcpkg::Commands::Autocomplete } std::vector<std::string> triplets = paths.get_available_triplets(); - Util::unstable_keep_if(triplets, [&](const std::string& s) { - return Strings::case_insensitive_ascii_starts_with(s, triplet_prefix); + Util::erase_remove_if(triplets, [&](const std::string& s) { + return !Strings::case_insensitive_ascii_starts_with(s, triplet_prefix); }); auto result = combine_port_with_triplets(port_name, triplets); @@ -124,6 +123,7 @@ namespace vcpkg::Commands::Autocomplete CommandEntry{"edit", R"###(^edit\s(.*\s|)(\S*)$)###", Edit::COMMAND_STRUCTURE}, CommandEntry{"remove", R"###(^remove\s(.*\s|)(\S*)$)###", Remove::COMMAND_STRUCTURE}, CommandEntry{"integrate", R"###(^integrate(\s+)(\S*)$)###", Integrate::COMMAND_STRUCTURE}, + CommandEntry{"upgrade", R"###(^upgrade(\s+)(\S*)$)###", Upgrade::COMMAND_STRUCTURE}, }; for (auto&& command : COMMANDS) @@ -150,8 +150,8 @@ namespace vcpkg::Commands::Autocomplete } } - Util::unstable_keep_if(results, [&](const std::string& s) { - return Strings::case_insensitive_ascii_starts_with(s, prefix); + Util::erase_remove_if(results, [&](const std::string& s) { + return !Strings::case_insensitive_ascii_starts_with(s, prefix); }); if (command.name == "install" && results.size() == 1 && !is_option) diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp index 59a07cce2..551eee27b 100644 --- a/toolsrc/src/vcpkg/commands.ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -28,6 +28,7 @@ namespace vcpkg::Commands::CI static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run"; static constexpr StringLiteral OPTION_EXCLUDE = "--exclude"; + static constexpr StringLiteral OPTION_PURGE_TOMBSTONES = "--purge-tombstones"; static constexpr StringLiteral OPTION_XUNIT = "--x-xunit"; static constexpr std::array<CommandSetting, 2> CI_SETTINGS = {{ @@ -35,8 +36,10 @@ namespace vcpkg::Commands::CI {OPTION_XUNIT, "File to output results in XUnit format (internal)"}, }}; - static constexpr std::array<CommandSwitch, 1> CI_SWITCHES = { - {{OPTION_DRY_RUN, "Print out plan without execution"}}}; + static constexpr std::array<CommandSwitch, 2> CI_SWITCHES = {{ + {OPTION_DRY_RUN, "Print out plan without execution"}, + {OPTION_PURGE_TOMBSTONES, "Purge failure tombstones and retry building the ports"}, + }}; const CommandStructure COMMAND_STRUCTURE = { Help::create_example_string("ci x64-windows"), @@ -56,7 +59,8 @@ namespace vcpkg::Commands::CI static UnknownCIPortsResults find_unknown_ports_for_ci(const VcpkgPaths& paths, const std::set<std::string>& exclusions, const Dependencies::PortFileProvider& provider, - const std::vector<FeatureSpec>& fspecs) + const std::vector<FeatureSpec>& fspecs, + const bool purge_tombstones) { UnknownCIPortsResults ret; @@ -77,7 +81,7 @@ namespace vcpkg::Commands::CI vcpkg::Cache<Triplet, Build::PreBuildInfo> pre_build_info_cache; - auto action_plan = Dependencies::create_feature_install_plan(provider, fspecs, StatusParagraphs{}); + auto action_plan = Dependencies::create_feature_install_plan(provider, fspecs, StatusParagraphs {}); for (auto&& action : action_plan) { @@ -89,7 +93,7 @@ namespace vcpkg::Commands::CI { auto triplet = p->spec.triplet(); - const Build::BuildPackageConfig build_config{ + const Build::BuildPackageConfig build_config { *scf, triplet, paths.port_dir(p->spec), install_plan_options, p->feature_list}; auto dependency_abis = @@ -126,9 +130,16 @@ namespace vcpkg::Commands::CI auto archive_path = archives_root_dir / archive_subpath; auto archive_tombstone_path = archives_root_dir / "fail" / archive_subpath; + if (purge_tombstones) + { + std::error_code ec; + fs.remove(archive_tombstone_path, ec); // Ignore error + } + bool b_will_build = false; - ret.features.emplace(p->spec, std::vector<std::string>{p->feature_list.begin(), p->feature_list.end()}); + ret.features.emplace(p->spec, + std::vector<std::string> {p->feature_list.begin(), p->feature_list.end()}); if (Util::Sets::contains(exclusions, p->spec.name())) { @@ -183,7 +194,8 @@ namespace vcpkg::Commands::CI exclusions_set.insert(exclusions.begin(), exclusions.end()); } - auto is_dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); + const auto is_dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); + const auto purge_tombstones = Util::Sets::contains(options.switches, OPTION_PURGE_TOMBSTONES); std::vector<Triplet> triplets; for (const std::string& triplet : args.command_arguments) @@ -222,7 +234,8 @@ namespace vcpkg::Commands::CI std::vector<PackageSpec> specs = PackageSpec::to_package_specs(all_ports, triplet); // Install the default features for every package auto all_fspecs = Util::fmap(specs, [](auto& spec) { return FeatureSpec(spec, ""); }); - auto split_specs = find_unknown_ports_for_ci(paths, exclusions_set, paths_port_file, all_fspecs); + auto split_specs = + find_unknown_ports_for_ci(paths, exclusions_set, paths_port_file, all_fspecs, purge_tombstones); auto fspecs = FullPackageSpec::to_feature_specs(split_specs.unknown); for (auto&& fspec : fspecs) @@ -292,7 +305,7 @@ namespace vcpkg::Commands::CI for (auto&& result : known_result) { xunit_doc += - Install::InstallSummary::xunit_result(result.first, Chrono::ElapsedTime{}, result.second); + Install::InstallSummary::xunit_result(result.first, Chrono::ElapsedTime {}, result.second); } } diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp index 237feebdd..044ae1c47 100644 --- a/toolsrc/src/vcpkg/commands.edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -64,14 +64,29 @@ namespace vcpkg::Commands::Edit { if (Util::Sets::contains(options.switches, OPTION_ALL)) { + const auto& fs = paths.get_filesystem(); + auto packages = fs.get_files_non_recursive(paths.packages); + return Util::fmap(ports, [&](const std::string& port_name) -> std::string { const auto portpath = paths.ports / port_name; const auto portfile = portpath / "portfile.cmake"; const auto buildtrees_current_dir = paths.buildtrees / port_name; - return Strings::format(R"###("%s" "%s" "%s")###", + const auto pattern = port_name + "_"; + + std::string package_paths; + for (auto&& package : packages) + { + if (Strings::case_insensitive_ascii_starts_with(package.filename().u8string(), pattern)) + { + package_paths.append(Strings::format(" \"%s\"", package.u8string())); + } + } + + return Strings::format(R"###("%s" "%s" "%s"%s)###", portpath.u8string(), portfile.u8string(), - buildtrees_current_dir.u8string()); + buildtrees_current_dir.u8string(), + package_paths); }); } @@ -92,9 +107,6 @@ namespace vcpkg::Commands::Edit void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - static const fs::path VS_CODE_INSIDERS = fs::path {"Microsoft VS Code Insiders"} / "Code - Insiders.exe"; - static const fs::path VS_CODE = fs::path {"Microsoft VS Code"} / "Code.exe"; - auto& fs = paths.get_filesystem(); const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); @@ -114,6 +126,10 @@ namespace vcpkg::Commands::Edit candidate_paths.emplace_back(*editor_path); } +#ifdef _WIN32 + static const fs::path VS_CODE_INSIDERS = fs::path{"Microsoft VS Code Insiders"} / "Code - Insiders.exe"; + static const fs::path VS_CODE = fs::path{"Microsoft VS Code"} / "Code.exe"; + const auto& program_files = System::get_program_files_platform_bitness(); if (const fs::path* pf = program_files.get()) { @@ -131,13 +147,17 @@ namespace vcpkg::Commands::Edit const auto& app_data = System::get_environment_variable("APPDATA"); if (const auto* ad = app_data.get()) { - const fs::path default_base = fs::path {*ad}.parent_path() / "Local" / "Programs"; + const fs::path default_base = fs::path{*ad}.parent_path() / "Local" / "Programs"; candidate_paths.push_back(default_base / VS_CODE_INSIDERS); candidate_paths.push_back(default_base / VS_CODE); } const std::vector<fs::path> from_registry = find_from_registry(); candidate_paths.insert(candidate_paths.end(), from_registry.cbegin(), from_registry.cend()); +#elif defined(__APPLE__) + candidate_paths.push_back(fs::path{"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code"}); + candidate_paths.push_back(fs::path{"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"}); +#endif const auto it = Util::find_if(candidate_paths, [&](const fs::path& p) { return fs.exists(p); }); if (it == candidate_paths.cend()) diff --git a/toolsrc/src/vcpkg/dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp index 8fb35b0da..60c43e4a8 100644 --- a/toolsrc/src/vcpkg/dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -488,26 +488,23 @@ namespace vcpkg::Dependencies if (plus) return MarkPlusResult::SUCCESS; plus = true; + auto p_source = cluster.source.get(); + Checks::check_exit(VCPKG_LINE_INFO, + p_source != nullptr, + "Error: Cannot find definition for package `%s`.", + cluster.spec.name()); + if (feature.empty()) { // Add default features for this package. This is an exact reference, so ignore prevent_default_features. - if (auto p_source = cluster.source.get()) + for (auto&& default_feature : p_source->scf->core_paragraph.get()->default_features) { - for (auto&& default_feature : p_source->scf->core_paragraph.get()->default_features) + auto res = mark_plus(default_feature, cluster, graph, graph_plan, prevent_default_features); + if (res != MarkPlusResult::SUCCESS) { - auto res = mark_plus(default_feature, cluster, graph, graph_plan, prevent_default_features); - if (res != MarkPlusResult::SUCCESS) - { - return res; - } + return res; } } - else - { - Checks::exit_with_message(VCPKG_LINE_INFO, - "Error: Unable to install default features because can't find CONTROL for %s", - cluster.spec); - } // "core" is always required. return mark_plus("core", cluster, graph, graph_plan, prevent_default_features); @@ -515,28 +512,20 @@ namespace vcpkg::Dependencies if (feature == "*") { - if (auto p_source = cluster.source.get()) + for (auto&& fpgh : p_source->scf->feature_paragraphs) { - for (auto&& fpgh : p_source->scf->feature_paragraphs) - { - auto res = mark_plus(fpgh->name, cluster, graph, graph_plan, prevent_default_features); + auto res = mark_plus(fpgh->name, cluster, graph, graph_plan, prevent_default_features); - Checks::check_exit(VCPKG_LINE_INFO, - res == MarkPlusResult::SUCCESS, - "Error: Unable to locate feature %s in %s", - fpgh->name, - cluster.spec); - } + Checks::check_exit(VCPKG_LINE_INFO, + res == MarkPlusResult::SUCCESS, + "Error: Internal error while installing feature %s in %s", + fpgh->name, + cluster.spec); + } - auto res = mark_plus("core", cluster, graph, graph_plan, prevent_default_features); + auto res = mark_plus("core", cluster, graph, graph_plan, prevent_default_features); - Checks::check_exit(VCPKG_LINE_INFO, res == MarkPlusResult::SUCCESS); - } - else - { - Checks::exit_with_message( - VCPKG_LINE_INFO, "Error: Unable to handle '*' because can't find CONTROL for %s", cluster.spec); - } + Checks::check_exit(VCPKG_LINE_INFO, res == MarkPlusResult::SUCCESS); return MarkPlusResult::SUCCESS; } @@ -643,7 +632,7 @@ namespace vcpkg::Dependencies } /// <summary>Figure out which actions are required to install features specifications in `specs`.</summary> - /// <param name="map">Map of all source files in the current environment.</param> + /// <param name="map">Map of all source control files in the current environment.</param> /// <param name="specs">Feature specifications to resolve dependencies for.</param> /// <param name="status_db">Status of installed packages in the current environment.</param> std::vector<AnyAction> create_feature_install_plan(const std::unordered_map<std::string, SourceControlFile>& map, @@ -666,7 +655,11 @@ namespace vcpkg::Dependencies auto res = mark_plus(spec.feature(), spec_cluster, *m_graph, *m_graph_plan, prevent_default_features); - Checks::check_exit(VCPKG_LINE_INFO, res == MarkPlusResult::SUCCESS, "Error: Unable to locate feature %s", spec); + Checks::check_exit(VCPKG_LINE_INFO, + res == MarkPlusResult::SUCCESS, + "Error: `%s` is not a feature of package `%s`", + spec.feature(), + spec.name()); m_graph_plan->install_graph.add_vertex(ClusterPtr{&spec_cluster}); } diff --git a/toolsrc/src/vcpkg/help.cpp b/toolsrc/src/vcpkg/help.cpp index 2b409373d..5df878a91 100644 --- a/toolsrc/src/vcpkg/help.cpp +++ b/toolsrc/src/vcpkg/help.cpp @@ -116,6 +116,8 @@ namespace vcpkg::Help " --vcpkg-root <path> Specify the vcpkg root directory\n" " (default: " ENVVAR(VCPKG_ROOT) ")\n" "\n" + " @response_file Specify a response file to provide additional parameters\n" + "\n" "For more help (including examples) see the accompanying README.md.", Commands::Integrate::INTEGRATE_COMMAND_HELPSTRING); } diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp index 90dcb7d64..650b6e3c9 100644 --- a/toolsrc/src/vcpkg/postbuildlint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -16,9 +16,9 @@ using vcpkg::Build::PreBuildInfo; namespace vcpkg::PostBuildLint { - static auto has_extension_pred(const Files::Filesystem& fs, const std::string& ext) + static auto not_extension_pred(const Files::Filesystem& fs, const std::string& ext) { - return [&fs, ext](const fs::path& path) { return !fs.is_directory(path) && path.extension() == ext; }; + return [&fs, ext](const fs::path& path) { return fs.is_directory(path) || path.extension() != ext; }; } enum class LintStatus @@ -104,8 +104,8 @@ namespace vcpkg::PostBuildLint std::vector<fs::path> files_found = fs.get_files_recursive(debug_include_dir); - Util::unstable_keep_if( - files_found, [&fs](const fs::path& path) { return !fs.is_directory(path) && path.extension() != ".ifc"; }); + Util::erase_remove_if( + files_found, [&fs](const fs::path& path) { return fs.is_directory(path) || path.extension() == ".ifc"; }); if (!files_found.empty()) { @@ -206,7 +206,7 @@ namespace vcpkg::PostBuildLint static LintStatus check_for_dlls_in_lib_dir(const Files::Filesystem& fs, const fs::path& package_dir) { std::vector<fs::path> dlls = fs.get_files_recursive(package_dir / "lib"); - Util::unstable_keep_if(dlls, has_extension_pred(fs, ".dll")); + Util::erase_remove_if(dlls, not_extension_pred(fs, ".dll")); if (!dlls.empty()) { @@ -280,7 +280,7 @@ namespace vcpkg::PostBuildLint static LintStatus check_for_exes(const Files::Filesystem& fs, const fs::path& package_dir) { std::vector<fs::path> exes = fs.get_files_recursive(package_dir / "bin"); - Util::unstable_keep_if(exes, has_extension_pred(fs, ".exe")); + Util::erase_remove_if(exes, not_extension_pred(fs, ".exe")); if (!exes.empty()) { @@ -572,8 +572,8 @@ namespace vcpkg::PostBuildLint { std::vector<fs::path> empty_directories = fs.get_files_recursive(dir); - Util::unstable_keep_if(empty_directories, [&fs](const fs::path& current) { - return fs.is_directory(current) && fs.is_empty(current); + Util::erase_remove_if(empty_directories, [&fs](const fs::path& current) { + return !fs.is_directory(current) || !fs.is_empty(current); }); if (!empty_directories.empty()) @@ -707,12 +707,15 @@ namespace vcpkg::PostBuildLint static LintStatus check_no_files_in_dir(const Files::Filesystem& fs, const fs::path& dir) { std::vector<fs::path> misplaced_files = fs.get_files_non_recursive(dir); - Util::unstable_keep_if(misplaced_files, [&fs](const fs::path& path) { + Util::erase_remove_if(misplaced_files, [&fs](const fs::path& path) { const std::string filename = path.filename().generic_string(); if (Strings::case_insensitive_ascii_equals(filename.c_str(), "CONTROL") || Strings::case_insensitive_ascii_equals(filename.c_str(), "BUILD_INFO")) - return false; - return !fs.is_directory(path); + { + return true; + } + + return fs.is_directory(path); }); if (!misplaced_files.empty()) @@ -764,9 +767,9 @@ namespace vcpkg::PostBuildLint const fs::path release_bin_dir = package_dir / "bin"; std::vector<fs::path> debug_libs = fs.get_files_recursive(debug_lib_dir); - Util::unstable_keep_if(debug_libs, has_extension_pred(fs, ".lib")); + Util::erase_remove_if(debug_libs, not_extension_pred(fs, ".lib")); std::vector<fs::path> release_libs = fs.get_files_recursive(release_lib_dir); - Util::unstable_keep_if(release_libs, has_extension_pred(fs, ".lib")); + Util::erase_remove_if(release_libs, not_extension_pred(fs, ".lib")); if (!pre_build_info.build_type) error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); @@ -780,9 +783,9 @@ namespace vcpkg::PostBuildLint } std::vector<fs::path> debug_dlls = fs.get_files_recursive(debug_bin_dir); - Util::unstable_keep_if(debug_dlls, has_extension_pred(fs, ".dll")); + Util::erase_remove_if(debug_dlls, not_extension_pred(fs, ".dll")); std::vector<fs::path> release_dlls = fs.get_files_recursive(release_bin_dir); - Util::unstable_keep_if(release_dlls, has_extension_pred(fs, ".dll")); + Util::erase_remove_if(release_dlls, not_extension_pred(fs, ".dll")); switch (build_info.library_linkage) { diff --git a/toolsrc/src/vcpkg/statusparagraph.cpp b/toolsrc/src/vcpkg/statusparagraph.cpp index 462d8d8ed..86946a31a 100644 --- a/toolsrc/src/vcpkg/statusparagraph.cpp +++ b/toolsrc/src/vcpkg/statusparagraph.cpp @@ -105,7 +105,7 @@ namespace vcpkg { dep.erase(std::find(dep.begin(), dep.end(), '['), dep.end()); } - Util::unstable_keep_if(deps, [&](auto&& e) { return e != l_spec.name(); }); + Util::erase_remove_if(deps, [&](auto&& e) { return e == l_spec.name(); }); // </hack> Util::sort_unique_erase(deps); diff --git a/toolsrc/src/vcpkg/tools.cpp b/toolsrc/src/vcpkg/tools.cpp index 313b5997b..f4ee2d653 100644 --- a/toolsrc/src/vcpkg/tools.cpp +++ b/toolsrc/src/vcpkg/tools.cpp @@ -191,8 +191,8 @@ namespace vcpkg if (!fs.exists(tool_data.download_path)) { System::println("Downloading %s...", tool_name); + System::println(" %s -> %s", tool_data.url, tool_data.download_path.string()); Downloads::download_file(fs, tool_data.url, tool_data.download_path, tool_data.sha512); - System::println("Downloading %s... done.", tool_name); } else { @@ -203,7 +203,6 @@ namespace vcpkg { System::println("Extracting %s...", tool_name); Archives::extract_archive(paths, tool_data.download_path, tool_data.tool_dir_path); - System::println("Extracting %s... done.", tool_name); } else { diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index 8909e1552..5b3cf9ef1 100644 --- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp +++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp @@ -51,11 +51,29 @@ namespace vcpkg std::vector<std::string> v; for (int i = 1; i < argc; ++i) { + std::string arg; #if defined(_WIN32) - v.push_back(Strings::to_utf8(argv[i])); + arg = Strings::to_utf8(argv[i]); #else - v.push_back(argv[i]); + arg = argv[i]; #endif + // Response file? + if (arg.size() > 0 && arg[0] == '@') + { + arg.erase(arg.begin()); + const auto& fs = Files::get_real_filesystem(); + auto lines = fs.read_lines(fs::u8path(arg)); + if (!lines.has_value()) + { + System::println(System::Color::error, "Error: Could not open response file %s", arg); + Checks::exit_fail(VCPKG_LINE_INFO); + } + std::copy(lines.get()->begin(), lines.get()->end(), std::back_inserter(v)); + } + else + { + v.emplace_back(std::move(arg)); + } } return VcpkgCmdArguments::create_from_arg_sequence(v.data(), v.data() + v.size()); diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp index 748fd20e0..9a51818e8 100644 --- a/toolsrc/src/vcpkg/vcpkgpaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -137,8 +137,8 @@ namespace vcpkg if (tsv && vsp) { - Util::stable_keep_if( - candidates, [&](const Toolset* t) { return *tsv == t->version && *vsp == t->visual_studio_root_path; }); + Util::erase_remove_if( + candidates, [&](const Toolset* t) { return *tsv != t->version || *vsp != t->visual_studio_root_path; }); Checks::check_exit(VCPKG_LINE_INFO, !candidates.empty(), "Could not find Visual Studio instance at %s with %s toolset.", @@ -151,7 +151,7 @@ namespace vcpkg if (tsv) { - Util::stable_keep_if(candidates, [&](const Toolset* t) { return *tsv == t->version; }); + Util::erase_remove_if(candidates, [&](const Toolset* t) { return *tsv != t->version; }); Checks::check_exit( VCPKG_LINE_INFO, !candidates.empty(), "Could not find Visual Studio instance with %s toolset.", *tsv); } @@ -159,8 +159,8 @@ namespace vcpkg if (vsp) { const fs::path vs_root_path = *vsp; - Util::stable_keep_if(candidates, - [&](const Toolset* t) { return vs_root_path == t->visual_studio_root_path; }); + Util::erase_remove_if(candidates, + [&](const Toolset* t) { return vs_root_path != t->visual_studio_root_path; }); Checks::check_exit(VCPKG_LINE_INFO, !candidates.empty(), "Could not find Visual Studio instance at %s.", diff --git a/toolsrc/src/vcpkg/visualstudio.cpp b/toolsrc/src/vcpkg/visualstudio.cpp index e3656a7d2..83a530a10 100644 --- a/toolsrc/src/vcpkg/visualstudio.cpp +++ b/toolsrc/src/vcpkg/visualstudio.cpp @@ -130,9 +130,9 @@ namespace vcpkg::VisualStudio { // We want lexically_normal(), but it is not available // Correct root path might be 2 or 3 levels up, depending on if the path has trailing backslash. Try both. - auto common7_tools = fs::path {*path_as_string}; - append_if_has_cl(fs::path {*path_as_string}.parent_path().parent_path()); - append_if_has_cl(fs::path {*path_as_string}.parent_path().parent_path().parent_path()); + auto common7_tools = fs::path{*path_as_string}; + append_if_has_cl(fs::path{*path_as_string}.parent_path().parent_path()); + append_if_has_cl(fs::path{*path_as_string}.parent_path().parent_path().parent_path()); } // VS2015 instance from Program Files @@ -143,7 +143,7 @@ namespace vcpkg::VisualStudio std::vector<std::string> get_visual_studio_instances(const VcpkgPaths& paths) { - std::vector<VisualStudioInstance> sorted {get_visual_studio_instances_internal(paths)}; + std::vector<VisualStudioInstance> sorted{get_visual_studio_instances_internal(paths)}; std::sort(sorted.begin(), sorted.end(), VisualStudioInstance::preferred_first_comparator); return Util::fmap(sorted, [](const VisualStudioInstance& instance) { return instance.to_string(); }); } @@ -160,8 +160,8 @@ namespace vcpkg::VisualStudio std::vector<Toolset> found_toolsets; std::vector<Toolset> excluded_toolsets; - const SortedVector<VisualStudioInstance> sorted {get_visual_studio_instances_internal(paths), - VisualStudioInstance::preferred_first_comparator}; + const SortedVector<VisualStudioInstance> sorted{get_visual_studio_instances_internal(paths), + VisualStudioInstance::preferred_first_comparator}; const bool v140_is_available = Util::find_if(sorted, [&](const VisualStudioInstance& vs_instance) { return vs_instance.major_version() == "14"; @@ -170,7 +170,7 @@ namespace vcpkg::VisualStudio for (const VisualStudioInstance& vs_instance : sorted) { const std::string major_version = vs_instance.major_version(); - if (major_version == "15") + if (major_version >= "15") { const fs::path vc_dir = vs_instance.root_path / "VC"; @@ -202,8 +202,8 @@ namespace vcpkg::VisualStudio // Locate the "best" MSVC toolchain version const fs::path msvc_path = vc_dir / "Tools" / "MSVC"; std::vector<fs::path> msvc_subdirectories = fs.get_files_non_recursive(msvc_path); - Util::unstable_keep_if(msvc_subdirectories, - [&fs](const fs::path& path) { return fs.is_directory(path); }); + Util::erase_remove_if(msvc_subdirectories, + [&fs](const fs::path& path) { return !fs.is_directory(path); }); // Sort them so that latest comes first std::sort( @@ -217,7 +217,7 @@ namespace vcpkg::VisualStudio paths_examined.push_back(dumpbin_path); if (fs.exists(dumpbin_path)) { - const Toolset v141_toolset { + const Toolset v141_toolset{ vs_instance.root_path, dumpbin_path, vcvarsall_bat, {}, V_141, supported_architectures}; const auto english_language_pack = dumpbin_path.parent_path() / "1033"; @@ -232,12 +232,12 @@ namespace vcpkg::VisualStudio if (v140_is_available) { - const Toolset v140_toolset {vs_instance.root_path, - dumpbin_path, - vcvarsall_bat, - {"-vcvars_ver=14.0"}, - V_140, - supported_architectures}; + const Toolset v140_toolset{vs_instance.root_path, + dumpbin_path, + vcvarsall_bat, + {"-vcvars_ver=14.0"}, + V_140, + supported_architectures}; found_toolsets.push_back(v140_toolset); } diff --git a/toolsrc/vcpkg.sln b/toolsrc/vcpkg.sln index 6b92c973b..8d0c849c6 100644 --- a/toolsrc/vcpkg.sln +++ b/toolsrc/vcpkg.sln @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{F589 ..\scripts\get_triplet_environment.cmake = ..\scripts\get_triplet_environment.cmake
..\scripts\internalCI.ps1 = ..\scripts\internalCI.ps1
..\scripts\ports.cmake = ..\scripts\ports.cmake
+ ..\scripts\vcpkgTools.xml = ..\scripts\vcpkgTools.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cmake", "cmake", "{A0122231-04D5-420B-81CA-7960946E5E65}"
diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj index 2ab94eb0a..8edea2244 100644 --- a/toolsrc/vcpkg/vcpkg.vcxproj +++ b/toolsrc/vcpkg/vcpkg.vcxproj @@ -52,20 +52,23 @@ </ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
<PropertyGroup Label="UserMacros" />
- <PropertyGroup />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IntDir>$(SolutionDir)msbuild.x86.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x86.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)msbuild.x86.release\</OutDir>
+ <IntDir>$(SolutionDir)msbuild.x86.release\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.release\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.release\</OutDir>
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 315c48174..8df9b5b9d 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -55,20 +55,23 @@ </ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
<PropertyGroup Label="UserMacros" />
- <PropertyGroup />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IntDir>$(SolutionDir)msbuild.x86.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x86.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)msbuild.x86.release\</OutDir>
+ <IntDir>$(SolutionDir)msbuild.x86.release\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.release\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.release\</OutDir>
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index a2ceef9ce..e533d0e15 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -52,20 +52,23 @@ </ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
<PropertyGroup Label="UserMacros" />
- <PropertyGroup />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IntDir>$(SolutionDir)msbuild.x86.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x86.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)msbuild.x86.release\</OutDir>
+ <IntDir>$(SolutionDir)msbuild.x86.release\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.release\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.release\</OutDir>
+ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index a0d44918d..4cda29461 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -83,19 +83,23 @@ </ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
<PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IntDir>$(SolutionDir)msbuild.x86.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x86.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)msbuild.x86.release\</OutDir>
+ <IntDir>$(SolutionDir)msbuild.x86.release\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.debug\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.debug\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IntDir>$(SolutionDir)msbuild.x64.release\$(ProjectName)\</IntDir>
+ <OutDir>$(SolutionDir)msbuild.x64.release\</OutDir>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
|
