diff --git a/azure-pipelines/end-to-end-tests-dir/env-tools.ps1 b/azure-pipelines/end-to-end-tests-dir/env-tools.ps1 index 51e589610a..8019538876 100644 --- a/azure-pipelines/end-to-end-tests-dir/env-tools.ps1 +++ b/azure-pipelines/end-to-end-tests-dir/env-tools.ps1 @@ -2,4 +2,6 @@ $env:VCPKG_DOWNLOADS = Join-Path $TestingRoot 'empty downloads' Run-Vcpkg env --bin --tools --python set -Throw-IfFailed +if ($IsWindows) { + Throw-IfFailed +} diff --git a/include/vcpkg/base/messages.h b/include/vcpkg/base/messages.h index 723463f236..199d0b7238 100644 --- a/include/vcpkg/base/messages.h +++ b/include/vcpkg/base/messages.h @@ -1100,6 +1100,7 @@ namespace vcpkg "{value} is the invalid value of an environment variable", "{env_var} is {value}, must be > 0"); DECLARE_MESSAGE(EnvStrFailedToExtract, (), "", "could not expand the environment string:"); + DECLARE_MESSAGE(EnvPlatformNotSupported, (), "", "Build environment commands are not supported on this platform"); DECLARE_MESSAGE(ErrorDetectingCompilerInfo, (msg::path), "", diff --git a/locales/messages.json b/locales/messages.json index 243df37812..d529e2412b 100644 --- a/locales/messages.json +++ b/locales/messages.json @@ -389,6 +389,7 @@ "EnvInvalidMaxConcurrency": "{env_var} is {value}, must be > 0", "_EnvInvalidMaxConcurrency.comment": "{value} is the invalid value of an environment variable An example of {env_var} is VCPKG_DEFAULT_TRIPLET.", "EnvStrFailedToExtract": "could not expand the environment string:", + "EnvPlatformNotSupported": "Build environment commands are not supported on this platform", "ErrorDetectingCompilerInfo": "while detecting compiler information:\nThe log file content at \"{path}\" is:", "_ErrorDetectingCompilerInfo.comment": "An example of {path} is /foo/bar.", "ErrorIndividualPackagesUnsupported": "In manifest mode, `vcpkg install` does not support individual package arguments.\nTo install additional packages, edit vcpkg.json and then run `vcpkg install` without any package arguments.", diff --git a/src/vcpkg/base/messages.cpp b/src/vcpkg/base/messages.cpp index 063f140c02..26c1b76b8a 100644 --- a/src/vcpkg/base/messages.cpp +++ b/src/vcpkg/base/messages.cpp @@ -663,6 +663,7 @@ namespace vcpkg REGISTER_MESSAGE(EndOfStringInCodeUnit); REGISTER_MESSAGE(EnvInvalidMaxConcurrency); REGISTER_MESSAGE(EnvStrFailedToExtract); + REGISTER_MESSAGE(EnvPlatformNotSupported); REGISTER_MESSAGE(ErrorDetectingCompilerInfo); REGISTER_MESSAGE(ErrorIndividualPackagesUnsupported); REGISTER_MESSAGE(ErrorInvalidClassicModeOption); diff --git a/src/vcpkg/commands.env.cpp b/src/vcpkg/commands.env.cpp index 5072f5d57a..6953f55ae4 100644 --- a/src/vcpkg/commands.env.cpp +++ b/src/vcpkg/commands.env.cpp @@ -101,11 +101,16 @@ namespace vcpkg::Commands::Env #if defined(_WIN32) env = cmd_execute_and_capture_environment(build_env_cmd, env); #else // ^^^ _WIN32 / !_WIN32 vvv - Checks::exit_with_message(VCPKG_LINE_INFO, "Build environment commands are not supported on this platform"); + Checks::msg_exit_with_message(VCPKG_LINE_INFO, msgEnvPlatformNotSupported); #endif // ^^^ !_WIN32 } +#if defined(_WIN32) Command cmd("cmd"); +#else // ^^^ _WIN32 / !_WIN32 vvv + Command cmd(""); + Checks::msg_exit_with_message(VCPKG_LINE_INFO, msgEnvPlatformNotSupported); +#endif // ^^^ !_WIN32 if (!args.command_arguments.empty()) { cmd.string_arg("/c").raw_arg(args.command_arguments[0]);