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

Attempt to solve CI errors - could not copy / unable to copy with <BuildInParallel>false</BuildInParallel> #18570

Merged

Conversation

moljac
Copy link
Contributor

@moljac moljac commented Nov 7, 2023

Description of Change

Added

<BuildInParallel>false</BuildInParallel>

to ./src/Graphics/src/Text.Markdig/Graphics.Text.Markdig.csproj in order to fix CI errors like:

2023-11-07T10:07:22.1279525Z   Core.DeviceTests.Shared -> D:\a\_work\1\s\src\Core\tests\DeviceTests.Shared\bin\Release\net8.0-windows10.0.19041\Microsoft.Maui.DeviceTests.Shared.dll
2023-11-07T10:07:22.9070391Z D:\a\_work\1\s\bin\dotnet\sdk\8.0.100-rc.2.23502.2\Microsoft.Common.CurrentVersion.targets(4725,5): error MSB3027: Could not copy "obj\Release\netstandard2.0\Microsoft.Maui.Graphics.Text.Markdig.dll" to "bin\Release\netstandard2.0\Microsoft.Maui.Graphics.Text.Markdig.dll". Exceeded retry count of 10. Failed.  [D:\a\_work\1\s\src\Graphics\src\Text.Markdig\Graphics.Text.Markdig.csproj]

... snip ...

2023-11-07T10:31:38.9228286Z D:\a\_work\1\s\bin\dotnet\sdk\8.0.100-rc.2.23502.2\Microsoft.Common.CurrentVersion.targets(4725,5): error MSB3027: Could not copy "obj\Release\netstandard2.0\Microsoft.Maui.Graphics.Text.Markdig.dll" to "bin\Release\netstandard2.0\Microsoft.Maui.Graphics.Text.Markdig.dll". Exceeded retry count of 10. Failed.  [D:\a\_work\1\s\src\Graphics\src\Text.Markdig\Graphics.Text.Markdig.csproj]
2023-11-07T10:31:38.9234909Z D:\a\_work\1\s\bin\dotnet\sdk\8.0.100-rc.2.23502.2\Microsoft.Common.CurrentVersion.targets(4725,5): error MSB3021: Unable to copy file "obj\Release\netstandard2.0\Microsoft.Maui.Graphics.Text.Markdig.dll" to "bin\Release\netstandard2.0\Microsoft.Maui.Graphics.Text.Markdig.dll". The requested operation cannot be performed on a file with a user-mapped section open. : 'D:\a\_work\1\s\src\Graphics\src\Text.Markdig\bin\Release\netstandard2.0\Microsoft.Maui.Graphics.Text.Markdig.dll' 

See:
#18561 (comment)

This is an issue that we see happening a lot on CI. Retry the build normally fixes it .. But if you find out what causes it , that would be awesome.

See... I pretend to play cavalry and save the lady in trouble...

Notes to future me (even older than today):

Microsoft.Common.CurrentVersion.targets
error MSB3027: Could not copy "obj\Release\
error MSB3021: Unable to copy file "obj\Releas
Exceeded retry count of 10. Failed.
The requested operation cannot be performed on a file with a user-mapped section open.

Similar approach:

https://github.com/xamarin/xamarin-android/blob/8928f1168a74f9edad705f4851f3e9252a64f90e/src/r8/r8.csproj#L11-L15

  <ItemGroup>
    <!-- There isn't an actual dependency here, but we can only build one 'gradlew' project
         at a time, and adding <ProjectReference> between them ensures they run sequentially. -->
    <ProjectReference Include="..\manifestmerger\manifestmerger.csproj" ReferenceOutputAssembly="False" />
  </ItemGroup>

Issues Fixed

Unreported CI transient errors, occurring frequently on AzDO with voodoo solves-all workaround called "restart build".

@moljac moljac requested a review from a team as a code owner November 7, 2023 13:52
@moljac moljac requested review from rmarinho and rachelkang November 7, 2023 13:52
@moljac moljac changed the title add <BuildInParallel>false</BuildInParallel> to solve CI errors Attempt to solve CI errors - could not copy / unable to copy with <BuildInParallel>false</BuildInParallel> Nov 7, 2023
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

Fingers crossed!

@rmarinho
Copy link
Member

rmarinho commented Nov 7, 2023

/backport net8.0

@rmarinho
Copy link
Member

rmarinho commented Nov 7, 2023

/backport to net8.0

Copy link
Contributor

github-actions bot commented Nov 7, 2023

Started backporting to net8.0: https://github.com/dotnet/maui/actions/runs/6789116889

@rmarinho rmarinho merged commit f84f433 into main Nov 7, 2023
47 checks passed
@rmarinho rmarinho deleted the dev/moljac/20231107-fix-ci-builds-markdig-cannot-copy branch November 7, 2023 19:05
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
@samhouts samhouts added the fixed-in-8.0.6 Look for this fix in 8.0.6 SR1! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-8.0.6 Look for this fix in 8.0.6 SR1!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants