Skip to content
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

Enable razor in unified-build #18776

Merged
merged 11 commits into from
Feb 27, 2024
Merged

Enable razor in unified-build #18776

merged 11 commits into from
Feb 27, 2024

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer requested a review from a team as a code owner February 26, 2024 13:31
@ViktorHofer
Copy link
Member Author

ViktorHofer commented Feb 26, 2024

D:\a_work\1\vmr\repo-projects\Directory.Build.targets(513,5): error MSB3231: Unable to remove directory "D:\a_work\1\vmr\src\razor\artifacts\sb". Access to the path 'Microsoft.CodeAnalysis.CSharp.dll' is denied. [D:\a_work\1\vmr\repo-projects\razor.proj]

@jkoritzinsky IIRC you mentioned the same issue but for a different repo a few weeks ago. We already kill the language server. I wonder which process still holds the file lock.

In this case it's not an intermediate from the repo's obj dir but a file read from the package cache: D:\a\_work\1\vmr\src\razor\artifacts\sb\package-cache\microsoft.codeanalysis.csharp\4.10.0-2.24112.8\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll

@jkoritzinsky
Copy link
Member

The Razor language server (which is a different process) is likely what’s keeping it locked. We should shut down that process as well.

@ViktorHofer
Copy link
Member Author

Hmm that didn't work:

VB/C# compiler server shut down successfully.
No build servers are running.
D:\a_work\1\vmr\repo-projects\Directory.Build.targets(512,5): error MSB3231: Unable to remove directory "D:\a_work\1\vmr\src\razor\artifacts\sb". Access to the path 'Microsoft.CodeAnalysis.CSharp.dll' is denied. [D:\a_work\1\vmr\repo-projects\razor.proj]

@ViktorHofer
Copy link
Member Author

I might try handle.exe next.

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Feb 27, 2024

Nthandle v5.0 - Handle viewer
Copyright (C) 1997-2022 Mark Russinovich
Sysinternals - www.sysinternals.com
dotnet.exe pid: 5464 type: File 48: D:\a_work\1\vmr\src\razor\artifacts\sb\package-cache\microsoft.net.compilers.toolset\4.10.0-2.24112.8\tasks\netcore\bincore
dotnet.exe pid: 5464 type: File 2B8: D:\a_work\1\vmr\src\razor\artifacts\sb\package-cache\microsoft.net.compilers.toolset\4.10.0-2.24112.8\tasks\netcore\bincore\VBCSCompiler.dll
dotnet.exe pid: 5464 type: File 2F4: D:\a_work\1\vmr\src\razor\artifacts\sb\package-cache\microsoft.net.compilers.toolset\4.10.0-2.24112.8\tasks\netcore\bincore\Microsoft.CodeAnalysis.dll
dotnet.exe pid: 5464 type: File 404: D:\a_work\1\vmr\src\razor\artifacts\sb\package-cache\microsoft.net.compilers.toolset\4.10.0-2.24112.8\tasks\netcore\bincore\Microsoft.CodeAnalysis.CSharp.dll
dotnet.exe pid: 5464 type: File 408: D:\a_work\1\vmr\src\razor\artifacts\sb\package-cache\microsoft.net.compilers.toolset\4.10.0-2.24112.8\tasks\netcore\bincore\Microsoft.CodeAnalysis.VisualBasic.dll
D:\a_work\1\vmr\repo-projects\Directory.Build.targets(514,5): error MSB3231: Unable to remove directory "D:\a_work\1\vmr\src\razor\artifacts\sb". Access to the path 'Microsoft.CodeAnalysis.CSharp.dll' is denied. [D:\a_work\1\vmr\repo-projects\razor.proj]

Interesting, it's the compiler from the toolset compiler package. Now I need to investigate which dotnet.exe this is. EDIT: This must be the toolset dotnet.exe from VMR/.dotnet/dotnet.exe. There's no other way.

Maybe build-server shutdown doesn't work when using the compiler toolset package. cc @mmitche

@ViktorHofer
Copy link
Member Author

ViktorHofer commented Feb 27, 2024

dotnet build-server shutdown will only shutdown the compiler server from its own install, thus won't shutdown a compiler server that started from the NuGet cache. If I recall correctly, the server's default pipe name is derived from a hash of the path to the compiler server dll.

from dotnet/sdk#10358 (comment)

I will probably just disable shared compilation in razor as a workaround or the toolset compiler.

@ViktorHofer ViktorHofer merged commit 25ffb67 into main Feb 27, 2024
22 checks passed
@ViktorHofer ViktorHofer deleted the ViktorHofer-patch-5 branch February 27, 2024 15:06
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.

Remove 'razor' repo exclusion in non-source build scenario
4 participants