-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Test for line endings and long paths #85127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mwiemer-microsoft
merged 7 commits into
main
from
copilot/verify-developer-settings-test-class
Sep 8, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d8b4c1f
Add developer settings tests
Copilot 718c8a4
Check source file line endings
Copilot f610a6b
Use PlatformInformation.IsWindows guard and int value in long paths test
Copilot 664a991
Changes before error encountered
Copilot 98bf8bf
Replace xUnit tests with `dotnet restore` checks
mwiemer-microsoft f1ccac5
Support `dotnet restore` without project CLA
mwiemer-microsoft 9512844
Move import to top of file
mwiemer-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <Project> | ||
| <Import Project="eng\targets\DeveloperSettings.targets" /> | ||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> | ||
|
|
||
| <!-- | ||
| Validate developer machine settings are correct: | ||
| - For Windows, long paths are enabled | ||
| - For all platforms, file line endings match platform line endings | ||
| --> | ||
| <Project> | ||
| <PropertyGroup> | ||
| <_RoslynDeveloperSettingsValidationCacheFile>$(MSBuildThisFileDirectory)..\..\artifacts\developer-settings-validated.txt</_RoslynDeveloperSettingsValidationCacheFile> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="_ValidateDeveloperSettings" BeforeTargets="Restore" Condition="!Exists('$(_RoslynDeveloperSettingsValidationCacheFile)')"> | ||
| <PropertyGroup> | ||
| <_RoslynBuildRunsOnWindows>$([MSBuild]::IsOSPlatform('Windows'))</_RoslynBuildRunsOnWindows> | ||
| <_RoslynSourceHasCarriageReturns>$([System.IO.File]::ReadAllText('$(MSBuildThisFileFullPath)').Contains($([System.Char]::ConvertFromUtf32(13))))</_RoslynSourceHasCarriageReturns> | ||
| <_RoslynLongPathsEnabled Condition="'$(_RoslynBuildRunsOnWindows)' == 'True'">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem', 'LongPathsEnabled', null, RegistryView.Registry64, RegistryView.Registry32))</_RoslynLongPathsEnabled> | ||
| </PropertyGroup> | ||
|
|
||
| <Message Importance="Low" | ||
| Text="Validating developer settings: IsWindows=$(_RoslynBuildRunsOnWindows), SourceHasCarriageReturns=$(_RoslynSourceHasCarriageReturns), LongPathsEnabled=$(_RoslynLongPathsEnabled)" /> | ||
| <Error Condition="'$(_RoslynSourceHasCarriageReturns)' != '$(_RoslynBuildRunsOnWindows)'" | ||
| Text="Source file line endings do not match the current platform. Re-clone the repository with the correct Git line-ending settings." /> | ||
| <Error Condition="'$(_RoslynBuildRunsOnWindows)' == 'True' and '$(_RoslynLongPathsEnabled)' != '1'" | ||
| Text="Long paths are required for this project. Please run eng\enable-long-paths.reg" /> | ||
|
|
||
| <MakeDir Directories="$(MSBuildThisFileDirectory)..\..\artifacts" /> | ||
| <WriteLinesToFile File="$(_RoslynDeveloperSettingsValidationCacheFile)" | ||
| Lines="[$([System.DateTime]::UtcNow.ToString('O'))] Developer settings validated" | ||
| Overwrite="true" /> | ||
| </Target> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.