Change the default triplet to the same as the host triplet on Windows. (#1180)

This removes the 'in September 2023' message and does what the message said we would do. For the next 6 months we'll warn that the behavior changed.

The specific change to triplet.cpp to change the triplet setting is from https://github.com/microsoft/vcpkg-tool/pull/640

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
This commit is contained in:
Billy O'Neal 2023-09-06 16:57:32 -07:00 коммит произвёл GitHub
Родитель 80b792671b
Коммит 51dfe0f4d3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 27 добавлений и 18 удалений

Просмотреть файл

@ -11,7 +11,7 @@ Run-Vcpkg -TestArgs ($commonArgs + @("install", "vcpkg-hello-world-1", "--fast")
Throw-IfNotFailed
if ($IsWindows) {
$warningText = 'Starting with the September 2023 release'
$warningText = 'In the September 2023 release'
# build-external not tested
# ci not tested
@ -36,6 +36,12 @@ if ($IsWindows) {
throw 'depend-info with arg should not emit the triplet warning'
}
$output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('depend-info', 'vcpkg-hello-world-1', '--triplet', 'x64-windows'))
Throw-IfFailed
if ($output.Contains($warningText)) {
throw 'depend-info with new default arg should not emit the triplet warning'
}
# set-installed
$output = Run-VcpkgAndCaptureOutput -TestArgs ($directoryArgs + @('x-set-installed'))
Throw-IfFailed

Просмотреть файл

@ -780,12 +780,14 @@ DECLARE_MESSAGE(DefaultBinaryCacheRequiresDirectory,
"Environment variable VCPKG_DEFAULT_BINARY_CACHE must be a directory (was: {path})")
DECLARE_MESSAGE(DefaultFlag, (msg::option), "", "Defaulting to --{option} being on.")
DECLARE_MESSAGE(DefaultRegistryIsArtifact, (), "", "The default registry cannot be an artifact registry.")
DECLARE_MESSAGE(DefaultTriplet,
(msg::triplet),
"",
"Starting with the September 2023 release, the default triplet for vcpkg libraries will change "
"from x86-windows to the detected host triplet ({triplet}). To resolve this message, add --triplet "
"x86-windows to keep the same behavior.")
DECLARE_MESSAGE(
DefaultTripletChanged,
(msg::triplet),
"The parts naming --triplet are command line switches that should be unlocalized. The space after the last "
"'triplet' and the period is intended to avoid the period looking like it's part of the command line switch",
"In the September 2023 release, the default triplet for vcpkg libraries changed from x86-windows to "
"the detected host triplet ({triplet}). For the old behavior, add --triplet x86-windows . To "
"suppress this message, add --triplet {triplet} .")
DECLARE_MESSAGE(DeleteVcpkgConfigFromManifest,
(msg::path),
"",

Просмотреть файл

@ -461,8 +461,8 @@
"DefaultFlag": "Defaulting to --{option} being on.",
"_DefaultFlag.comment": "An example of {option} is editable.",
"DefaultRegistryIsArtifact": "The default registry cannot be an artifact registry.",
"DefaultTriplet": "Starting with the September 2023 release, the default triplet for vcpkg libraries will change from x86-windows to the detected host triplet ({triplet}). To resolve this message, add --triplet x86-windows to keep the same behavior.",
"_DefaultTriplet.comment": "An example of {triplet} is x64-windows.",
"DefaultTripletChanged": "In the September 2023 release, the default triplet for vcpkg libraries changed from x86-windows to the detected host triplet ({triplet}). For the old behavior, add --triplet x86-windows . To suppress this message, add --triplet {triplet} .",
"_DefaultTripletChanged.comment": "The parts naming --triplet are command line switches that should be unlocalized. The space after the last 'triplet' and the period is intended to avoid the period looking like it's part of the command line switch An example of {triplet} is x64-windows.",
"DeleteVcpkgConfigFromManifest": "-- Or remove \"vcpkg-configuration\" from the manifest file {path}.",
"_DeleteVcpkgConfigFromManifest.comment": "An example of {path} is /foo/bar.",
"DependencyGraphCalculation": "Dependency graph submission enabled.",

Просмотреть файл

@ -104,13 +104,13 @@ namespace vcpkg
Triplet default_triplet(const VcpkgCmdArguments& args, const TripletDatabase& database)
{
#if defined(_WIN32)
auto triplet_name = args.triplet.value_or("x86-windows");
#else
auto triplet_name = args.triplet.value_or(system_triplet_canonical_name());
#endif
check_triplet(triplet_name, database);
return Triplet::from_canonical_name(triplet_name);
if (auto triplet_name = args.triplet.get())
{
check_triplet(*triplet_name, database);
return Triplet::from_canonical_name(*triplet_name);
}
return default_host_triplet(args, database);
}
Triplet default_host_triplet(const VcpkgCmdArguments& args, const TripletDatabase& database)
@ -124,11 +124,12 @@ namespace vcpkg
{
(void)args;
(void)database;
// The triplet is not set by --triplet or VCPKG_DEFAULT_TRIPLET
#if defined(_WIN32)
if (!args.triplet.has_value())
{
msg::println_warning(msgDefaultTriplet, msg::triplet = default_host_triplet(args, database));
// Remove this warning in March 2024
// The triplet is not set by --triplet or VCPKG_DEFAULT_TRIPLET
msg::println_warning(msgDefaultTripletChanged, msg::triplet = default_host_triplet(args, database));
}
#endif // ^^^ _WIN32
}