-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Race condition writing Microsoft.Interop.DllImportGenerator.dll during library product build (Windows x64 Release) #61687
Comments
Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer Issue DetailsObserved on platform: Windows x64 Release (the failure is apparently non-deterministic so it may also repro on other platforms) Diagnostic output: System.Private.CoreLib.Generators -> D:\a\_work\1\s\artifacts\bin\System.Private.CoreLib.Generators\netstandard2.0-Release\System.Private.CoreLib.Generators.dll Microsoft.Interop.SourceGeneration -> D:\a\_work\1\s\artifacts\bin\Microsoft.Interop.SourceGeneration\netstandard2.0-Release\Microsoft.Interop.SourceGeneration.dll CSC : error CS2012: Cannot open 'D:\a\_work\1\s\artifacts\obj\DllImportGenerator\netstandard2.0-Release\Microsoft.Interop.DllImportGenerator.dll' for writing -- 'The process cannot access the file 'D:\a\_work\1\s\artifacts\obj\DllImportGenerator\netstandard2.0-Release\Microsoft.Interop.DllImportGenerator.dll' because it is being used by another process.' [D:\a\_work\1\s\src\libraries\System.Runtime.InteropServices\gen\DllImportGenerator\DllImportGenerator.csproj] ##[error]CSC(0,0): error CS2012: (NETCORE_ENGINEERING_TELEMETRY=Build) Cannot open 'D:\a\_work\1\s\artifacts\obj\DllImportGenerator\netstandard2.0-Release\Microsoft.Interop.DllImportGenerator.dll' for writing -- 'The process cannot access the file 'D:\a\_work\1\s\artifacts\obj\DllImportGenerator\netstandard2.0-Release\Microsoft.Interop.DllImportGenerator.dll' because it is being used by another process.' DllImportGenerator -> D:\a\_work\1\s\artifacts\bin\DllImportGenerator\netstandard2.0-Release\Microsoft.Interop.DllImportGenerator.dll Based on my past experience I would expect this to be caused by interlocking holes that cause two projects to try building the DllImportGenerator project in parallel but I'm not a library build expert. @jkoritzinsky, based on your experience with Roslyn generators, could you please suggest how to continue the investigation? Thanks Tomas
|
I'll take this one |
I just saw this on all configurations build as well: https://dev.azure.com/dnceng/public/_build/results?buildId=1472394&view=logs&j=81a0f8c2-d4db-561f-9b8e-3f045280d7fe&t=2a104984-c43b-5b93-1361-6bd8a1e96b04&l=1181 |
Still failing: https://dev.azure.com/dnceng/public/_build/results?buildId=1481003&view=logs&jobId=79ebbb2e-07f2-5457-c5e5-132dd7ee4ba8
|
😢 If my fix didn't work, then I'm out of ideas. We'll get a permanent fix once we update to the RTM sdk. |
For the sake of completeness I have just hit a somewhat different bug and at the first glance it's not clear to me whether it's just a different manifestation of the same problem or something slightly different: System.Private.CoreLib.Generators -> /__w/1/s/artifacts/bin/System.Private.CoreLib.Generators/netstandard2.0-Release/System.Private.CoreLib.Generators.dll /__w/1/s/.dotnet/sdk/6.0.100-rc.2.21505.57/Microsoft.Common.CurrentVersion.targets(4635,5): error MSB3026: Could not copy "/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll" to "/__w/1/s/artifacts/bin/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll". Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll' because it is being used by another process. [/__w/1/s/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Microsoft.Interop.SourceGeneration.csproj] ##[error].dotnet/sdk/6.0.100-rc.2.21505.57/Microsoft.Common.CurrentVersion.targets(4635,5): error MSB3026: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not copy "/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll" to "/__w/1/s/artifacts/bin/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll". Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll' because it is being used by another process. /__w/1/s/.dotnet/sdk/6.0.100-rc.2.21505.57/Microsoft.Common.CurrentVersion.targets(4635,5): error MSB3026: Could not copy "/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll" to "/__w/1/s/artifacts/bin/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll". Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll' because it is being used by another process. [/__w/1/s/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Microsoft.Interop.SourceGeneration.csproj] ##[error].dotnet/sdk/6.0.100-rc.2.21505.57/Microsoft.Common.CurrentVersion.targets(4635,5): error MSB3026: (NETCORE_ENGINEERING_TELEMETRY=Build) Could not copy "/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll" to "/__w/1/s/artifacts/bin/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll". Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/artifacts/obj/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll' because it is being used by another process. Microsoft.Interop.SourceGeneration -> /__w/1/s/artifacts/bin/Microsoft.Interop.SourceGeneration/netstandard2.0-Release/Microsoft.Interop.SourceGeneration.dll Reopening the bug for tracking purposes, my current understanding is that we'll close it once we update the SDK to RTM. Thanks Tomas |
Hit this myself
https://dev.azure.com/dnceng/public/_build/results?buildId=1487466&view=results |
I hit this as well:
https://github.com/dotnet/runtime/pull/61928/checks?check_run_id=4372017369 |
Example run: https://dev.azure.com/dnceng/public/_build/results?buildId=1472395&view=logs&j=3ee9f22f-fdeb-5ba9-4d07-86b7b8a7437b&t=796c5bee-4d73-5a57-e6ab-2038dda597c4
Observed on platform: Windows x64 Release (the failure is apparently non-deterministic so it may also repro on other platforms)
Diagnostic output:
Based on my past experience I would expect this to be caused by interlocking holes that cause two projects to try building the DllImportGenerator project in parallel but I'm not a library build expert. @jkoritzinsky, based on your experience with Roslyn generators, could you please suggest how to continue the investigation?
Thanks
Tomas
The text was updated successfully, but these errors were encountered: