From 1f79c92eb099de356a5cb1e42234bb227e09d543 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 18 Sep 2018 20:55:35 -0700 Subject: Add command x-vsinstances --- toolsrc/include/vcpkg/commands.h | 6 ++++++ toolsrc/include/vcpkg/visualstudio.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 1858a320f..fd7d832b3 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -119,6 +119,12 @@ namespace vcpkg::Commands void perform_and_exit(const VcpkgCmdArguments& args); } + namespace X_VSInstances + { + extern const CommandStructure COMMAND_STRUCTURE; + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + namespace Hash { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); diff --git a/toolsrc/include/vcpkg/visualstudio.h b/toolsrc/include/vcpkg/visualstudio.h index b93b145d9..cd99db352 100644 --- a/toolsrc/include/vcpkg/visualstudio.h +++ b/toolsrc/include/vcpkg/visualstudio.h @@ -6,6 +6,8 @@ namespace vcpkg::VisualStudio { + std::vector get_visual_studio_instances(const VcpkgPaths& paths); + std::vector find_toolset_instances_preferred_first(const VcpkgPaths& paths); } -- cgit v1.2.3 From 276da906c51d5ddccd9c282fdcb75db36944dc62 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 8 Oct 2018 17:14:28 -0700 Subject: Remove status_known() --- toolsrc/include/vcpkg/base/files.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index eee910841..ed12ffd74 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -20,7 +20,6 @@ namespace fs inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); } inline bool is_directory(file_status s) { return stdfs::is_directory(s); } - inline bool status_known(file_status s) { return stdfs::status_known(s); } } namespace vcpkg::Files -- cgit v1.2.3 From 56e1d2f6961693b45f2b61b6e6985229be56e674 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 16 Oct 2018 00:35:47 -0700 Subject: [vcpkg] Wrap all external process spawning in a Ctrl-C catcher to avoid corrupted consoles --- toolsrc/include/vcpkg/base/system.h | 8 ++++---- toolsrc/include/vcpkg/globalstate.h | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 3c4326ade..005e09a3f 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -32,15 +32,15 @@ namespace vcpkg::System }; int cmd_execute_clean(const CStringView cmd_line, - const std::unordered_map& extra_env = {}); + const std::unordered_map& extra_env = {}) noexcept; - int cmd_execute(const CStringView cmd_line); + int cmd_execute(const CStringView cmd_line) noexcept; #if defined(_WIN32) - void cmd_execute_no_wait(const CStringView cmd_line); + void cmd_execute_no_wait(const CStringView cmd_line) noexcept; #endif - ExitCodeAndOutput cmd_execute_and_capture_output(const CStringView cmd_line); + ExitCodeAndOutput cmd_execute_and_capture_output(const CStringView cmd_line) noexcept; enum class Color { diff --git a/toolsrc/include/vcpkg/globalstate.h b/toolsrc/include/vcpkg/globalstate.h index bc28e3ff8..2a76c8741 100644 --- a/toolsrc/include/vcpkg/globalstate.h +++ b/toolsrc/include/vcpkg/globalstate.h @@ -18,5 +18,25 @@ namespace vcpkg static std::atomic g_init_console_cp; static std::atomic g_init_console_output_cp; + static std::atomic g_init_console_initialized; + + struct CtrlCStateMachine + { + void transition_to_spawn_process() noexcept; + void transition_from_spawn_process() noexcept; + void transition_handle_ctrl_c() noexcept; + + private: + enum class CtrlCState + { + normal, + blocked_on_child, + exit_requested, + }; + + std::atomic m_state = CtrlCState::normal; + }; + + static CtrlCStateMachine g_ctrl_c_state; }; } -- cgit v1.2.3 From df82d21f320285a8f4cbf16756d8e035cdc74e7c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 16 Oct 2018 05:53:57 -0700 Subject: [vcpkg] Fix OSX build for old GCC versions --- toolsrc/include/vcpkg/globalstate.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/globalstate.h b/toolsrc/include/vcpkg/globalstate.h index 2a76c8741..ae66ca355 100644 --- a/toolsrc/include/vcpkg/globalstate.h +++ b/toolsrc/include/vcpkg/globalstate.h @@ -22,6 +22,8 @@ namespace vcpkg struct CtrlCStateMachine { + CtrlCStateMachine(); + void transition_to_spawn_process() noexcept; void transition_from_spawn_process() noexcept; void transition_handle_ctrl_c() noexcept; @@ -34,7 +36,7 @@ namespace vcpkg exit_requested, }; - std::atomic m_state = CtrlCState::normal; + std::atomic m_state; }; static CtrlCStateMachine g_ctrl_c_state; -- cgit v1.2.3 From 3d12e5ca72d948121463beec6e48290877684471 Mon Sep 17 00:00:00 2001 From: LRFLEW Date: Wed, 17 Oct 2018 12:46:27 -0600 Subject: Handle symlink when installing or removing a library (#4479) --- toolsrc/include/vcpkg/base/files.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index ed12ffd74..b07ff25b3 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -20,6 +20,7 @@ namespace fs inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); } inline bool is_directory(file_status s) { return stdfs::is_directory(s); } + inline bool is_symlink(file_status s) { return stdfs::is_symlink(s); } } namespace vcpkg::Files @@ -54,7 +55,9 @@ namespace vcpkg::Files const fs::path& newpath, fs::copy_options opts, std::error_code& ec) = 0; + virtual void copy_symlink(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) = 0; virtual fs::file_status status(const fs::path& path, std::error_code& ec) const = 0; + virtual fs::file_status symlink_status(const fs::path& path, std::error_code& ec) const = 0; virtual std::vector find_from_PATH(const std::string& name) const = 0; -- cgit v1.2.3 From f19df646a09d68856c5c4575174831f0d0a295e1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 17 Oct 2018 19:05:24 -0700 Subject: Survey times. Refactor Chrono stuff. All times UTC, unless explicitly mentioned Survey is set to be every 6 months, but you also get one in the first 10 days. --- toolsrc/include/vcpkg/base/chrono.h | 8 ++++++-- toolsrc/include/vcpkg/base/system.h | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/chrono.h b/toolsrc/include/vcpkg/base/chrono.h index aa764a597..6f6e2b317 100644 --- a/toolsrc/include/vcpkg/base/chrono.h +++ b/toolsrc/include/vcpkg/base/chrono.h @@ -52,8 +52,10 @@ namespace vcpkg::Chrono static Optional get_current_date_time(); static Optional parse(CStringView str); - constexpr CTime() noexcept : m_tm{0} {} - explicit constexpr CTime(tm t) noexcept : m_tm{t} {} + constexpr CTime() noexcept : m_tm {0} {} + explicit constexpr CTime(tm t) noexcept : m_tm {t} {} + + CTime add_hours(const int hours) const; std::string to_string() const; @@ -62,4 +64,6 @@ namespace vcpkg::Chrono private: mutable tm m_tm; }; + + tm get_current_date_time_local(); } diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 005e09a3f..af56e45c1 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -8,8 +8,6 @@ namespace vcpkg::System { - tm get_current_date_time(); - fs::path get_exe_path_of_current_process(); struct CMakeVariable -- cgit v1.2.3