From 1d3e985e4f1b0d52adf1a8eba7a4c0a092938cfb Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Mon, 8 Jun 2020 22:46:18 -0700 Subject: [vcpkg] Fix OSX CI by ensuring the downloads directory exists (#11839) * [vcpkg] Remove do-nothing Set-Content from Windows azure-pipelines.yml. * [vcpkg] Fix OSX CI by ensuring the downloads directory exists in advance, and extract common command line parameters with powershell splatting. * [tensorflow-cc] Prevent hang building tensorflow-cc asking to configure iOS. * Skip ignition-msgs5:x64-osx --- toolsrc/src/vcpkg/commands.ciclean.cpp | 36 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'toolsrc/src') diff --git a/toolsrc/src/vcpkg/commands.ciclean.cpp b/toolsrc/src/vcpkg/commands.ciclean.cpp index 9c69d1931..74b9b35ab 100644 --- a/toolsrc/src/vcpkg/commands.ciclean.cpp +++ b/toolsrc/src/vcpkg/commands.ciclean.cpp @@ -2,31 +2,39 @@ #include #include +#include #include #include using namespace vcpkg; -namespace vcpkg::Commands::CIClean -{ - void perform_and_exit(const VcpkgCmdArguments&, const VcpkgPaths& paths) +namespace { + void clear_directory(Files::Filesystem& fs, const fs::path& target) { - auto& fs = paths.get_filesystem(); - if (fs.is_directory(paths.buildtrees)) + using vcpkg::System::print2; + if (fs.is_directory(target)) { - fs.remove_all_inside(paths.buildtrees, VCPKG_LINE_INFO); + print2("Clearing contents of ", target.u8string(), "\n"); + fs.remove_all_inside(target, VCPKG_LINE_INFO); } - - if (fs.is_directory(paths.installed)) - { - fs.remove_all_inside(paths.installed, VCPKG_LINE_INFO); - } - - if (fs.is_directory(paths.packages)) + else { - fs.remove_all_inside(paths.packages, VCPKG_LINE_INFO); + print2("Skipping clearing contents of ", target.u8string(), " because it was not a directory\n"); } + } +} +namespace vcpkg::Commands::CIClean +{ + void perform_and_exit(const VcpkgCmdArguments&, const VcpkgPaths& paths) + { + using vcpkg::System::print2; + auto& fs = paths.get_filesystem(); + print2("Starting vcpkg CI clean\n"); + clear_directory(fs, paths.buildtrees); + clear_directory(fs, paths.installed); + clear_directory(fs, paths.packages); + print2("Completed vcpkg CI clean\n"); Checks::exit_success(VCPKG_LINE_INFO); } } -- cgit v1.2.3