Skip to content

Commit

Permalink
[release/9.0.1xx] [xma] Updated Xamarin.Messaging to 3.0.13 (#21839)
Browse files Browse the repository at this point in the history
Xamarin.Messaging major version 3 means the replacement of the underlying MQTT library used for message communication. We've replaced the System.Net.Mqtt with MQTTnet (repo under the dotnet org). More details here: xamarin/Xamarin.Messaging#818

For this reason, we also need to remove any System.Net.Mqtt reference from signing lists or ILMerge, and add MQTTnet instead.

This PR also removes the System.Security.Cryptography.ProtectedData runtime implementation handling, since the new version used by Messaging (8.0.0) doesn't include a specific Windows runtime implementation, so we don't need to do this extra MSBuild handling to reference the right assemblies anymore

Backport of #21767

---------

Co-authored-by: Mauro Agnoletti <[email protected]>
Co-authored-by: Mauro Agnoletti <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2024
1 parent dfd144f commit c29b554
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 16 deletions.
3 changes: 1 addition & 2 deletions dotnet/Workloads/SignList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
<Skip Include="tools\msbuild\iOS\ws2_32.dll" />
<!-- Broker.zip -->
<Skip Include="Broker\Newtonsoft.Json.dll" />
<Skip Include="Broker\System.Net.Mqtt.dll" />
<Skip Include="Broker\System.Net.Mqtt.Server.dll" />
<Skip Include="Broker\MQTTnet.dll" />
<Skip Include="Broker\System.Reactive.dll" />
<Skip Include="Broker\System.Runtime.CompilerServices.Unsafe.dll" />
<Skip Include="Broker\System.Security.Cryptography.ProtectedData.dll" />
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
https://dev.azure.com/azure-public/vside/_artifacts/feed/xamarin-impl/NuGet/Xamarin.Messaging.Client/
-->
<MessagingVersion Condition="'$(MessagingVersion)' == ''">[2.2.10]</MessagingVersion>
<MessagingVersion Condition="'$(MessagingVersion)' == ''">[3.0.13]</MessagingVersion>
<HotRestartVersion>[1.1.7]</HotRestartVersion>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
Expand Down
3 changes: 1 addition & 2 deletions msbuild/ILMerge.targets
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
<MergedAssemblies Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.ComponentModel.Annotations'" />
<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)' == 'MQTTnet'" />
<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
4 changes: 0 additions & 4 deletions msbuild/Messaging/Xamarin.Messaging.Build/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Mqtt" publicKeyToken="ac60ebe5a5220e27" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.2.274.0" newVersion="0.2.274.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
1 change: 1 addition & 0 deletions msbuild/Xamarin.MacDev.Tasks/MsBuildTasks/Exec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Xamarin.Messaging.Build.Client;
using System.Security;
using System.Reactive.Linq;
using Xamarin.Messaging.Ssh;

// Disable until we get around to enable + fix any issues.
#nullable disable
Expand Down
8 changes: 1 addition & 7 deletions msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,15 @@

<Import Project="$(MSBuildThisFileDirectory)..\ILMerge.targets" />

<!-- Replaces the ProtectedData assembly by the runtime implementation -->
<Target Name="CopyRuntimeAssemblies" BeforeTargets="ILRepack">
<ItemGroup>
<ReferenceCopyLocalToRemove Include="@(ReferenceCopyLocalPaths)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
<ReferenceCopyLocalToRemove Include="@(ReferenceCopyLocalPaths)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />

<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalToRemove)" />

<ReferencePathToRemove Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Text.Encoding.CodePages'" />
<ReferencePathToRemove Include="@(ReferencePath)" Condition="'%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />

<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalToRemove)" />
<ReferencePath Remove="@(ReferencePathToRemove)" />

<ReferencePathToAdd Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeIdentifier)' == 'win' And '%(FileName)' == 'System.Text.Encoding.CodePages'" />
<ReferencePathToAdd Include="@(RuntimeTargetsCopyLocalItems)" Condition="'%(RuntimeIdentifier)' == 'win' And '%(FileName)' == 'System.Security.Cryptography.ProtectedData'" />

<ReferencePath Include="@(ReferencePathToAdd)">
<DestinationSubDirectory />
Expand Down

10 comments on commit c29b554

@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] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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.

🔥 Unable to find the contents for the comment: D:\a\1\s\change-detection\results\gh-comment.md does not exist :fire

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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] Build passed (Build packages) ✅

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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 Monterey (12) passed 💻

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

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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 X64 - Mac Sonoma (14) passed 💻

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

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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 arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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) passed 💻

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

Pipeline on Agent
Hash: c29b5546f7177f306ecab286e01db909ba7be5dd [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: test results.

🎉 All 103 tests passed 🎉

Tests counts

✅ 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 5 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
✅ monotouch (tvOS): All 7 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: c29b5546f7177f306ecab286e01db909ba7be5dd [CI build]

Please sign in to comment.