diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2020-05-08 12:41:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-08 12:41:44 -0700 |
| commit | 8de3f323dcf60790bf049284b9b7d7232a87984d (patch) | |
| tree | 3ad60649f9311528d646a37a550ac6efafeddf17 /toolsrc/src/vcpkg.cpp | |
| parent | 62d5125c5d11053af60bbb1e461c50be3b080c9f (diff) | |
| download | vcpkg-8de3f323dcf60790bf049284b9b7d7232a87984d.tar.gz vcpkg-8de3f323dcf60790bf049284b9b7d7232a87984d.zip | |
[vcpkg] Resolve relative overlay ports to the current working directory. (#11233)
Fixes #10771.
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 4e6109c38..39f588915 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -119,22 +119,30 @@ static void inner(const VcpkgCmdArguments& args) Debug::print("Using vcpkg-root: ", vcpkg_root_dir.u8string(), '\n'); Optional<fs::path> install_root_dir; - if (args.install_root_dir) { + if (args.install_root_dir) + { install_root_dir = Files::get_real_filesystem().canonical(VCPKG_LINE_INFO, fs::u8path(*args.install_root_dir)); Debug::print("Using install-root: ", install_root_dir.value_or_exit(VCPKG_LINE_INFO).u8string(), '\n'); } - Optional<fs::path> vcpkg_scripts_root_dir = nullopt; + Optional<fs::path> vcpkg_scripts_root_dir; if (args.scripts_root_dir) { - vcpkg_scripts_root_dir = Files::get_real_filesystem().canonical(VCPKG_LINE_INFO, fs::u8path(*args.scripts_root_dir)); + vcpkg_scripts_root_dir = + Files::get_real_filesystem().canonical(VCPKG_LINE_INFO, fs::u8path(*args.scripts_root_dir)); Debug::print("Using scripts-root: ", vcpkg_scripts_root_dir.value_or_exit(VCPKG_LINE_INFO).u8string(), '\n'); } auto default_vs_path = System::get_environment_variable("VCPKG_VISUAL_STUDIO_PATH").value_or(""); - const Expected<VcpkgPaths> expected_paths = - VcpkgPaths::create(vcpkg_root_dir, install_root_dir, vcpkg_scripts_root_dir, default_vs_path, args.overlay_triplets.get()); + auto original_cwd = Files::get_real_filesystem().current_path(VCPKG_LINE_INFO); + + const Expected<VcpkgPaths> expected_paths = VcpkgPaths::create(vcpkg_root_dir, + install_root_dir, + vcpkg_scripts_root_dir, + default_vs_path, + args.overlay_triplets.get(), + original_cwd); Checks::check_exit(VCPKG_LINE_INFO, !expected_paths.error(), "Error: Invalid vcpkg root directory %s: %s", |
