xamarin-macios/msbuild/Xamarin.iOS.Tasks.Windows
Rolf Bjarne Kvinge 15348e0ff3
[msbuild] Make sure the build doesn't keep going if the ILLink task fails. (#21393)
Here's an example failure that didn't stop the build:

    Target Name=_RunILLink Project=sampleproj.csproj
        Building target "_RunILLink" completely.
        Output file "obj\Release\net8.0-ios\ios-arm64\linked\Link.semaphore" does not exist.
        [...]
        Xamarin.MacDev.Tasks.ILLink
            [...]
            C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): [xma][err]: An exception occurred in the task 'ILLink'
            C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): The post for client build1460814608Ilian on topic xvs/build/1.14.0.6/execute-task/ecacau/de6ed16002fILLink has been cancelled
       at Xamarin.Messaging.Client.MessagingClient.PostAsync[TRequest,TResponse](TRequest message, String topic, MessagePriority priority, CancellationToken cancellationToken, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Client\MessagingClient.cs:line 231
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 57
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ThrowIfConnected(ExceptionDispatchInfo exceptionInfo, IMessagingAnalyticsAction analytics) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 149
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.HandleExceptionAsync[TResult](ExceptionDispatchInfo exceptionInfo, Func`1 reentrancyDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 97
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 64
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.HandleExceptionAsync[TResult](ExceptionDispatchInfo exceptionInfo, Func`1 reentrancyDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 103
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 64
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 39
       at Xamarin.Messaging.Ssh.MessagingClientPro.PostAsync[TMessage,TResult](TMessage request, CancellationToken cancellationToken, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingClientPro.cs:line 144
       at Xamarin.Messaging.Build.Client.BuildClient.RunMessagingAsync[TMessage,TResult](TMessage message, Int32 timeoutSecs) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildClient.cs:line 293
       at Xamarin.Messaging.Build.Client.BuildClient.ExecuteTaskAsync(String task, String inputs) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildClient.cs:line 65
       at Xamarin.Messaging.Build.Client.TaskRunner.RunAsync(Task task) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\TaskRunner.cs:line 56
            Errors
                C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): MessagingException: The post for client build1460814608Ilian on topic xvs/build/1.14.0.6/execute-task/ecacau/de6ed16002fILLink has been cancelled
    OperationCanceledException: The operation was canceled.
     [sampleproj.csproj]
                C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk.net8.0_17.5\17.5.8030\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(364,3): error MSB4018: The "Xamarin.MacDev.Tasks.ILLink" task failed unexpectedly.
    System.AggregateException: One or more errors occurred. (One or more errors occurred. (An error occurred while executing the operation and the connection could not be reestablished))
     ---> System.AggregateException: One or more errors occurred. (An error occurred while executing the operation and the connection could not be reestablished)
     ---> Xamarin.Messaging.Exceptions.MessagingException: An error occurred while executing the operation and the connection could not be reestablished
     ---> Xamarin.Messaging.Exceptions.ClientDisconnectedException: The client build1460814608Ilian has been disconnected while waiting a post response to topic xma/agents
       at Xamarin.Messaging.Client.MessagingClient.PostAsync[TRequest,TResponse](TRequest message, String topic, MessagePriority priority, CancellationToken cancellationToken, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Client\MessagingClient.cs:line 197
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 57
       --- End of inner exception stack trace ---
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ReconnectAsync(ExceptionDispatchInfo exceptionInfo, IMessagingAnalyticsAction analytics) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 182
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.HandleExceptionAsync[TResult](ExceptionDispatchInfo exceptionInfo, Func`1 reentrancyDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 99
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, IMessagingAnalyticsAction analytics, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 64
       at Xamarin.Messaging.Ssh.MessagingRunnerPro.ExecuteWithRetryAsync[TResult](Func`1 executeDelegate, Int32 attempts) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingRunnerPro.cs:line 39
       at Xamarin.Messaging.Ssh.MessagingClientPro.PostAsync[TMessage,TResult](TMessage request, Boolean retain, Int32 timeoutSecs) in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingClientPro.cs:line 135
       at Xamarin.Messaging.Ssh.MessagingService.RefreshAgentsStatusAsync() in D:\a\_work\1\s\src\Xamarin.Messaging.Ssh\MessagingService.cs:line 298
       at Xamarin.Messaging.Build.Client.BuildConnection.GetBuildAgentStatusAsync() in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Normal.cs:line 435
       at Xamarin.Messaging.Build.Client.BuildConnection.IsBuildAgentRunningAsync() in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Normal.cs:line 92
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at Xamarin.Messaging.Build.Client.BuildConnection.get_IsConnected() in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Normal.cs:line 45
       at Xamarin.Messaging.Build.Client.BuildConnection.GetAsync(IBuildEngine4 engine) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\BuildConnection.Static.cs:line 50
       at Xamarin.Messaging.Build.Client.TaskRunner.DisconnectAsync(Task task) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\TaskRunner.cs:line 541
       at Xamarin.Messaging.Build.Client.TaskRunner.RunAsync(Task task) in D:\a\_work\1\s\src\MSBuild\Xamarin.Messaging.Build.Client\TaskRunner.cs:line 99
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at Xamarin.MacDev.Tasks.ILLink.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ILLink.cs:line 30
       at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
            Messages
            [...]
        Task "Touch" skipped, due to false condition; ( '$(_ILLinkExitCode)' == '0' ) was evaluated as ( '' == '0' ).

     (and build kept going, eventually failing later on because ILLink didn't run correctly)

Ref: https://developercommunity.visualstudio.com/t/Maui-Blazor-Hybrid-App-wont-publish-to-/10750311#T-ND10763338
2024-10-16 11:01:22 +02:00
..
Properties [msbuild] Warn when we detect that the app developer is trying to link with a static library when using Hot Restart. Fixes #17640. (#18940) 2023-09-07 13:53:45 +02:00
Tasks [msbuild] Enable nullability in a few tasks. (#20509) 2024-04-30 18:29:44 +02:00
Xamarin.Messaging.Apple.targets [net9.0] Migrate Messaging Build agent to .NET 8 (#21264) 2024-09-24 16:19:00 +02:00
Xamarin.iOS.Common.After.props [dotnet] Initial support for .NET6 from Windows (#10590) 2021-02-12 07:43:17 +01:00
Xamarin.iOS.Common.After.targets [msbuild] Make sure the build doesn't keep going if the ILLink task fails. (#21393) 2024-10-16 11:01:22 +02:00
Xamarin.iOS.Common.Before.props [dotnet] Initial support for .NET6 from Windows (#10590) 2021-02-12 07:43:17 +01:00
Xamarin.iOS.Common.Before.targets [msbuild] Move all tasks from Xamarin.[iOS|Mac].Tasks into Xamarin.MacDev.Tasks. (#20118) 2024-02-22 16:34:17 +01:00
Xamarin.iOS.HotRestart.props [msbuild] Copy files to be signed into the correct directory for Hot Restart. Fixes #19278. (#19302) 2023-10-25 08:45:48 +02:00
Xamarin.iOS.HotRestart.targets [msbuild] Don't support RuntimeIdentifiers for Hot Restart. (#20750) 2024-07-01 19:26:57 +02:00
Xamarin.iOS.ObjCBinding.CSharp.After.props Fixed iOS Binding projects build in Windows 2021-03-18 18:20:24 -03:00
Xamarin.iOS.ObjCBinding.CSharp.After.targets [msbuild] Move all tasks from Xamarin.[iOS|Mac].Tasks into Xamarin.MacDev.Tasks. (#20118) 2024-02-22 16:34:17 +01:00
Xamarin.iOS.ObjCBinding.Common.After.props [msbuild/dotnet] Fix building binding projects on Windows in .NET (#14704) 2022-04-22 16:17:03 +02:00
Xamarin.iOS.ObjCBinding.Common.Before.targets [msbuild/dotnet] Fix building binding projects on Windows in .NET (#14704) 2022-04-22 16:17:03 +02:00
Xamarin.iOS.Tasks.Windows.csproj [net9.0] Migrate Messaging Build agent to .NET 8 (#21264) 2024-09-24 16:19:00 +02:00
Xamarin.iOS.WatchApp.Common.After.targets [dotnet] Initial support for .NET6 from Windows (#10590) 2021-02-12 07:43:17 +01:00
Xamarin.iOS.Windows.After.targets Added Hot Restart support into the SDK (#12293) 2021-08-05 09:19:51 +02:00
Xamarin.iOS.Windows.Before.targets [dotnet] Initial support for .NET6 from Windows (#10590) 2021-02-12 07:43:17 +01:00
Xamarin.iOS.Windows.props [build] Create Microsoft.iOS.Windows.Sdk workload pack (#11251) 2021-04-27 07:44:51 +02:00
Zip.cs Autoformat msbuild projects. (#16132) 2022-09-28 16:25:35 +02:00