-
Notifications
You must be signed in to change notification settings - Fork 280
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
[Export Command] Enabling Manifest Mode #1136
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ras0219-msft
previously requested changes
Jul 22, 2023
vicroms
reviewed
Aug 9, 2023
Comment on lines
+394
to
+421
if (paths.manifest_mode_enabled()) | ||
{ | ||
auto output_dir_opt = Util::lookup_value(options.settings, OPTION_OUTPUT_DIR); | ||
|
||
// --output-dir is required in manifest mode | ||
if (auto d = output_dir_opt.get()) | ||
{ | ||
ret.output_dir = paths.original_cwd / *d; | ||
} | ||
else | ||
{ | ||
msg::println_error(msgMissingOption, msg::option = "output-dir"); | ||
Checks::exit_fail(VCPKG_LINE_INFO); | ||
} | ||
|
||
// Force enable --all-installed in manifest mode | ||
ret.all_installed = true; | ||
|
||
// In manifest mode the entire installed directory is exported | ||
if (!options.command_arguments.empty()) | ||
{ | ||
msg::println_error(msgUnexpectedArgument, msg::option = options.command_arguments[0]); | ||
Checks::exit_fail(VCPKG_LINE_INFO); | ||
} | ||
} | ||
|
||
ret.output_dir = ret.output_dir.empty() ? Util::lookup_value(options.settings, OPTION_OUTPUT_DIR) | ||
.map([&](const Path& p) { return paths.original_cwd / p; }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
if (paths.manifest_mode_enabled()) | |
{ | |
auto output_dir_opt = Util::lookup_value(options.settings, OPTION_OUTPUT_DIR); | |
// --output-dir is required in manifest mode | |
if (auto d = output_dir_opt.get()) | |
{ | |
ret.output_dir = paths.original_cwd / *d; | |
} | |
else | |
{ | |
msg::println_error(msgMissingOption, msg::option = "output-dir"); | |
Checks::exit_fail(VCPKG_LINE_INFO); | |
} | |
// Force enable --all-installed in manifest mode | |
ret.all_installed = true; | |
// In manifest mode the entire installed directory is exported | |
if (!options.command_arguments.empty()) | |
{ | |
msg::println_error(msgUnexpectedArgument, msg::option = options.command_arguments[0]); | |
Checks::exit_fail(VCPKG_LINE_INFO); | |
} | |
} | |
ret.output_dir = ret.output_dir.empty() ? Util::lookup_value(options.settings, OPTION_OUTPUT_DIR) | |
.map([&](const Path& p) { return paths.original_cwd / p; }) | |
auto output_dir_arg = Util::lookup_value(options.settings, OPTION_OUTPUT_DIR); | |
if (paths.manifest_mode_enabled()) | |
{ | |
if (!output_dir_arg) | |
{ | |
msg::println_error(msgMissingOption, msg::option = "output-dir"); | |
Checks::exit_fail(VCPKG_LINE_INFO); | |
} | |
// Force enable --all-installed in manifest mode | |
ret.all_installed = true; | |
// In manifest mode the entire installed directory is exported | |
if (!options.command_arguments.empty()) | |
{ | |
msg::println_error(msgUnexpectedArgument, msg::option = options.command_arguments[0]); | |
Checks::exit_fail(VCPKG_LINE_INFO); | |
} | |
} | |
ret.output_dir = output_dir_arg.map([&](const Path& p) { return paths.original_cwd / p; }).value_or(paths.root); |
vicroms
approved these changes
Aug 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables manifest mode for the
vcpkg export
command.Summary of changes:
vcpkg export
in manifest mode exports everything in the "vcpkg_installed" directory.export
command emmits an error and fails whenport:triplet
arguments are provided, as they are not allowed in manifest mode.--output-dir
mandatory in manifest mode.Docs PR: microsoft/vcpkg-docs#116