Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported platform added for env (fixes #29559) #891

Merged
merged 6 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion azure-pipelines/end-to-end-tests-dir/env-tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
1 change: 1 addition & 0 deletions include/vcpkg/base/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
"",
Expand Down
1 change: 1 addition & 0 deletions locales/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
1 change: 1 addition & 0 deletions src/vcpkg/base/messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion src/vcpkg/commands.env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down