diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-09 19:46:43 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-09 19:47:15 -0800 |
| commit | b2465a175570df33730937c250357bd1f092b277 (patch) | |
| tree | 753f6cc2c3d536af3fefa9ad93cd8546bcf35fb3 | |
| parent | ca45a305cff2c39e162271cdb64314ca10e38363 (diff) | |
| download | vcpkg-b2465a175570df33730937c250357bd1f092b277.tar.gz vcpkg-b2465a175570df33730937c250357bd1f092b277.zip | |
[vcpkg-ci] Delete intermediate build folders even on unsuccesful builds
| -rw-r--r-- | toolsrc/src/vcpkg/build.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 295bd240e..7de276f4f 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -258,9 +258,9 @@ namespace vcpkg::Build paths.get_filesystem().write_contents(binary_control_file, start); } - ExtendedBuildResult build_package(const VcpkgPaths& paths, - const BuildPackageConfig& config, - const StatusParagraphs& status_db) + static ExtendedBuildResult do_build_package(const VcpkgPaths& paths, + const BuildPackageConfig& config, + const StatusParagraphs& status_db) { const PackageSpec spec = PackageSpec::from_name_and_triplet(config.scf.core_paragraph->name, config.triplet) .value_or_exit(VCPKG_LINE_INFO); @@ -369,10 +369,19 @@ namespace vcpkg::Build write_binary_control_file(paths, *bcf); + return {BuildResult::SUCCEEDED, std::move(bcf)}; + } + + ExtendedBuildResult build_package(const VcpkgPaths& paths, + const BuildPackageConfig& config, + const StatusParagraphs& status_db) + { + ExtendedBuildResult result = do_build_package(paths, config, status_db); + if (config.build_package_options.clean_buildtrees == CleanBuildtrees::YES) { auto& fs = paths.get_filesystem(); - auto buildtrees_dir = paths.buildtrees / spec.name(); + auto buildtrees_dir = paths.buildtrees / config.scf.core_paragraph->name; auto buildtree_files = fs.get_files_non_recursive(buildtrees_dir); for (auto&& file : buildtree_files) { @@ -384,7 +393,7 @@ namespace vcpkg::Build } } - return {BuildResult::SUCCEEDED, std::move(bcf)}; + return result; } const std::string& to_string(const BuildResult build_result) |
