From 81b9ab1291bd322b5de8ad0cec2f21ce4d828a28 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 04:26:00 -0700 Subject: [vcpkg] Refactor do_build_package and add archive tombstoning --- toolsrc/include/vcpkg/paragraphs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h index e2c7f2d99..fa0265b75 100644 --- a/toolsrc/include/vcpkg/paragraphs.h +++ b/toolsrc/include/vcpkg/paragraphs.h @@ -20,7 +20,7 @@ namespace vcpkg::Paragraphs Parse::ParseExpected try_load_port(const Files::Filesystem& fs, const fs::path& control_path); - Expected try_load_cached_control_package(const VcpkgPaths& paths, const PackageSpec& spec); + Expected try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec); struct LoadResults { -- cgit v1.2.3 From f72b46690a89a7e19563f93f0eaa5f8a21184254 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 06:25:59 -0700 Subject: [vcpkg] Silence warnings on recent clang --- toolsrc/include/pch.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 683bef171..9c9deeb3f 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -46,7 +46,11 @@ #include #include #include +#if defined(_WIN32) #include +#else +#include +#endif #include #include #include -- cgit v1.2.3 From 3c7997215bc2e44125912fb7aae672f1b63944a8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 11:06:22 -0700 Subject: [vcpkg] Improve default triplets for non-windows --- toolsrc/include/vcpkg/base/strings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 6ef840fb3..6294853af 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -46,7 +46,7 @@ namespace vcpkg::Strings bool case_insensitive_ascii_equals(const CStringView left, const CStringView right); - std::string ascii_to_lowercase(const std::string& input); + std::string ascii_to_lowercase(std::string input); bool case_insensitive_ascii_starts_with(const std::string& s, const std::string& pattern); -- cgit v1.2.3 From 90c4b8dbb7a69584a4a36c67e4982cf086b7c578 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 04:33:14 -0700 Subject: [vcpkg] Further refactoring inside `build_package()` --- toolsrc/include/vcpkg/commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 4027e12f4..b6b1c56ab 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -120,7 +120,7 @@ namespace vcpkg::Commands namespace Hash { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - std::string get_file_hash(fs::path const& cmake_exe_path, fs::path const& path, std::string const& hash_type); + std::string get_file_hash(const VcpkgPaths& paths, fs::path const& path, std::string const& hash_type); } template -- cgit v1.2.3 From d253123055e6bdfb181c6a8a14a63e2d6fc68cad Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Sun, 18 Mar 2018 20:24:19 +0800 Subject: Add options and documentation for env command (#3007) * [vcpkg] Add options and documentation for env command * [vcpkg-env] Cleanup. Add tools/*. --- toolsrc/include/vcpkg/base/system.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 31034f6b4..b2faf69bb 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include @@ -38,7 +40,8 @@ namespace vcpkg::System std::string output; }; - int cmd_execute_clean(const CStringView cmd_line); + int cmd_execute_clean(const CStringView cmd_line, + const std::unordered_map& extra_env = {}); int cmd_execute(const CStringView cmd_line); -- cgit v1.2.3 From eab1d5c531695c2a644276832578e5550dd9abf6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 10:30:27 -0700 Subject: [vcpkg-ci] Do not rebuild libraries that were previously successful or failed --- toolsrc/include/vcpkg/base/cache.h | 21 +++++++++++++++++++++ toolsrc/include/vcpkg/base/util.h | 6 +++--- toolsrc/include/vcpkg/build.h | 17 +++++++++++++++++ toolsrc/include/vcpkg/commands.h | 12 ++++++++++++ toolsrc/include/vcpkg/dependencies.h | 5 ++++- toolsrc/include/vcpkg/install.h | 1 + toolsrc/include/vcpkg/sourceparagraph.h | 2 ++ 7 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 toolsrc/include/vcpkg/base/cache.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/cache.h b/toolsrc/include/vcpkg/base/cache.h new file mode 100644 index 000000000..dfc7565b8 --- /dev/null +++ b/toolsrc/include/vcpkg/base/cache.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace vcpkg +{ + template + struct Cache + { + template + Value const& get_lazy(const Key& k, const F& f) const + { + auto it = m_cache.find(k); + if (it != m_cache.end()) return it->second; + return m_cache.emplace(k, f()).first->second; + } + + private: + mutable std::map m_cache; + }; +} diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index 5e07b240a..b12919951 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -24,10 +24,10 @@ namespace vcpkg::Util namespace Sets { - template - bool contains(const Container& container, const ElementT& item) + template + bool contains(const Container& container, const Key& item) { - return container.find(item) != container.cend(); + return container.find(item) != container.end(); } } diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index ea81c4dbe..8c4d7b575 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -204,4 +204,21 @@ namespace vcpkg::Build }; BuildInfo read_build_info(const Files::Filesystem& fs, const fs::path& filepath); + + struct AbiEntry + { + std::string key; + std::string value; + }; + + struct AbiTagAndFile + { + std::string tag; + fs::path tag_file; + }; + + Optional compute_abi_tag(const VcpkgPaths& paths, + const BuildPackageConfig& config, + const PreBuildInfo& pre_build_info, + Span dependency_abis); } diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index b6b1c56ab..7369b8206 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -7,6 +7,8 @@ #include #include +#include +#include namespace vcpkg::Commands { @@ -23,7 +25,17 @@ namespace vcpkg::Commands namespace CI { + struct UnknownCIPortsResults + { + std::vector unknown; + std::map known; + }; + extern const CommandStructure COMMAND_STRUCTURE; + UnknownCIPortsResults find_unknown_ports_for_ci(const VcpkgPaths& paths, + const std::set& exclusions, + const Dependencies::PortFileProvider& provider, + const std::vector& fspecs); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index fadb8cc7e..33af6c4f5 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -45,7 +45,8 @@ namespace vcpkg::Dependencies InstallPlanAction(const PackageSpec& spec, const SourceControlFile& scf, const std::set& features, - const RequestType& request_type); + const RequestType& request_type, + std::vector&& dependencies); std::string displayname() const; @@ -58,6 +59,8 @@ namespace vcpkg::Dependencies RequestType request_type; Build::BuildPackageOptions build_options; std::set feature_list; + + std::vector computed_dependencies; }; enum class RemovePlanType diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h index 2e92764dc..b7acbf15f 100644 --- a/toolsrc/include/vcpkg/install.h +++ b/toolsrc/include/vcpkg/install.h @@ -37,6 +37,7 @@ namespace vcpkg::Install std::string total_elapsed_time; void print() const; + static std::string xunit_result(const PackageSpec& spec, Chrono::ElapsedTime time, Build::BuildResult code); std::string xunit_results() const; }; diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index ea8e27a94..ae5812ea7 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -63,6 +63,8 @@ namespace vcpkg std::unique_ptr core_paragraph; std::vector> feature_paragraphs; + + Optional find_feature(const std::string& featurename) const; }; void print_error_message(Span> error_info_list); -- cgit v1.2.3 From ab7985a34b8a4de59dc9a6e6c4c40fbb564797b8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Mar 2018 16:53:48 -0700 Subject: [vcpkg-hash] Use BCrypt on Windows --- toolsrc/include/vcpkg/base/strings.h | 4 +++- toolsrc/include/vcpkg/base/util.h | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 6294853af..c32e81ac2 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -46,7 +46,9 @@ namespace vcpkg::Strings bool case_insensitive_ascii_equals(const CStringView left, const CStringView right); - std::string ascii_to_lowercase(std::string input); + std::string ascii_to_lowercase(std::string s); + + std::string ascii_to_uppercase(std::string s); bool case_insensitive_ascii_starts_with(const std::string& s, const std::string& pattern); diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index b12919951..c73345719 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -6,8 +6,6 @@ #include #include -#include - namespace vcpkg::Util { template @@ -158,6 +156,8 @@ namespace vcpkg::Util MoveOnlyBase& operator=(const MoveOnlyBase&) = delete; MoveOnlyBase& operator=(MoveOnlyBase&&) = default; + + ~MoveOnlyBase() = default; }; struct ResourceBase @@ -168,6 +168,8 @@ namespace vcpkg::Util ResourceBase& operator=(const ResourceBase&) = delete; ResourceBase& operator=(ResourceBase&&) = delete; + + ~ResourceBase() = default; }; template @@ -214,4 +216,10 @@ namespace vcpkg::Util return e == E::YES; } } + + template + void unused(T&& param) + { + (void)param; + } } -- cgit v1.2.3 From d80dd5cbc777ce765c2d6b78d7c485fdf05f284b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 19 Mar 2018 15:45:35 -0700 Subject: [vcpkg] Handle failure to store archive --- toolsrc/include/vcpkg/base/files.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index 09393b9ee..ac1f192ae 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -36,6 +36,7 @@ namespace vcpkg::Files virtual void write_lines(const fs::path& file_path, const std::vector& lines) = 0; virtual void write_contents(const fs::path& file_path, const std::string& data, std::error_code& ec) = 0; virtual void rename(const fs::path& oldpath, const fs::path& newpath) = 0; + virtual void rename(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) = 0; virtual bool remove(const fs::path& path) = 0; virtual bool remove(const fs::path& path, std::error_code& ec) = 0; virtual std::uintmax_t remove_all(const fs::path& path, std::error_code& ec) = 0; -- cgit v1.2.3 From d45954a96b625ba1856ac97b429163a1919a3299 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 21 Mar 2018 18:21:30 -0700 Subject: System::get_program_files() now returns Optional --- toolsrc/include/vcpkg/base/system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index b2faf69bb..0d089276f 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -110,9 +110,9 @@ namespace vcpkg::System std::vector get_supported_host_architectures(); - const fs::path& get_program_files_32_bit(); + const Optional& get_program_files_32_bit(); - const fs::path& get_program_files_platform_bitness(); + const Optional& get_program_files_platform_bitness(); } namespace vcpkg::Debug -- cgit v1.2.3 From 1f62b32641045fe377ee80ff1854a785344687d2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 22 Mar 2018 10:01:12 -0700 Subject: [vcpkg] Sort abi tags to ensure stability --- toolsrc/include/vcpkg/build.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 8c4d7b575..1c22d39d8 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -209,6 +209,11 @@ namespace vcpkg::Build { std::string key; std::string value; + + bool operator<(const AbiEntry& other) const + { + return key < other.key || (key == other.key && value < other.value); + } }; struct AbiTagAndFile -- cgit v1.2.3 From 69dfad795f4ffb5bec60602ec1116730027ff088 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 14 Mar 2018 16:48:18 -0700 Subject: Introduce Maps::transform_values() --- toolsrc/include/vcpkg/base/util.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index c73345719..7266fbbc6 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -29,6 +30,17 @@ namespace vcpkg::Util } } + namespace Maps + { + template + void transform_values(const std::unordered_map& container, std::unordered_map& output, Func func) + { + std::for_each(container.cbegin(), container.cend(), [&](const std::pair& p) { + output[p.first] = func(p.second); + }); + } + } + template using FmapOut = decltype(std::declval()(*begin(std::declval()))); -- cgit v1.2.3 From 3a91b0072d7500f2be84fe4d6520e8469ba5b5ad Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 24 Mar 2018 01:04:48 -0700 Subject: Fix name --- toolsrc/include/vcpkg/dependencies.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 33af6c4f5..fea0d88a9 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -175,7 +175,7 @@ namespace vcpkg::Dependencies const std::vector& specs, const StatusParagraphs& status_db); - std::vector create_feature_install_plan(const PortFileProvider& port_file_provider, + std::vector create_feature_install_plan(const PortFileProvider& provider, const std::vector& specs, const StatusParagraphs& status_db); -- cgit v1.2.3 From adccba04db25b3e3bd44c58a9d2cbc1366e53fde Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 2 Apr 2018 17:12:12 -0700 Subject: [vcpkg.exe] Look for vcpkgTools in downloads/tools/$toolname-$toolversion (only non-windows currently) --- toolsrc/include/vcpkg/vcpkgpaths.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 71f1bbba9..b3f24fb89 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -66,6 +66,7 @@ namespace vcpkg const fs::path& get_7za_exe() const; const fs::path& get_cmake_exe() const; const fs::path& get_git_exe() const; + const fs::path& get_ninja_exe() const; const fs::path& get_nuget_exe() const; const fs::path& get_ifw_installerbase_exe() const; const fs::path& get_ifw_binarycreator_exe() const; @@ -84,6 +85,7 @@ namespace vcpkg Lazy _7za_exe; Lazy cmake_exe; Lazy git_exe; + Lazy ninja_exe; Lazy nuget_exe; Lazy ifw_installerbase_exe; Lazy ifw_binarycreator_exe; -- cgit v1.2.3 From 892f7052f943570eb5d8da991ace01725323c695 Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Wed, 7 Mar 2018 17:57:16 +0800 Subject: [vcpkg] Add support of external downloader aria2 --- toolsrc/include/vcpkg/build.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 1c22d39d8..a86245ccf 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -57,12 +57,20 @@ namespace vcpkg::Build RELEASE, }; + enum class DownloadTool + { + BUILT_IN, + ARIA2, + }; + const std::string& to_string(DownloadTool tool); + struct BuildPackageOptions { UseHeadVersion use_head_version; AllowDownloads allow_downloads; CleanBuildtrees clean_buildtrees; CleanPackages clean_packages; + DownloadTool download_tool; }; enum class BuildResult -- cgit v1.2.3 From 0c0f68939e0d8367e55793f80f0000f2a43a812a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 01:45:45 -0700 Subject: Introduce "vcpkg fetch" --- toolsrc/include/vcpkg/commands.h | 7 +++++++ toolsrc/include/vcpkg/vcpkgpaths.h | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 7369b8206..f6f1de626 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -135,6 +135,13 @@ namespace vcpkg::Commands std::string get_file_hash(const VcpkgPaths& paths, fs::path const& path, std::string const& hash_type); } + namespace Fetch + { + std::vector find_toolset_instances(const VcpkgPaths& paths); + fs::path get_tool_path(const VcpkgPaths& paths, const std::string& tool); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + template struct PackageNameAndFunction { diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index b3f24fb89..090414de3 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -7,8 +7,22 @@ #include #include +#include + namespace vcpkg { + namespace Tools + { + static const std::string SEVEN_ZIP = "7zip"; + static const std::string CMAKE = "cmake"; + static const std::string GIT = "git"; + static const std::string NINJA = "ninja"; + static const std::string NUGET = "nuget"; + static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; + static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; + static const std::string IFW_REPOGEN = "ifw_repogen"; + } + struct ToolsetArchOption { CStringView name; @@ -63,14 +77,7 @@ namespace vcpkg fs::path ports_cmake; - const fs::path& get_7za_exe() const; - const fs::path& get_cmake_exe() const; - const fs::path& get_git_exe() const; - const fs::path& get_ninja_exe() const; - const fs::path& get_nuget_exe() const; - const fs::path& get_ifw_installerbase_exe() const; - const fs::path& get_ifw_binarycreator_exe() const; - const fs::path& get_ifw_repogen_exe() const; + const fs::path& get_tool_exe(const std::string& tool) const; /// Retrieve a toolset matching a VS version /// @@ -82,14 +89,7 @@ namespace vcpkg private: Lazy> available_triplets; - Lazy _7za_exe; - Lazy cmake_exe; - Lazy git_exe; - Lazy ninja_exe; - Lazy nuget_exe; - Lazy ifw_installerbase_exe; - Lazy ifw_binarycreator_exe; - Lazy ifw_repogen_exe; + mutable std::map tool_paths; Lazy> toolsets; Lazy> toolsets_vs2013; -- cgit v1.2.3 From 870fa61e0132028f43c292b7fd7a7d7c6525a8d7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Apr 2018 04:29:43 -0700 Subject: [vcpkg hash] Don't use cmake for non-windows hashes. Use shasum instead --- toolsrc/include/vcpkg/commands.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index f6f1de626..65e7fdd14 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -131,8 +131,8 @@ namespace vcpkg::Commands namespace Hash { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - std::string get_file_hash(const VcpkgPaths& paths, fs::path const& path, std::string const& hash_type); + void perform_and_exit(const VcpkgCmdArguments& args); + std::string get_file_hash(fs::path const& path, std::string const& hash_type); } namespace Fetch -- cgit v1.2.3 From e71230855443a0b87c38e011531cfc6b9d6ffce5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Apr 2018 16:41:52 -0700 Subject: [vcpkg hash] Add string hashing (as opposed to file hashing) --- toolsrc/include/vcpkg/commands.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 65e7fdd14..d8d2abfa9 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -131,8 +131,10 @@ namespace vcpkg::Commands namespace Hash { + std::string get_string_hash(const std::string& s, const std::string& hash_type); + std::string get_file_hash(const fs::path& path, const std::string& hash_type); + void perform_and_exit(const VcpkgCmdArguments& args); - std::string get_file_hash(fs::path const& path, std::string const& hash_type); } namespace Fetch -- cgit v1.2.3 From 1bfb01cfeeffc8c8161f64b1bd2986557b6ba207 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Apr 2018 22:05:55 -0700 Subject: [vcpkg hash] Add sanity checking --- toolsrc/include/vcpkg/commands.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index d8d2abfa9..6d29b7960 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -132,9 +132,9 @@ namespace vcpkg::Commands namespace Hash { std::string get_string_hash(const std::string& s, const std::string& hash_type); - std::string get_file_hash(const fs::path& path, const std::string& hash_type); + std::string get_file_hash(const VcpkgPaths& paths, const fs::path& path, const std::string& hash_type); - void perform_and_exit(const VcpkgCmdArguments& args); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Fetch -- cgit v1.2.3 From 80f16f769e981b4a52ae841dd71f73009866133c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 14:51:53 -0700 Subject: Use Cache class --- toolsrc/include/vcpkg/vcpkgpaths.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 090414de3..fc6b319d8 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -89,7 +90,7 @@ namespace vcpkg private: Lazy> available_triplets; - mutable std::map tool_paths; + Cache tool_paths; Lazy> toolsets; Lazy> toolsets_vs2013; -- cgit v1.2.3 From 402bbbc1e2b26f714f88cc6f40283008dabba64f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 19:19:54 -0700 Subject: [Checks] Take parameter by ref --- toolsrc/include/vcpkg/base/checks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/checks.h b/toolsrc/include/vcpkg/base/checks.h index fb162c897..bceee3428 100644 --- a/toolsrc/include/vcpkg/base/checks.h +++ b/toolsrc/include/vcpkg/base/checks.h @@ -27,7 +27,7 @@ namespace vcpkg::Checks // Display an error message to the user and exit the tool. [[noreturn]] void exit_with_message(const LineInfo& line_info, const char* error_message_template, - const Arg1 error_message_arg1, + const Arg1& error_message_arg1, const Args&... error_message_args) { exit_with_message(line_info, @@ -42,7 +42,7 @@ namespace vcpkg::Checks void check_exit(const LineInfo& line_info, Conditional&& expression, const char* error_message_template, - const Arg1 error_message_arg1, + const Arg1& error_message_arg1, const Args&... error_message_args) { if (!expression) -- cgit v1.2.3 From 77338ee0df064fe89f9eb991b61bc9bb467f755c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 7 Apr 2018 03:24:45 -0700 Subject: Remove more unused #include directives --- toolsrc/include/vcpkg/base/chrono.h | 1 - toolsrc/include/vcpkg/export.ifw.h | 2 -- toolsrc/include/vcpkg/paragraphs.h | 3 --- toolsrc/include/vcpkg/vcpkgcmdarguments.h | 1 - toolsrc/include/vcpkg/vcpkgpaths.h | 2 -- 5 files changed, 9 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/chrono.h b/toolsrc/include/vcpkg/base/chrono.h index 4291115f7..7b393e377 100644 --- a/toolsrc/include/vcpkg/base/chrono.h +++ b/toolsrc/include/vcpkg/base/chrono.h @@ -2,7 +2,6 @@ #include #include -#include #include namespace vcpkg::Chrono diff --git a/toolsrc/include/vcpkg/export.ifw.h b/toolsrc/include/vcpkg/export.ifw.h index d28a4436d..b1573924e 100644 --- a/toolsrc/include/vcpkg/export.ifw.h +++ b/toolsrc/include/vcpkg/export.ifw.h @@ -3,8 +3,6 @@ #include #include -#include - #include #include diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h index fa0265b75..56f09387a 100644 --- a/toolsrc/include/vcpkg/paragraphs.h +++ b/toolsrc/include/vcpkg/paragraphs.h @@ -3,12 +3,9 @@ #include #include #include -#include #include -#include - namespace vcpkg::Paragraphs { using RawParagraph = Parse::RawParagraph; diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index f449887f1..de65eec28 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include #include diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index fc6b319d8..9c8f2911a 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -8,8 +8,6 @@ #include #include -#include - namespace vcpkg { namespace Tools -- cgit v1.2.3 From 8da8f3e5b3cca98e9151d421a91f5c1590a47086 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 10 Apr 2018 04:48:02 -0700 Subject: [vcpkg] Rework dependencies.cpp to improve type safety and error detection --- toolsrc/include/vcpkg/base/optional.h | 6 ++++++ toolsrc/include/vcpkg/dependencies.h | 3 +-- toolsrc/include/vcpkg/statusparagraph.h | 1 + toolsrc/include/vcpkg/vcpkglib.h | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/optional.h b/toolsrc/include/vcpkg/base/optional.h index af2d297a6..b629de9b3 100644 --- a/toolsrc/include/vcpkg/base/optional.h +++ b/toolsrc/include/vcpkg/base/optional.h @@ -64,6 +64,12 @@ namespace vcpkg return std::move(this->m_base.value()); } + T& value_or_exit(const LineInfo& line_info) & + { + this->exit_if_null(line_info); + return this->m_base.value(); + } + const T& value_or_exit(const LineInfo& line_info) const& { this->exit_if_null(line_info); diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index fea0d88a9..704e76b07 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -37,8 +37,7 @@ namespace vcpkg::Dependencies InstallPlanAction(); - InstallPlanAction(const PackageSpec& spec, - InstalledPackageView&& spghs, + InstallPlanAction(InstalledPackageView&& spghs, const std::set& features, const RequestType& request_type); diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h index 0802de530..16144e467 100644 --- a/toolsrc/include/vcpkg/statusparagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -54,6 +54,7 @@ namespace vcpkg { } + const PackageSpec& spec() const { return core->package.spec; } std::vector dependencies() const; const StatusParagraph* core; diff --git a/toolsrc/include/vcpkg/vcpkglib.h b/toolsrc/include/vcpkg/vcpkglib.h index 3c8e676bf..5674d30db 100644 --- a/toolsrc/include/vcpkg/vcpkglib.h +++ b/toolsrc/include/vcpkg/vcpkglib.h @@ -16,7 +16,7 @@ namespace vcpkg SortedVector files; }; - std::vector get_installed_ports(const StatusParagraphs& status_db); + std::vector get_installed_ports(const StatusParagraphs& status_db); std::vector get_installed_files(const VcpkgPaths& paths, const StatusParagraphs& status_db); -- cgit v1.2.3 From a2aeb2f1949c42622ccc7f9572a441e2a4475132 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Apr 2018 00:47:17 -0700 Subject: [vcpkg] Mark many types noexcept. Make certain code patterns more transparent to /analyze. #ifdef-out unused code on non-windows. --- toolsrc/include/vcpkg/base/chrono.h | 10 +++++----- toolsrc/include/vcpkg/base/cstringview.h | 15 +-------------- toolsrc/include/vcpkg/base/files.h | 2 +- toolsrc/include/vcpkg/base/lineinfo.h | 2 +- toolsrc/include/vcpkg/base/optional.h | 6 +++--- toolsrc/include/vcpkg/base/span.h | 7 ++++--- toolsrc/include/vcpkg/base/strings.h | 2 +- toolsrc/include/vcpkg/binaryparagraph.h | 2 +- toolsrc/include/vcpkg/build.h | 6 +++--- toolsrc/include/vcpkg/dependencies.h | 6 +++--- toolsrc/include/vcpkg/packagespecparseresult.h | 2 +- toolsrc/include/vcpkg/statusparagraph.h | 4 ++-- toolsrc/include/vcpkg/triplet.h | 4 ++-- toolsrc/include/vcpkg/versiont.h | 4 ++-- 14 files changed, 30 insertions(+), 42 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/chrono.h b/toolsrc/include/vcpkg/base/chrono.h index 7b393e377..aa764a597 100644 --- a/toolsrc/include/vcpkg/base/chrono.h +++ b/toolsrc/include/vcpkg/base/chrono.h @@ -11,8 +11,8 @@ namespace vcpkg::Chrono using duration = std::chrono::high_resolution_clock::time_point::duration; public: - constexpr ElapsedTime() : m_duration() {} - constexpr ElapsedTime(duration d) : m_duration(d) {} + constexpr ElapsedTime() noexcept : m_duration() {} + constexpr ElapsedTime(duration d) noexcept : m_duration(d) {} template TimeUnit as() const @@ -31,7 +31,7 @@ namespace vcpkg::Chrono public: static ElapsedTimer create_started(); - constexpr ElapsedTimer() : m_start_tick() {} + constexpr ElapsedTimer() noexcept : m_start_tick() {} ElapsedTime elapsed() const { @@ -52,8 +52,8 @@ namespace vcpkg::Chrono static Optional get_current_date_time(); static Optional parse(CStringView str); - constexpr CTime() : m_tm{0} {} - explicit constexpr CTime(tm t) : m_tm{t} {} + constexpr CTime() noexcept : m_tm{0} {} + explicit constexpr CTime(tm t) noexcept : m_tm{t} {} std::string to_string() const; diff --git a/toolsrc/include/vcpkg/base/cstringview.h b/toolsrc/include/vcpkg/base/cstringview.h index 0441bc573..f285aa36c 100644 --- a/toolsrc/include/vcpkg/base/cstringview.h +++ b/toolsrc/include/vcpkg/base/cstringview.h @@ -7,7 +7,7 @@ namespace vcpkg { struct CStringView { - constexpr CStringView() : cstr(nullptr) {} + constexpr CStringView() noexcept : cstr(nullptr) {} constexpr CStringView(const char* cstr) : cstr(cstr) {} constexpr CStringView(const CStringView&) = default; CStringView(const std::string& str) : cstr(str.c_str()) {} @@ -18,19 +18,6 @@ namespace vcpkg const char* cstr; }; - struct CWStringView - { - constexpr CWStringView() : cstr(nullptr) {} - constexpr CWStringView(const wchar_t* cstr) : cstr(cstr) {} - constexpr CWStringView(const CWStringView&) = default; - CWStringView(const std::wstring& str) : cstr(str.c_str()) {} - - constexpr const wchar_t* c_str() const { return cstr; } - - private: - const wchar_t* cstr; - }; - namespace details { inline bool vcpkg_strcmp(const char* l, const char* r) { return strcmp(l, r) == 0; } diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index ac1f192ae..f16805d0a 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -64,7 +64,7 @@ namespace vcpkg::Files Filesystem& get_real_filesystem(); - static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; + static constexpr const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; bool has_invalid_chars_for_filesystem(const std::string& s); diff --git a/toolsrc/include/vcpkg/base/lineinfo.h b/toolsrc/include/vcpkg/base/lineinfo.h index e7e8c3031..e0eb8bec9 100644 --- a/toolsrc/include/vcpkg/base/lineinfo.h +++ b/toolsrc/include/vcpkg/base/lineinfo.h @@ -9,7 +9,7 @@ namespace vcpkg int line_number; const char* file_name; - constexpr LineInfo() : line_number(0), file_name("") {} + constexpr LineInfo() noexcept : line_number(0), file_name("") {} constexpr LineInfo(const int lineno, const char* filename) : line_number(lineno), file_name(filename) {} std::string to_string() const; diff --git a/toolsrc/include/vcpkg/base/optional.h b/toolsrc/include/vcpkg/base/optional.h index b629de9b3..6b84b10aa 100644 --- a/toolsrc/include/vcpkg/base/optional.h +++ b/toolsrc/include/vcpkg/base/optional.h @@ -16,7 +16,7 @@ namespace vcpkg template struct OptionalStorage { - constexpr OptionalStorage() : m_is_present(false), m_t() {} + constexpr OptionalStorage() noexcept : m_is_present(false), m_t() {} constexpr OptionalStorage(const T& t) : m_is_present(true), m_t(t) {} constexpr OptionalStorage(T&& t) : m_is_present(true), m_t(std::move(t)) {} @@ -33,7 +33,7 @@ namespace vcpkg template struct OptionalStorage { - constexpr OptionalStorage() : m_t(nullptr) {} + constexpr OptionalStorage() noexcept : m_t(nullptr) {} constexpr OptionalStorage(T& t) : m_t(&t) {} constexpr bool has_value() const { return m_t != nullptr; } @@ -48,7 +48,7 @@ namespace vcpkg template struct Optional { - constexpr Optional() {} + constexpr Optional() noexcept {} // Constructors are intentionally implicit constexpr Optional(NullOpt) {} diff --git a/toolsrc/include/vcpkg/base/span.h b/toolsrc/include/vcpkg/base/span.h index c9ac18afe..2b067d0ac 100644 --- a/toolsrc/include/vcpkg/base/span.h +++ b/toolsrc/include/vcpkg/base/span.h @@ -19,18 +19,19 @@ namespace vcpkg using iterator = pointer; constexpr Span() noexcept : m_ptr(nullptr), m_count(0) {} - constexpr Span(std::nullptr_t) noexcept : Span() {} + constexpr Span(std::nullptr_t) noexcept : m_ptr(nullptr), m_count(0) {} constexpr Span(pointer ptr, size_t count) noexcept : m_ptr(ptr), m_count(count) {} constexpr Span(pointer ptr_begin, pointer ptr_end) noexcept : m_ptr(ptr_begin), m_count(ptr_end - ptr_begin) {} constexpr Span(std::initializer_list l) noexcept : m_ptr(l.begin()), m_count(l.size()) {} template - constexpr Span(T (&arr)[N]) noexcept : Span(arr, N) + constexpr Span(T (&arr)[N]) noexcept : m_ptr(arr), m_count(N) { } template - constexpr Span(const std::array, N>& arr) noexcept : Span(arr.data(), arr.size()) + constexpr Span(const std::array, N>& arr) noexcept + : m_ptr(arr.data()), m_count(arr.size()) { } diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index c32e81ac2..4cc17bcf4 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -36,7 +36,7 @@ namespace vcpkg::Strings std::wstring to_utf16(const CStringView& s); - std::string to_utf8(const CWStringView& w); + std::string to_utf8(const wchar_t* w); std::string escape_string(const CStringView& s, char char_to_escape, char escape_char); diff --git a/toolsrc/include/vcpkg/binaryparagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h index 3315151c6..5ba2fbde3 100644 --- a/toolsrc/include/vcpkg/binaryparagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -12,7 +12,7 @@ namespace vcpkg /// struct BinaryParagraph { - BinaryParagraph(); + BinaryParagraph() noexcept; explicit BinaryParagraph(std::unordered_map fields); BinaryParagraph(const SourceParagraph& spgh, const Triplet& triplet, const std::string& abi_tag); BinaryParagraph(const SourceParagraph& spgh, const FeatureParagraph& fpgh, const Triplet& triplet); diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index a86245ccf..c5e7e8d88 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -62,7 +62,7 @@ namespace vcpkg::Build BUILT_IN, ARIA2, }; - const std::string& to_string(DownloadTool tool); + const std::string& to_string(DownloadTool tool); struct BuildPackageOptions { @@ -203,8 +203,8 @@ namespace vcpkg::Build struct BuildInfo { - LinkageType crt_linkage; - LinkageType library_linkage; + LinkageType crt_linkage = LinkageType::DYNAMIC; + LinkageType library_linkage = LinkageType::DYNAMIC; Optional version; diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 704e76b07..3c3b8f267 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -35,7 +35,7 @@ namespace vcpkg::Dependencies { static bool compare_by_name(const InstallPlanAction* left, const InstallPlanAction* right); - InstallPlanAction(); + InstallPlanAction() noexcept; InstallPlanAction(InstalledPackageView&& spghs, const std::set& features, @@ -73,7 +73,7 @@ namespace vcpkg::Dependencies { static bool compare_by_name(const RemovePlanAction* left, const RemovePlanAction* right); - RemovePlanAction(); + RemovePlanAction() noexcept; RemovePlanAction(const PackageSpec& spec, const RemovePlanType& plan_type, const RequestType& request_type); PackageSpec spec; @@ -103,7 +103,7 @@ namespace vcpkg::Dependencies { static bool compare_by_name(const ExportPlanAction* left, const ExportPlanAction* right); - ExportPlanAction(); + ExportPlanAction() noexcept; ExportPlanAction(const PackageSpec& spec, InstalledPackageView&& installed_package, const RequestType& request_type); diff --git a/toolsrc/include/vcpkg/packagespecparseresult.h b/toolsrc/include/vcpkg/packagespecparseresult.h index dd91c9a67..be3497152 100644 --- a/toolsrc/include/vcpkg/packagespecparseresult.h +++ b/toolsrc/include/vcpkg/packagespecparseresult.h @@ -17,7 +17,7 @@ namespace vcpkg template<> struct ErrorHolder { - ErrorHolder() : m_err(PackageSpecParseResult::SUCCESS) {} + ErrorHolder() noexcept : m_err(PackageSpecParseResult::SUCCESS) {} ErrorHolder(PackageSpecParseResult err) : m_err(err) {} bool has_error() const { return m_err != PackageSpecParseResult::SUCCESS; } diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h index 16144e467..e79c946cc 100644 --- a/toolsrc/include/vcpkg/statusparagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -29,7 +29,7 @@ namespace vcpkg /// struct StatusParagraph { - StatusParagraph(); + StatusParagraph() noexcept; explicit StatusParagraph(std::unordered_map&& fields); bool is_installed() const { return want == Want::INSTALL && state == InstallState::INSTALLED; } @@ -47,7 +47,7 @@ namespace vcpkg struct InstalledPackageView { - InstalledPackageView() : core(nullptr) {} + InstalledPackageView() noexcept : core(nullptr) {} InstalledPackageView(const StatusParagraph* c, std::vector&& fs) : core(c), features(std::move(fs)) diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h index 10464dc2c..334960e49 100644 --- a/toolsrc/include/vcpkg/triplet.h +++ b/toolsrc/include/vcpkg/triplet.h @@ -9,7 +9,7 @@ namespace vcpkg struct Triplet { public: - constexpr Triplet() : m_instance(&DEFAULT_INSTANCE) {} + constexpr Triplet() noexcept : m_instance(&DEFAULT_INSTANCE) {} static Triplet from_canonical_name(const std::string& triplet_as_string); @@ -47,4 +47,4 @@ namespace std { size_t operator()(const vcpkg::Triplet& t) const { return t.hash_code(); } }; -} \ No newline at end of file +} diff --git a/toolsrc/include/vcpkg/versiont.h b/toolsrc/include/vcpkg/versiont.h index 8427dfe3b..e893f1abc 100644 --- a/toolsrc/include/vcpkg/versiont.h +++ b/toolsrc/include/vcpkg/versiont.h @@ -5,7 +5,7 @@ namespace vcpkg { struct VersionT { - VersionT(); + VersionT() noexcept; VersionT(std::string&& value); VersionT(const std::string& value); @@ -23,7 +23,7 @@ namespace vcpkg VersionT left; VersionT right; - VersionDiff(); + VersionDiff() noexcept; VersionDiff(const VersionT& left, const VersionT& right); std::string to_string() const; -- cgit v1.2.3 From f6530368eb31734734c0e1e7ce990c0cb93f0b24 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Apr 2018 00:19:27 -0700 Subject: Remove noexcept from BinaryParagraph() --- toolsrc/include/vcpkg/binaryparagraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/binaryparagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h index 5ba2fbde3..3315151c6 100644 --- a/toolsrc/include/vcpkg/binaryparagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -12,7 +12,7 @@ namespace vcpkg /// struct BinaryParagraph { - BinaryParagraph() noexcept; + BinaryParagraph(); explicit BinaryParagraph(std::unordered_map fields); BinaryParagraph(const SourceParagraph& spgh, const Triplet& triplet, const std::string& abi_tag); BinaryParagraph(const SourceParagraph& spgh, const FeatureParagraph& fpgh, const Triplet& triplet); -- cgit v1.2.3 From 9167511656715c81d01cc87af5db1835f026f5b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Apr 2018 18:14:24 -0700 Subject: Fix #3170 issue with /permissive- --- toolsrc/include/tests.utils.h | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/tests.utils.h b/toolsrc/include/tests.utils.h index 970506663..7f7ec9e88 100644 --- a/toolsrc/include/tests.utils.h +++ b/toolsrc/include/tests.utils.h @@ -12,10 +12,42 @@ namespace Microsoft::VisualStudio::CppUnitTestFramework { - std::wstring ToString(const vcpkg::Dependencies::InstallPlanType& t); - std::wstring ToString(const vcpkg::Dependencies::RequestType& t); - std::wstring ToString(const vcpkg::PackageSpecParseResult& t); - std::wstring ToString(const vcpkg::PackageSpec& t); + template<> + std::wstring ToString(const vcpkg::Dependencies::InstallPlanType& t) + { + switch (t) + { + case vcpkg::Dependencies::InstallPlanType::ALREADY_INSTALLED: return L"ALREADY_INSTALLED"; + case vcpkg::Dependencies::InstallPlanType::BUILD_AND_INSTALL: return L"BUILD_AND_INSTALL"; + case vcpkg::Dependencies::InstallPlanType::EXCLUDED: return L"EXCLUDED"; + case vcpkg::Dependencies::InstallPlanType::UNKNOWN: return L"UNKNOWN"; + default: return ToString(static_cast(t)); + } + } + + template<> + std::wstring ToString(const vcpkg::Dependencies::RequestType& t) + { + switch (t) + { + case vcpkg::Dependencies::RequestType::AUTO_SELECTED: return L"AUTO_SELECTED"; + case vcpkg::Dependencies::RequestType::USER_REQUESTED: return L"USER_REQUESTED"; + case vcpkg::Dependencies::RequestType::UNKNOWN: return L"UNKNOWN"; + default: return ToString(static_cast(t)); + } + } + + template<> + std::wstring ToString(const vcpkg::PackageSpecParseResult& t) + { + return ToString(static_cast(t)); + } + + template<> + std::wstring ToString(const vcpkg::PackageSpec& t) + { + return ToString(t.to_string()); + } } std::unique_ptr make_status_pgh(const char* name, -- cgit v1.2.3 From a9d989ec056246ea320a56ca7d02b161a6fee387 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 28 Apr 2018 11:26:57 -0700 Subject: [vcpkg-integrate-install] Add vcpkg.path.txt to localappdata for more generic consumption. --- toolsrc/include/vcpkg/userconfig.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/userconfig.h b/toolsrc/include/vcpkg/userconfig.h index 63b8e5481..d044f43ef 100644 --- a/toolsrc/include/vcpkg/userconfig.h +++ b/toolsrc/include/vcpkg/userconfig.h @@ -17,4 +17,6 @@ namespace vcpkg void try_write_data(Files::Filesystem& fs) const; }; + + fs::path get_user_dir(); } -- cgit v1.2.3 From 8f0ebdf8d561ef8402db44cd9abb2c912cff276d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 3 May 2018 15:03:35 -0700 Subject: [vcpkg] Remove utf16 usage from non-Windows --- toolsrc/include/vcpkg/base/strings.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 4cc17bcf4..e165c69da 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -34,9 +34,11 @@ namespace vcpkg::Strings return details::format_internal(fmtstr, to_printf_arg(to_printf_arg(args))...); } +#if defined(_WIN32) std::wstring to_utf16(const CStringView& s); std::string to_utf8(const wchar_t* w); +#endif std::string escape_string(const CStringView& s, char char_to_escape, char escape_char); -- cgit v1.2.3