Delete use of vcpkg_test_cmake and vcpkg_common_functions.
MODIFY
include/vcpkg/build.h
include/vcpkg/build.h
@@ -133,6 +133,12 @@ namespace vcpkg::Build
YES
};
+ enum class BackcompatFeatures
+ {
+ ALLOW = 0,
+ PROHIBIT
+ };
+
struct BuildPackageOptions
{
UseHeadVersion use_head_version;
@@ -144,6 +150,7 @@ namespace vcpkg::Build
DownloadTool download_tool;
PurgeDecompressFailure purge_decompress_failure;
Editable editable;
+ BackcompatFeatures backcompat_features;
};
static constexpr BuildPackageOptions default_build_package_options{
@@ -156,6 +163,20 @@ namespace vcpkg::Build
Build::DownloadTool::BUILT_IN,
Build::PurgeDecompressFailure::YES,
Build::Editable::NO,
+ Build::BackcompatFeatures::ALLOW,
+ };
+
+ static constexpr BuildPackageOptions backcompat_prohibiting_package_options{
+ Build::UseHeadVersion::NO,
+ Build::AllowDownloads::YES,
+ Build::OnlyDownloads::NO,
+ Build::CleanBuildtrees::YES,
+ Build::CleanPackages::YES,
+ Build::CleanDownloads::NO,
+ Build::DownloadTool::BUILT_IN,
+ Build::PurgeDecompressFailure::YES,
+ Build::Editable::NO,
+ Build::BackcompatFeatures::PROHIBIT,
};
static constexpr std::array<BuildResult, 6> BUILD_RESULT_VALUES = {

MODIFY
src/vcpkg/build.cpp
src/vcpkg/build.cpp
@@ -611,6 +611,12 @@ namespace vcpkg::Build
{"FEATURES", Strings::join(";", action.feature_list)},
{"ALL_FEATURES", all_features},
};
+
+ if (action.build_options.backcompat_features == BackcompatFeatures::PROHIBIT)
+ {
+ variables.emplace_back("_VCPKG_PROHIBIT_BACKCOMPAT_FEATURES", "1");
+ }
+
get_generic_cmake_build_args(
paths,
triplet,

MODIFY
src/vcpkg/commands.ci.cpp
src/vcpkg/commands.ci.cpp
@@ -342,7 +342,7 @@ namespace vcpkg::Commands::CI
auto emp = ret->default_feature_provider.emplace(p->spec.name(), scfl->clone());
emp.first->second.source_control_file->core_paragraph->default_features = p->feature_list;
- p->build_options = vcpkg::Build::default_build_package_options;
+ p->build_options = vcpkg::Build::backcompat_prohibiting_package_options;
}
auto precheck_result = binaryprovider.precheck(paths, action);
@@ -512,7 +512,7 @@ namespace vcpkg::Commands::CI
}
else
{
- action.build_options = vcpkg::Build::default_build_package_options;
+ action.build_options = vcpkg::Build::backcompat_prohibiting_package_options;
}
}

MODIFY
src/vcpkg/install.cpp
src/vcpkg/install.cpp
@@ -513,8 +513,9 @@ namespace vcpkg::Install
static constexpr StringLiteral OPTION_WRITE_PACKAGES_CONFIG = "x-write-nuget-packages-config";
static constexpr StringLiteral OPTION_MANIFEST_NO_DEFAULT_FEATURES = "x-no-default-features";
static constexpr StringLiteral OPTION_MANIFEST_FEATURE = "x-feature";
+ static constexpr StringLiteral OPTION_PROHIBIT_BACKCOMPAT_FEATURES = "x-prohibit-backcompat-features";
- static constexpr std::array<CommandSwitch, 9> INSTALL_SWITCHES = {{
+ static constexpr std::array<CommandSwitch, 10> INSTALL_SWITCHES = {{
{OPTION_DRY_RUN, "Do not actually build or install"},
{OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"},
{OPTION_NO_DOWNLOADS, "Do not download new sources"},
@@ -522,9 +523,13 @@ namespace vcpkg::Install
{OPTION_RECURSE, "Allow removal of packages as part of installation"},
{OPTION_KEEP_GOING, "Continue installing packages on failure"},
{OPTION_EDITABLE, "Disable source re-extraction and binary caching for libraries on the command line"},
+
{OPTION_USE_ARIA2, "Use aria2 to perform download tasks"},
{OPTION_CLEAN_AFTER_BUILD, "Clean buildtrees, packages and downloads after building each package"},
+ {OPTION_PROHIBIT_BACKCOMPAT_FEATURES,
+ "(experimental) Fail install if a package attempts to use a deprecated feature"},
}};
+
static constexpr std::array<CommandSwitch, 10> MANIFEST_INSTALL_SWITCHES = {{
{OPTION_DRY_RUN, "Do not actually build or install"},
{OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"},
@@ -758,6 +763,8 @@ namespace vcpkg::Install
const bool clean_after_build = Util::Sets::contains(options.switches, (OPTION_CLEAN_AFTER_BUILD));
const KeepGoing keep_going =
to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING) || only_downloads);
+ const bool prohibit_backcompat_features =
+ Util::Sets::contains(options.switches, (OPTION_PROHIBIT_BACKCOMPAT_FEATURES));
auto& fs = paths.get_filesystem();
@@ -774,6 +781,7 @@ namespace vcpkg::Install
download_tool,
Build::PurgeDecompressFailure::NO,
Util::Enum::to_enum<Build::Editable>(is_editable),
+ prohibit_backcompat_features ? Build::BackcompatFeatures::PROHIBIT : Build::BackcompatFeatures::ALLOW,
};
PortFileProvider::PathsPortFileProvider provider(paths, args.overlay_ports);

MODIFY
src/vcpkg/vcpkgpaths.cpp
src/vcpkg/vcpkgpaths.cpp
@@ -416,16 +416,11 @@ If you wish to silence this error and use classic mode, you can:
auto& fs = this->get_filesystem();
std::map<std::string, std::string> helpers;
auto files = fs.get_files_non_recursive(this->scripts / fs::u8path("cmake"));
- auto common_functions = fs::u8path("vcpkg_common_functions");
for (auto&& file : files)
{
- auto stem = file.stem();
- if (stem != common_functions)
- {
- helpers.emplace(fs::u8string(stem),
+ helpers.emplace(fs::u8string(file.stem()),
Hash::get_file_hash(VCPKG_LINE_INFO, fs, file, Hash::Algorithm::Sha1));
}
- }
return helpers;
});
}

Delete use of vcpkg_test_cmake and vcpkg_common_functions. (#13065)