[Export Command] Enabling Manifest Mode#1136
Merged
vicroms merged 6 commits intomicrosoft:mainfrom Aug 10, 2023
Merged
Conversation
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; }) |
Member
There was a problem hiding this comment.
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); |
This file contains hidden or 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
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 exportcommand.Summary of changes:
vcpkg exportin manifest mode exports everything in the "vcpkg_installed" directory.exportcommand emmits an error and fails whenport:tripletarguments are provided, as they are not allowed in manifest mode.--output-dirmandatory in manifest mode.Docs PR: MicrosoftDocs/vcpkg-docs#116