3 Commits
Author SHA1 Message Date
ggarzia-MSFTandCopilot Autofix powered by AI b0a14e5fb8 refactor container cp task to be simpler and move logic to container service and common filesystem helpers (#41668)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-02 11:47:08 -07:00
ggarzia-MSFTandCopilot b5f2411d3b wslc: add --follow-link to cp (#41501)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-18 12:11:33 -07:00
ggarzia-MSFTandCopilot e5385a5af2 Make paths absolute before weakly_canonical and add regression tests (#41290)
std::filesystem::weakly_canonical only returns an absolute path when a leading
element of its input exists, so a relative path naming a file that has not been
created yet is returned unchanged, still relative. The service then rejects it
with "Path is not absolute". This affected `wslc build --iidfile <relative>` and
`--secret src=<relative>`, plus the distribution path and virtiofs share path
helpers in the service. Add wsl::windows::common::filesystem::GetCanonicalPath,
which applies std::filesystem::absolute first so the result is absolute whether
or not the path exists, and replace the direct weakly_canonical calls with it.
It checks the error from absolute before canonicalizing, because absolute
returns an empty path on failure and weakly_canonical both succeeds on an empty
path and clears the error_code on success, so nesting the two calls would
discard the failure and report success

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-12 09:35:10 -07:00