Skip to content

Test for line endings and long paths - #85127

Merged
mwiemer-microsoft merged 7 commits into
mainfrom
copilot/verify-developer-settings-test-class
Sep 8, 2026
Merged

Test for line endings and long paths#85127
mwiemer-microsoft merged 7 commits into
mainfrom
copilot/verify-developer-settings-test-class

Conversation

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Checks for two critical settings on first dotnet restore:

  • correct line endings (CRLF vs LF)
  • long paths enabled on Windows

Validated on local Windows machine:

  • fails on first restore when file has wrong line endings
  • fails on first restore when machine does not have long paths enabled
  • passes if validation cache file is present, even if enlistment has wrong line endings or machine does not have long paths enabled

Copilot AI and others added 2 commits September 1, 2026 18:46
Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>
Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@mwiemer-microsoft
mwiemer-microsoft marked this pull request as ready for review September 1, 2026 20:36
@mwiemer-microsoft
mwiemer-microsoft requested a review from a team as a code owner September 1, 2026 20:36
Copilot AI lite review requested due to automatic review settings September 1, 2026 20:36
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@mwiemer-microsoft

Copy link
Copy Markdown
Member

@RikkiGibson requesting review :)

@mwiemer-microsoft mwiemer-microsoft changed the title Add developer settings coverage for long paths and line endings Test for line endings and long paths Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds a new unit test class under compiler test infrastructure intended to validate developer/environment prerequisites: Windows long-path support and platform-appropriate line endings.

Changes:

  • Add a Windows-only test that reads HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled and asserts it is enabled.
  • Add a cross-platform test that reads a source file and asserts its line endings match the current platform (CRLF on Windows, LF elsewhere).
File summaries
File Description
src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Introduces new environment validation tests for long paths (Windows) and line endings (platform-dependent).
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Outdated
Comment thread src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Outdated
Comment thread src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Outdated

@RikkiGibson RikkiGibson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done review pass

Comment thread src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Outdated
Comment thread src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Outdated
@mwiemer-microsoft

Copy link
Copy Markdown
Member

@copilot fix the reported issues in comments one-by-one and have a model from a second family review each change before committing it. Do not worry about the failing CI / PR checks at this point.

Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 19:51
Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/33d2d0a5-12ce-4863-9c99-dedc7192bee6

Co-authored-by: mwiemer-microsoft <80539004+mwiemer-microsoft@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are limited to a new test file and are straightforward, with only minor suggestions to improve failure diagnostics.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Outdated
Comment thread src/Compilers/Core/CodeAnalysisTest/DeveloperSettingsTests.cs Outdated
@mwiemer-microsoft

Copy link
Copy Markdown
Member

@RikkiGibson requesting re-review :)

@JoeRobich JoeRobich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests look fine but consider whether this should be validation which runs once per enlistment when executing ./restore.{sh|ps1}

Copilot AI review requested due to automatic review settings September 8, 2026 20:49
@mwiemer-microsoft
mwiemer-microsoft requested a review from a team as a code owner September 8, 2026 20:49
@mwiemer-microsoft

Copy link
Copy Markdown
Member

I like this a lot better, thanks for the feedback :)

@mwiemer-microsoft
mwiemer-microsoft marked this pull request as draft September 8, 2026 20:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The validation cache marker is not platform-specific, which can incorrectly skip validation in mixed-OS workflows (e.g., Windows + WSL) and needs adjustment.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread eng/targets/Imports.targets Outdated
Comment thread Directory.Solution.targets
@mwiemer-microsoft
mwiemer-microsoft marked this pull request as ready for review September 8, 2026 21:17
Copilot AI review requested due to automatic review settings September 8, 2026 21:17
Comment thread eng/targets/Imports.targets Outdated
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes restore-time build infrastructure in a way that can block restores across environments (especially CI/dev-machine variability), so it warrants final human validation.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The restore-time cache file write can race across projects during restore, risking intermittent failures unless guarded against concurrent creation.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

eng/targets/DeveloperSettings.targets:30

  • _ValidateDeveloperSettings can execute in multiple projects during a restore, and the target condition can be true concurrently before the cache file is created. That can lead to concurrent writes to the same cache file under artifacts. Adding an Exists guard on the file-creating tasks avoids file contention if another project/thread creates the cache between target start and these tasks.
    eng/targets/DeveloperSettings.targets:7
  • The header comment claims "for all platforms, file line endings match platform line endings", but the implementation only probes this single file (and the repo also has per-file EOL rules via .gitattributes, e.g. *.sh is forced LF). Updating the comment to describe the actual sentinel-style check avoids misleading future maintainers.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

5 participants