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

build: Few build adjustments to reduce flakiness #700

Merged
merged 3 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/workflow/stage-build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:

- task: MSBuild@1
displayName: 'Build solution'
retryCountOnTaskFailure: 3
inputs:
solution: src/Uno.Toolkit.sln
configuration: Release
Expand Down
2 changes: 1 addition & 1 deletion samples/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageVersion Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.5.0-2.final" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.7.0-2.final" />
<!--
If, in the same solution, you are referencing a project that uses https://github.com/onovotny/MSBuildSdkExtras,
you need to make sure that the version provided here matches https://github.com/novotnyllc/MSBuildSdkExtras/blob/main/Source/MSBuild.Sdk.Extras/DefaultItems/ImplicitPackages.targets#L11.
Expand Down
2 changes: 2 additions & 0 deletions samples/Uno.Toolkit.Samples/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />

<ItemGroup>
<!-- Remove WinUI files (Ctrl+F: UWP_WinUI_Removal) -->
<Page Remove="$(MSBuildThisFileDirectory)**\*.WinUI.xaml" Condition="'$(FrameworkLineage)' == 'UWP'" />
Expand Down
16 changes: 16 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
<Project ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
<Import Project="Directory.UnoMetadata.targets" />

<!-- This is a workaround, should be removed when this issue is fixed: https://github.com/unoplatform/uno/issues/13167 -->
<!-- Without this, the build gets flaky and sometimes fails with this error -->
<!-- C:\hostedtoolcache\windows\dotnet\sdk\7.0.306\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5019: File not found: 'D:\a\1\s\src\library\Uno.Toolkit.Cupertino\bin\Uno.Toolkit.WinUI.Cupertino\Release\net7.0-ios\Uno.Toolkit.WinUI.Cupertino.uprimarker'. [D:\a\1\s\src\library\Uno.Toolkit.Cupertino\Uno.Toolkit.WinUI.Cupertino.csproj] -->
<!-- Without this workaround target, what happens is that _UnoGeneratePriMarker was run before both _UnoAssetsGetCopyToPublishDirectory and finds ContentWithTargetPath being empty, so it does nothing -->
<!-- Then later, _UnoAssetsGetCopyToPublishDirectory is run and ContentWithTargetPath is now added, and NuGet packaging now expects the uprimarker to be present -->
<!-- Note that this error can go away with restarts, so it's a race condition -->
<Target Name="_WorkaroundBuildFlakiness"
BeforeTargets="_UnoGeneratePriMarker">
<ItemGroup>
<ContentWithTargetPath Include="@(_TransitiveItemsToCopyToOutputDirectory)">
<TargetPath>%(TargetPath)</TargetPath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ContentWithTargetPath>
</ItemGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<PackageVersion Include="Uno.UITest.Xamarin" Version="1.1.0-dev.32" />
<PackageVersion Include="Xamarin.UITest" Version="4.1.0" />
<PackageVersion Include="MSTest.TestFramework" Version="2.1.2" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.5.0-2.final" />
<PackageVersion Include="Microsoft.Net.Compilers.Toolset" Version="4.7.0-2.final" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0-preview1.22518.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ItemGroup Condition="$(_IsWindowsWinUI)">
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />

<Page Remove="Generated\*.xaml" />
</ItemGroup>

Expand Down
Loading