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

[ci] Change triplet to be processed the same way as how other commands get their triplet. #442

Merged
merged 1 commit into from
Mar 18, 2022
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
6 changes: 3 additions & 3 deletions azure-pipelines/end-to-end-tests-dir/ci.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
. $PSScriptRoot/../end-to-end-tests-prelude.ps1

# Not a number
Run-Vcpkg ci $Triplet --x-skipped-cascade-count=fish
Run-Vcpkg ci --triplet=$Triplet --x-skipped-cascade-count=fish
Throw-IfNotFailed

# Negative
Run-Vcpkg ci $Triplet --x-skipped-cascade-count=-1
Run-Vcpkg ci --triplet=$Triplet --x-skipped-cascade-count=-1
Throw-IfNotFailed

# Clearly not the correct answer
Run-Vcpkg ci $Triplet --x-skipped-cascade-count=1000
Run-Vcpkg ci --triplet=$Triplet --x-skipped-cascade-count=1000
Throw-IfNotFailed
12 changes: 7 additions & 5 deletions src/vcpkg/commands.ci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ namespace vcpkg::Commands::CI
}};

const CommandStructure COMMAND_STRUCTURE = {
create_example_string("ci x64-windows"),
1,
1,
create_example_string("ci --triplet=x64-windows"),
0,
0,
{CI_SWITCHES, CI_SETTINGS},
nullptr,
};
Expand Down Expand Up @@ -475,7 +475,10 @@ namespace vcpkg::Commands::CI
return result;
}

void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet, Triplet host_triplet)
void perform_and_exit(const VcpkgCmdArguments& args,
const VcpkgPaths& paths,
Triplet target_triplet,
Triplet host_triplet)
{
vcpkg::print2(Color::warning,
"'vcpkg ci' is an internal command which will change incompatibly or be removed at any time.\n");
Expand All @@ -484,7 +487,6 @@ namespace vcpkg::Commands::CI
const auto& settings = options.settings;

BinaryCache binary_cache{args, paths};
Triplet target_triplet = Triplet::from_canonical_name(std::string(args.command_arguments[0]));
ExclusionPredicate is_excluded{
parse_exclusions(settings, OPTION_EXCLUDE),
parse_exclusions(settings, OPTION_HOST_EXCLUDE),
Expand Down