Fix formatting, hash override, don't move pre_build_info
MODIFY
src/vcpkg/binaryparagraph.cpp
src/vcpkg/binaryparagraph.cpp
#include <vcpkg/base/checks.h>
#include <vcpkg/base/hash.h>
#include <vcpkg/base/system.print.h>
-#include <vcpkg/base/util.h>
#include <vcpkg/binaryparagraph.h>
#include <vcpkg/parse.h>

MODIFY
src/vcpkg/build.cpp
src/vcpkg/build.cpp
@@ -263,8 +263,7 @@ namespace vcpkg::Build
return BinaryParagraph(source_paragraph, feature_paragraph, triplet);
}
- static std::unique_ptr<BinaryControlFile> create_binary_control_file(
- const SourceParagraph& source_paragraph,
+ static std::unique_ptr<BinaryControlFile> create_binary_control_file(const SourceParagraph& source_paragraph,
const Triplet& triplet,
const BuildInfo& build_info,
const PreBuildInfo& pre_build_info,
@@ -554,12 +553,7 @@ namespace vcpkg::Build
PostBuildLint::perform_all_checks(spec, paths, pre_build_info, build_info, config.port_dir);
std::unique_ptr<BinaryControlFile> bcf =
- create_binary_control_file(
- *config.scf.core_paragraph,
- triplet,
- build_info,
- std::move(pre_build_info),
- abi_tag);
+ create_binary_control_file(*config.scf.core_paragraph, triplet, build_info, pre_build_info, abi_tag);
if (error_count != 0)
{
@@ -632,8 +626,7 @@ namespace vcpkg::Build
{
if (fs::is_regular_file(status(port_file)))
{
- hashes_files.emplace_back(
- vcpkg::Hash::get_file_hash(fs, port_file, "SHA1"),
+ hashes_files.emplace_back(vcpkg::Hash::get_file_hash(fs, port_file, "SHA1"),
port_file.path().filename().u8string());
if (hashes_files.size() > max_port_file_count)
@@ -652,11 +645,7 @@ namespace vcpkg::Build
{
// We've already sorted by hash so it's safe to write down the
// filename, which will be consistent across machines.
- abi_tag_entries.emplace_back(
- AbiEntry{
- std::move(hash_file.second),
- std::move(hash_file.first)
- });
+ abi_tag_entries.emplace_back(AbiEntry{std::move(hash_file.second), std::move(hash_file.first)});
}
}
@@ -677,11 +666,9 @@ namespace vcpkg::Build
if (pre_build_info.public_abi_override)
{
- abi_tag_entries.emplace_back(
- AbiEntry{
+ abi_tag_entries.emplace_back(AbiEntry{
"public_abi_override",
- pre_build_info.public_abi_override.value_or_exit(VCPKG_LINE_INFO)
- });
+ Hash::get_string_hash(pre_build_info.public_abi_override.value_or_exit(VCPKG_LINE_INFO), "SHA1")});
}
if (config.build_package_options.use_head_version == UseHeadVersion::YES)
@@ -791,16 +778,11 @@ namespace vcpkg::Build
if (!required_fspecs.empty())
{
- return {
- BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES,
- std::move(required_fspecs)
- };
+ return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)};
}
const PackageSpec spec =
- PackageSpec::from_name_and_triplet(
- config.scf.core_paragraph->name,
- triplet).value_or_exit(VCPKG_LINE_INFO);
+ PackageSpec::from_name_and_triplet(config.scf.core_paragraph->name, triplet).value_or_exit(VCPKG_LINE_INFO);
std::vector<AbiEntry> dependency_abis;
@@ -820,11 +802,7 @@ namespace vcpkg::Build
if (!maybe_abi_tag_and_file)
{
return do_build_package_and_clean_buildtrees(
- paths,
- pre_build_info,
- spec,
- pre_build_info.public_abi_override.value_or(AbiTagAndFile{}.tag),
- config);
+ paths, pre_build_info, spec, pre_build_info.public_abi_override.value_or(AbiTagAndFile{}.tag), config);
}
std::error_code ec;
@@ -878,16 +856,10 @@ 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());
- ExtendedBuildResult result =
- do_build_package_and_clean_buildtrees(
- paths,
- pre_build_info,
- spec,
- pre_build_info.public_abi_override.value_or(abi_tag_and_file->tag),
- config);
+ ExtendedBuildResult result = do_build_package_and_clean_buildtrees(
+ paths, pre_build_info, spec, pre_build_info.public_abi_override.value_or(abi_tag_and_file->tag), config);
- if (config.build_package_options.binary_caching == BinaryCaching::YES &&
- 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");
@@ -906,8 +878,7 @@ namespace vcpkg::Build
System::printf("Stored binary cache: %s\n", archive_path.u8string());
}
else if (config.build_package_options.binary_caching == BinaryCaching::YES &&
- (result.code == BuildResult::BUILD_FAILED ||
- result.code == BuildResult::POST_BUILD_CHECKS_FAILED))
+ (result.code == BuildResult::BUILD_FAILED || result.code == BuildResult::POST_BUILD_CHECKS_FAILED))
{
if (!fs.exists(archive_tombstone_path))
{

Fix formatting, hash override, don't move pre_build_info