Skip to content

fix: reduce hint name limit to 150 chars for Windows net472 PATH_MAX#4760

Open
thomhurst wants to merge 1 commit intomainfrom
fix/windows-path-too-long-net472
Open

fix: reduce hint name limit to 150 chars for Windows net472 PATH_MAX#4760
thomhurst wants to merge 1 commit intomainfrom
fix/windows-path-too-long-net472

Conversation

@thomhurst
Copy link
Owner

Summary

  • Reduces MaxHintNameLength from 200 to 150 in FileNameHelper.cs to fix PathTooLongException on Windows CI with net472
  • The previous fix (fix: truncate long source generator hint names for Windows #4757) was insufficient because .NET Framework 4.7.2's Path.GetFullPathInternal prepends the CWD (~69 chars on CI) to the hint name before validating against the hardcoded 260-char MAX_PATH limit (200 + 69 = 269 > 260)
  • 150 chars leaves ~110 chars of headroom for the working directory, covering CI runners and typical developer environments
  • net8.0/net10.0 are unaffected since modern .NET doesn't enforce the legacy path limit

Test plan

  • Verify modularpipeline (windows-latest) CI job passes (specifically net472 source generator tests)
  • Verify Linux and macOS jobs remain green

🤖 Generated with Claude Code

… net472

The previous limit of 200 chars (from #4757) still caused PathTooLongException
on Windows CI because .NET Framework 4.7.2's Path.GetFullPathInternal prepends
the CWD (~69 chars) to the hint name, exceeding the hardcoded 260-char MAX_PATH
limit. Reducing to 150 leaves ~110 chars of headroom for the working directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant