Add early long path validation to Windows build script#126840
Add early long path validation to Windows build script#126840pavelsavara wants to merge 3 commits intodotnet:mainfrom
Conversation
On Windows machines without long path support enabled, the build fails in hard-to-diagnose ways deep in the build process. This adds a check at the start of eng/build.ps1 that: - Tries to create a temp file with a path exceeding 260 characters - If it fails, exits early with a clear error message pointing to docs/workflow/requirements/windows-requirements.md#enable-long-paths - If it succeeds, writes a stamp file (artifacts/.long-path-validated) so subsequent builds skip the check Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
There was a problem hiding this comment.
Pull request overview
This PR adds an early preflight check in eng/build.ps1 to detect whether the machine can create files with paths longer than 260 characters, failing fast with guidance to enable long path support instead of failing later in the build.
Changes:
- Add
Check-LongPathSupportto attempt creation of a >260-char temp file underartifacts/tmp/. - On failure, exit early with instructions linking to the Windows requirements doc.
- On success, create a stamp file in
artifacts/to skip repeated checks.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Could we just check the |
On Windows machines without long path support enabled, the build fails in hard-to-diagnose ways deep in the build process.
This adds a check at the start of
eng/build.ps1that:artifacts/tmp/docs/workflow/requirements/windows-requirements.md#enable-long-pathsand quick-fix instructionsartifacts/.long-path-validated) so subsequent builds skip the checkThe check runs after
-helpand-subset helpexit points so those still work without any filesystem access.