Conversation
Build Metrics ReportBinary Sizes
Test Results✅ 714 passed out of 714 tests in 345.1s (+16 tests, -56.1s vs. baseline) Test Coverage❌ 21% line coverage, 37.1% branch coverage · ✅ +0.1% vs. baseline CLI Startup Time40ms median (x64, Updated 2026-04-09 03:40:09 UTC · commit |
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #391 where winapp run fails on long (> ~260 char) paths by making the CLI long-path aware and adding path-handling utilities/workarounds for external tool and WinRT deployment operations.
Changes:
- Mark the CLI executable as
longPathAwarevia an application manifest. - Add
LongPathHelperand use extended-length (\\?\) prefixes when invoking build tools (MakePri/MakeAppx). - Work around WinRT
PackageManagerpath limitations by converting relevant paths to 8.3 short paths and adding fast-fail validation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/winapp-CLI/WinApp.Cli/WinApp.Cli.csproj | Wires in the application manifest to enable long-path awareness. |
| src/winapp-CLI/WinApp.Cli/app.manifest | Declares the process as longPathAware. |
| src/winapp-CLI/WinApp.Cli/Helpers/LongPathHelper.cs | Introduces long-path validation, extended-length prefixing, and 8.3 short-path conversion. |
| src/winapp-CLI/WinApp.Cli/Commands/RunCommand.cs | Adds a long-path validation check during run. |
| src/winapp-CLI/WinApp.Cli/Services/PackageRegistrationService.cs | Uses long-path validation + 8.3 short paths to keep WinRT PackageManager calls under MAX_PATH. |
| src/winapp-CLI/WinApp.Cli/Services/PriService.cs | Uses extended-length prefixes when calling makepri with long paths. |
| src/winapp-CLI/WinApp.Cli/Services/MsixService.cs | Uses extended-length prefixes when calling makeappx with long paths. |
| src/winapp-CLI/WinApp.Cli/NativeMethods.txt | Adds GetShortPathName for CsWin32 generation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ce path below MAX_PATH Agent-Logs-Url: https://github.com/microsoft/winappCli/sessions/d1c41aa0-8d5c-4e9b-8811-edc1094ee7d5 Co-authored-by: zateutsch <88554871+zateutsch@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread Please do not change the PR title, and append the changes you made at the bottom of the existing PR body, |
…early RunCommand validation, PriService consistency, add LongPathHelperTests Agent-Logs-Url: https://github.com/microsoft/winappCli/sessions/12885fc6-c8d1-4914-bd40-0f8fe068d21d Co-authored-by: zateutsch <88554871+zateutsch@users.noreply.github.com>
Applied all changes in commit
|
nmetulev
left a comment
There was a problem hiding this comment.
just a minor comment on linking to docs for enabling long path
winapp runfails on paths exceeding ~260 chars due to Windows MAX_PATH limits. This addslongPathAwaremanifest support, aLongPathHelperutility, and targeted workarounds for the two main failure points: Win32 build tools (MakePri/MakeAppx) and the WinRTPackageManagerAPI.LongPathHelper
EnsureExtendedLengthPrefix— adds\\?\(or\\?\UNC\for UNC paths) to bypass MAX_PATH in Win32 file I/OGetShortPath— converts long paths to 8.3 form viaGetShortPathName; preserves trailing directory separators (critical for sparse registration URIs); consistent<= MaxPathboundaries throughoutGetShortPathOrThrow— throws an actionableInvalidOperationExceptionwhen shortening fails (8.3 disabled, path doesn't exist on disk)ValidatePathLength— fast-fails with a clear remediation message when long paths are unsupported at the system levelGetShortPathRaw— correctly restores\\?\UNC\server\share\...→\\server\share\...(not the invalidUNC\server\share\...); handlesDllNotFoundExceptiongracefully on non-WindowsRunCommand
inputFolder.FullNameearly (before the status spinner) so long-path errors surface before any file system workPackageRegistrationService
PackageManagercall sites (RegisterLooseLayoutAsync,RegisterSparseAsync,InstallPackageAsync) useGetShortPathOrThrowinstead of the silentGetShortPathfallbackPriService
dumpPathconsistently forFile.Exists,ReadAllTextAsync, andFile.Delete— not the unprefixeddumpOutputFileTests
Added
LongPathHelperTestswith 16 unit tests covering boundary cases (== MaxPath,> MaxPath), UNC prefix handling, trailing separator preservation, andGetShortPathOrThrowthrow behavior.