You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If NUGET_PACKAGES does not include a trailing slash, the NugetPackageRoot will have one (appended by arcade) and they do not match:
This causes source file paths to be passed to the compiler with a double trailing slash \\ whereas the .editorconfig gets passed with a single trailing slash \
csc editorconfig arg:
Both files are successfully read by the compiler, however it doesn't figure out that the nuget pkg source file belongs to the nuget package .editorconfig.
dibarbet
changed the title
Editorconfig in nuget package is not respected when NUGET_PACKAGES does not end with trailing slash
Editorconfig in nuget package is not respected when NUGET_PACKAGES does not match NugetPackageRoot
Mar 22, 2024
dibarbet
changed the title
Editorconfig in nuget package is not respected when NUGET_PACKAGES does not match NugetPackageRoot
Editorconfig in nuget package is not respected if slashes in source file path do not exactly match slashes in .editorconfig path
Mar 22, 2024
It seems like the only thing we could do in the compiler is attempt to normalize the path here. Essentially say that if we see \\ in a path then we normalize that to simply \. That is probably safe to do (can't think of any file system that allows \\ in a file path).
This was originally found when doing this PR - dotnet/razor#10139
Arcade sets the NugetPackageRoot based on the NUGET_PACKAGES folder. Arcade will normalize the NugetPackageRoot (add a trailing slash).
If NUGET_PACKAGES does not include a trailing slash, the NugetPackageRoot will have one (appended by arcade) and they do not match:
This causes source file paths to be passed to the compiler with a double trailing slash
\\
whereas the .editorconfig gets passed with a single trailing slash\
csc editorconfig arg:
csc source file arg
Both files are successfully read by the compiler, however it doesn't figure out that the nuget pkg source file belongs to the nuget package .editorconfig.
To repro, checkout and run the repro.ps1 script here - https://github.com/dibarbet/EditorConfigNugetRepro/tree/main
Binlog from the failing version in mismatch.zip
mismatch.zip
Related NuGet issue which is likely the source of the mismatches - NuGet/Home#7968
The text was updated successfully, but these errors were encountered: