Skip to content

Commit

Permalink
[release/8.0.1xx-preview3] Fixed remote and local build issues (#17969)
Browse files Browse the repository at this point in the history
- Updated Xamarin.Messaging to 1.9.99 to fix a connection problem in
remote builds because of an invalid reference to
System.Security.Cryptography.ProtectedData
- Generate Hot Restart specific build session id to fix an issue in
local builds that was conflicting with remote builds


Backport of #17964

---------

Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
Co-authored-by: Emanuel Fernandez <emafern@microsoft.com>
  • Loading branch information
3 people authored Apr 4, 2023
1 parent 34beaaf commit 76e0cc0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion msbuild/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MessagingVersion>1.9.94</MessagingVersion>
<MessagingVersion>1.9.99</MessagingVersion>
<HotRestartVersion>1.0.93</HotRestartVersion>
</PropertyGroup>
</Project>
19 changes: 15 additions & 4 deletions msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets') And '$(MessagingBuildTargetsImported)' != 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets') And '$(MessagingAppleTargetsImported)' != 'true'" />

<Target Name="_GenerateHotRestartBuildSessionId">
<GenerateBuildSessionId MessagingVersion="$(MessagingVersion)"
TargetFramework="$(TargetFramework)"
ProjectFullPath="$(MSBuildProjectFullPath)"
ProjectName="$(MSBuildProjectName)"
VisualStudioProcessId="$(VisualStudioProcessId)">
<Output TaskParameter="BuildSessionId" PropertyName="HotRestartBuildSessionId" />
<Output TaskParameter="BuildAppName" PropertyName="BuildAppName" />
</GenerateBuildSessionId>
</Target>

<Target Name="AddHotRestartDefineConstants" BeforeTargets="AddImplicitDefineConstants">
<PropertyGroup>
<_IsHotRestartDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)HOTRESTART($|;)'))</_IsHotRestartDefined>
Expand Down Expand Up @@ -145,13 +156,13 @@
<Target Name="_CreateHotRestartCachedBundle" DependsOnTargets="$(_CreateHotRestartCachedBundleDependsOn)" />

<!-- Creates HotRestart app bundle and collects files to copy -->
<Target Name="_PrepareHotRestartAppBundle" DependsOnTargets="_GenerateBuildSessionId"
<Target Name="_PrepareHotRestartAppBundle" DependsOnTargets="_GenerateHotRestartBuildSessionId"
Condition="'$(_CanOutputAppBundle)' == 'true' And '$(IsAppExtension)' == 'false' And '$(IsHotRestartBuild)' == 'true'">

<!--Create app bundle dir and get its path-->
<PrepareAppBundle
AppBundleName="$(_AppBundleName)"
SessionId="$(BuildSessionId)"
SessionId="$(HotRestartBuildSessionId)"
ShouldExtract="true">

<Output TaskParameter="AppBundlePath" PropertyName="HotRestartAppBundlePath" />
Expand Down Expand Up @@ -333,12 +344,12 @@
</CleanDependsOn>
</PropertyGroup>

<Target Name="_CleanHotRestartBundle" DependsOnTargets="_GenerateBuildSessionId" >
<Target Name="_CleanHotRestartBundle" DependsOnTargets="_GenerateHotRestartBuildSessionId" >
<!-- Gets the bundle path -->
<PrepareAppBundle
Condition="'$(IsHotRestartBuild)' == 'true'"
AppBundleName="$(_AppBundleName)"
SessionId="$(BuildSessionId)"
SessionId="$(HotRestartBuildSessionId)"
ShouldExtract="false">

<Output TaskParameter="AppBundlePath" PropertyName="HotRestartAppBundlePath" />
Expand Down

6 comments on commit 76e0cc0

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • iOS (no change detected)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS (no change detected)
NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

✅ Generator diff

Generator diff is empty

Pipeline on Agent
Hash: 76e0cc09999943fb4facc00bd9e4fe22e4ff3596 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent
Hash: 76e0cc09999943fb4facc00bd9e4fe22e4ff3596 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: 76e0cc09999943fb4facc00bd9e4fe22e4ff3596 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 1 tests failed, 218 tests passed.

Failures

❌ linker tests

1 tests failed, 64 tests passed.
  • link all/Mac Catalyst [dotnet]/Release [dotnet]: BuildFailure (Harness exception for 'link all': System.Exception: Failed to list the files in the directory /Users/builder/azdo/_work/3/s/xamarin-macios/tests/bindings-test/dotnet/MacCatalyst (TimedOut: True ExitCode: 0):
    Running git ls-files
    Makefile
    bindings-test.csproj
    Process 83414 didn't exit within 00:01:00 and will be killed
    Killing process tree of 83414...
    Pids to kill: 83414
    Running lldb diagnostics for pid 83414
    Printing backtrace for pid=83414
    (lldb) command source -s 0 '/var/folders/xz/798cz96s2c51dxt6fw5d_7vw0000gn/T/tmp4e235147.tmp'
    Executing commands in '/var/folders/xz/798cz96s2c51dxt6fw5d_7vw0000gn/T/tmp4e235147.tmp'.
    (lldb) process attach --pid 83414
    error: attach failed: no such process.
    83414 Execution timed out after 60 seconds and the process was killed.
    Process git exited with 0
    at Xharness.TestProject.ListFilesAsync (Microsoft.DotNet.XHarness.Common.Logging.ILog log, System.String test_dir, Microsoft.DotNet.XHarness.Common.Execution.IProcessManager processManager) [0x00218] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/xharness/TestProject.cs:103
    at Xharness.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.Common.Logging.ILog log, Microsoft.DotNet.XHarness.Common.Execution.IProcessManager processManager, Xharness.Jenkins.TestTasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary2[TKey,TValue] allProjectReferences) [0x00340] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/xharness/TestProject.cs:167 at Xharness.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.Common.Logging.ILog log, Microsoft.DotNet.XHarness.Common.Execution.IProcessManager processManager, Xharness.Jenkins.TestTasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary2[TKey,TValue] allProjectReferences) [0x0078b] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/xharness/TestProject.cs:208
    at Xharness.Jenkins.TestTasks.TestTasks.RunInternalAsync () [0x00117] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/TestTask.cs:260 )

Html Report (VSDrops) Download

Successes

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 25 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 76e0cc09999943fb4facc00bd9e4fe22e4ff3596 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMMINI-048.Ventura
Hash: 76e0cc09999943fb4facc00bd9e4fe22e4ff3596 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 219 tests passed 🎉

Tests counts

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 25 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 76e0cc09999943fb4facc00bd9e4fe22e4ff3596 [CI build]

Please sign in to comment.