Skip to content

Commit

Permalink
[net9.0] Migrate Messaging Build agent to .NET 8 (#21264)
Browse files Browse the repository at this point in the history
This is part of the effort to migrate the Pair to Mac agents .NET.

As the Xamarin.iOS.Tasks.Windows project targets netstandard2.0, I'm
removing the Build agent reference, and modifying the Makefile to take
it from it's output directory. Note: the agent zip file is generated in
the intermediate output directory.

---------

Co-authored-by: Emanuel Fernandez Dell'Oca <ema@xamarin.com>
  • Loading branch information
rolfbjarne and emaf authored Sep 24, 2024
1 parent 22b5933 commit 0d7d336
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 81 deletions.
2 changes: 1 addition & 1 deletion msbuild/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
enclosed in brackets.
-->
<MessagingVersion>[1.14.6]</MessagingVersion>
<MessagingVersion>[2.1.15]</MessagingVersion>
<HotRestartVersion>[1.1.7]</HotRestartVersion>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
Expand Down
1 change: 1 addition & 0 deletions msbuild/ILMerge.targets
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.ComponentModel.Composition'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Diagnostics.Tracer'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Net.Mqtt'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Net.Mqtt.Server'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Reactive'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ DOTNET_IOS_WINDOWS_OUTPUT_FILES = \
iSign.Core.pdb \
Xamarin.iOS.Windows.Client.pdb \
Broker.zip \
Build.zip \

DOTNET_IOS_WINDOWS_FILES = $(IOS_WINDOWS_TARGETS) $(foreach file,$(DOTNET_IOS_WINDOWS_OUTPUT_FILES),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(WINDOWSRUNTIMEIDENTIFIER)/$(file))
DOTNET_IOS_WINDOWS_FILES += Messaging/Xamarin.Messaging.Build/obj/$(CONFIG)/Build.zip
DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X86 = $(foreach file,$(IOS_WINDOWS_MOBILEDEVICE_TOOLS),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(WINDOWSRUNTIMEIDENTIFIER)/imobiledevice-x86/$(file).*)
DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X64 = $(foreach file,$(IOS_WINDOWS_MOBILEDEVICE_TOOLS),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(WINDOWSRUNTIMEIDENTIFIER)/imobiledevice-x64/$(file).*)

Expand Down
3 changes: 0 additions & 3 deletions msbuild/Messaging/Xamarin.Messaging.Build/BuildAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ await TryRegisterHandlerAsync (new CopyItemMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new GetItemMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);

await TryRegisterHandlerAsync (new VerifyXcodeVersionMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
await TryRegisterHandlerAsync (new GetUniversalTargetIdentifierMessageHandler ())
.ConfigureAwait (continueOnCapturedContext: false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ await Task.Run (async () => {
message.SessionId,
PlatformPath.GetPathForCurrentPlatform (message.ItemSpec)));

if (File.Exists (targetPath))
if (File.Exists (targetPath)) {
File.Delete (targetPath);
else if (!Directory.Exists (Path.GetDirectoryName (targetPath)))
Directory.CreateDirectory (Path.GetDirectoryName (targetPath));
} else {
var directoryName = Path.GetDirectoryName (targetPath);
if (directoryName is not null && !Directory.Exists (directoryName))
Directory.CreateDirectory (directoryName);
}

using (var file = File.Create (targetPath))
using (var stream = new MemoryStream (message.Content))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>Build</AssemblyName>
<NoWarn>$(NoWarn);NU1603</NoWarn> <!-- Xamarin.Messaging.Build.Common 1.6.24 depends on Merq (>= 1.1.0) but Merq 1.1.0 was not found. An approximate best match of Merq 1.1.4 was resolved. -->
Expand All @@ -10,6 +10,8 @@
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RollForward>LatestMajor</RollForward>
</PropertyGroup>

<PropertyGroup Label="Messaging">
Expand Down
13 changes: 0 additions & 13 deletions msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -876,19 +876,6 @@
<value>Could not resolve UTI for {0} in catalog {1}</value>
</data>

<data name="E0183" xml:space="preserve">
<value>An error occurred while trying to verify the compatibility between Xcode and the .NET SDK</value>
</data>

<data name="E0184" xml:space="preserve">
<value>The project was built with a version of Xcode ({0}) that is not compatible which may result in unexpected warnings or errors. Please install Xcode '{1}' or visit the documentation to learn more.</value>
</data>

<data name="E0185" xml:space="preserve">
<value>An error occurred while trying to verify the compatibility between Xcode and the .NET SDK. Details: {0}
</value>
</data>

<data name="E0186" xml:space="preserve">
<value>The provided Archive Path is not from a valid archive file (.xcarchive). Archive Path: '{0}'</value>
</data>
Expand Down
46 changes: 0 additions & 46 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/VerifyXcodeVersion.cs

This file was deleted.

1 change: 0 additions & 1 deletion msbuild/Xamarin.Shared/Xamarin.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<UsingTask TaskName="Xamarin.MacDev.Tasks.UnpackLibraryResources" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.Unzip" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.ValidateAppBundleTask" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.VerifyXcodeVersion" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.WriteAppManifest" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.WriteAssetPackManifest" AssemblyFile="$(_TaskAssemblyName)" />
<UsingTask TaskName="Xamarin.MacDev.Tasks.WriteItemsToFile" AssemblyFile="$(_TaskAssemblyName)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
<IsRemoteBuild Condition="'$(IsHotRestartBuild)' == 'True'">False</IsRemoteBuild>
</PropertyGroup>
</Target>

<!-- AfterConnect belongs to Xamarin.Messaging.Build.targets -->
<Target Name="AfterConnect" Condition="'$(IsRemoteBuild)' == 'true'" DependsOnTargets="_VerifyXcodeVersion" />

<Target Name="_VerifyXcodeVersion" Condition="'$(IsRemoteBuild)' == 'true' And '$(IsMacEnabled)' == 'true'">
<VerifyXcodeVersion SessionId="$(BuildSessionId)" />
</Target>

<PropertyGroup>
<MessagingAppleTargetsImported>True</MessagingAppleTargetsImported>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
<PackageReference Include="GitInfo" Version="2.2.0" ExcludeAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Messaging\Xamarin.Messaging.Build\Xamarin.Messaging.Build.csproj">
<ExcludeAssets>all</ExcludeAssets>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
<IsAgent>True</IsAgent>
</ProjectReference>
<ProjectReference Include="..\..\external\Xamarin.MacDev\Xamarin.MacDev\Xamarin.MacDev.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down

7 comments on commit 0d7d336

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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 X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 0d7d336e0e2a6451a8a28b8e19cd187edccf85a7 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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 Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 0d7d336e0e2a6451a8a28b8e19cd187edccf85a7 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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) passed 💻

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

Pipeline on Agent
Hash: 0d7d336e0e2a6451a8a28b8e19cd187edccf85a7 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

.NET (No breaking changes)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 0d7d336e0e2a6451a8a28b8e19cd187edccf85a7 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI Build] Windows Integration Tests failed ❌

❌ Failed ❌

Pipeline on Agent
Hash: 0d7d336e0e2a6451a8a28b8e19cd187edccf85a7 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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: test results

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

Failures

❌ monotouch tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_tvos (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 40 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 0d7d336e0e2a6451a8a28b8e19cd187edccf85a7 [CI build]

Please sign in to comment.