always calculate abi
MODIFY
src/vcpkg/build.cpp
src/vcpkg/build.cpp
@@ -623,8 +623,6 @@ namespace vcpkg::Build
const PreBuildInfo& pre_build_info,
Span<const AbiEntry> dependency_abis)
{
- if (config.build_package_options.binary_caching == BinaryCaching::NO) return nullopt;
-
auto& fs = paths.get_filesystem();
const Triplet& triplet = config.triplet;
const std::string& name = config.scf.core_paragraph->name;
@@ -713,7 +711,7 @@ namespace vcpkg::Build
}
System::print2(
- "Warning: binary caching disabled because abi keys are missing values:\n",
+ "Warning: abi keys are missing values:\n",
Strings::join("", abi_tag_entries_missing, [](const AbiEntry& e) { return " " + e.key + "\n"; }),
"\n");
@@ -814,15 +812,14 @@ namespace vcpkg::Build
auto maybe_abi_tag_and_file = compute_abi_tag(paths, config, pre_build_info, dependency_abis);
const auto abi_tag_and_file = maybe_abi_tag_and_file.get();
-
- if (config.build_package_options.binary_caching == BinaryCaching::YES && abi_tag_and_file)
- {
const fs::path archives_root_dir = paths.root / "archives";
const std::string archive_name = abi_tag_and_file->tag + ".zip";
const fs::path archive_subpath = fs::u8path(abi_tag_and_file->tag.substr(0, 2)) / archive_name;
const fs::path archive_path = archives_root_dir / archive_subpath;
const fs::path archive_tombstone_path = archives_root_dir / "fail" / archive_subpath;
+ if (config.build_package_options.binary_caching == BinaryCaching::YES && abi_tag_and_file)
+ {
if (fs.exists(archive_path))
{
System::print2("Using cached binary package: ", archive_path.u8string(), "\n");
@@ -855,9 +852,15 @@ namespace vcpkg::Build
}
System::printf("Could not locate cached archive: %s\n", archive_path.u8string());
+ }
- ExtendedBuildResult result = do_build_package_and_clean_buildtrees(
- paths, pre_build_info, spec, maybe_abi_tag_and_file.value_or(AbiTagAndFile{}).tag, config);
+ ExtendedBuildResult result =
+ do_build_package_and_clean_buildtrees(
+ paths,
+ pre_build_info,
+ spec,
+ maybe_abi_tag_and_file.value_or(AbiTagAndFile{}).tag,
+ config);
std::error_code ec;
fs.create_directories(paths.package_dir(spec) / "share" / spec.name(), ec);
@@ -865,7 +868,8 @@ namespace vcpkg::Build
fs.copy_file(abi_tag_and_file->tag_file, abi_file_in_package, fs::stdfs::copy_options::none, ec);
Checks::check_exit(VCPKG_LINE_INFO, !ec, "Could not copy into file: %s", abi_file_in_package.u8string());
- if (result.code == BuildResult::SUCCEEDED)
+ if (config.build_package_options.binary_caching == BinaryCaching::YES &&
+ result.code == BuildResult::SUCCEEDED)
{
const auto tmp_archive_path = paths.buildtrees / spec.name() / (spec.triplet().to_string() + ".zip");
@@ -883,7 +887,9 @@ namespace vcpkg::Build
else
System::printf("Stored binary cache: %s\n", archive_path.u8string());
}
- else if (result.code == BuildResult::BUILD_FAILED || result.code == BuildResult::POST_BUILD_CHECKS_FAILED)
+ else if (config.build_package_options.binary_caching == BinaryCaching::YES &&
+ (result.code == BuildResult::BUILD_FAILED ||
+ result.code == BuildResult::POST_BUILD_CHECKS_FAILED))
{
if (!fs.exists(archive_tombstone_path))
{
@@ -917,10 +923,6 @@ namespace vcpkg::Build
return result;
}
- return do_build_package_and_clean_buildtrees(
- paths, pre_build_info, spec, maybe_abi_tag_and_file.value_or(AbiTagAndFile{}).tag, config);
- }
-
const std::string& to_string(const BuildResult build_result)
{
static const std::string NULLVALUE_STRING = Enums::nullvalue_to_string("vcpkg::Commands::Build::BuildResult");

always calculate abi