Skip to content

fix: enable Windows long path support in GitHub Actions#4648

Merged
thomhurst merged 1 commit intomainfrom
fix/enable-windows-long-paths
Feb 3, 2026
Merged

fix: enable Windows long path support in GitHub Actions#4648
thomhurst merged 1 commit intomainfrom
fix/enable-windows-long-paths

Conversation

@thomhurst
Copy link
Owner

Summary

Fixes PathTooLongException errors on Windows CI by enabling long path support (>260 characters) via registry setting.

Problem

Windows CI was failing with:

System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

This occurred during source generation for test methods with complex generic signatures like GenericMethodTests.AggregateBy_HasExpectedOutput<TSource, TKey, TAccumulate>(...).

Solution

Enable Windows long path support in GitHub Actions by setting the LongPathsEnabled registry key before building. This is a cleaner solution than modifying source generator code to hash long filenames.

Test Plan

  • Windows CI should pass without PathTooLongException
  • Source generator tests with long method names should work

Fixes: https://github.com/thomhurst/TUnit/actions/runs/21610514651

Resolves PathTooLongException errors on Windows CI by enabling long path
support (>260 characters) via registry setting. This allows the source
generator to create files with long names for complex generic method
signatures without hitting Windows MAX_PATH limitation.

Fixes: https://github.com/thomhurst/TUnit/actions/runs/21610514651
@claude
Copy link
Contributor

claude bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

This is a clean solution to the Windows long path issue. Enabling long path support at the system level is the right approach rather than working around it in the source generator.

@thomhurst thomhurst merged commit 1f92477 into main Feb 3, 2026
12 of 13 checks passed
@thomhurst thomhurst deleted the fix/enable-windows-long-paths branch February 3, 2026 01:04
@Frulfump
Copy link

Frulfump commented Feb 3, 2026

Will this force users to also use long paths to avoid potential issues? Could your CI now hide issues that users would run into otherwise?

This was referenced Feb 5, 2026
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.

2 participants