[M6] preserve every probe's scratch under last-failure/<pkg>/
This commit is contained in:
@@ -160,14 +160,17 @@ auto cmd_build(const fs::path& project_root, bool no_build, bool release,
|
||||
return cmd_build(root, /*no_build=*/false, /*release=*/false,
|
||||
/*target=*/std::nullopt, effective_overlay);
|
||||
};
|
||||
const auto scratch_root =
|
||||
std::filesystem::temp_directory_path() /
|
||||
std::format("cargoxx-discover-{}", std::random_device{}());
|
||||
auto disc = resolver::discover(name, version, components,
|
||||
effective_overlay, scratch_root, build_fn);
|
||||
const auto scratch_root = resolver::last_failure_dir(name);
|
||||
std::error_code ec;
|
||||
std::filesystem::remove_all(scratch_root, ec);
|
||||
std::filesystem::create_directories(scratch_root, ec);
|
||||
auto disc = resolver::discover(name, version, components,
|
||||
effective_overlay, scratch_root, build_fn);
|
||||
if (!disc) {
|
||||
std::cerr << std::format(
|
||||
"note: every probe attempt's scratch project is preserved at\n"
|
||||
" {}/ — re-run cmake inside any subdir to reproduce.\n",
|
||||
scratch_root.string());
|
||||
return std::unexpected(disc.error());
|
||||
}
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user