Open projectgoav opened 1 year ago
@projectgoav do you have an https://aka.ms/binlog that you could share here? I'm not super-clear on what happens when you have the same TFM with different 'platforms' - it's entirely possible that we're accidentally doing multitargeted builds in the SDK and we lack the ability to build the platform-less variant.
Please find attached:
Please let me know if I can provide any more information.
Any word on this?
I believe I'm hitting the same issue, on macOS. Clean checkout of https://github.com/getsentry/sentry-dotnet which has several projects multi targeting, including:
MAUI net6 and net6-android, ios etc: https://github.com/getsentry/sentry-dotnet/blob/2f11b3073e4169a60cc8143b8d5bd6016a3b826a/src/Sentry.Maui/Sentry.Maui.csproj#L9-L13
Core Sentry
package with many targets: https://github.com/getsentry/sentry-dotnet/blob/2f11b3073e4169a60cc8143b8d5bd6016a3b826a/src/Sentry/Sentry.csproj#L11-L14
Change from latest SDK 7.0.1xx to 8.0.100-rc.1.23455.8
. Not changing any target frameworks or anything:
/usr/local/share/dotnet/sdk/8.0.100-rc.1.23455.8/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: The project depends on the following workload packs that do not exist in any of the workloads available in this installation: Microsoft.NETCore.App.Runtime.AOT.Cross.net6.ios-arm Microsoft.NETCore.App.Runtime.AOT.Cross.net6.ios-arm64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-arm64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-x64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-x86 [/Users/bruno/git/sentry-dotnet/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj::TargetFramework=net6.0-ios]
/usr/local/share/dotnet/sdk/8.0.100-rc.1.23455.8/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: You may need to build the project on another operating system or architecture, or update the .NET SDK. [/Users/bruno/git/sentry-dotnet/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj::TargetFramework=net6.0-ios]
/usr/local/share/dotnet/sdk/8.0.100-rc.1.23455.8/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: The project depends on the following workload packs that do not exist in any of the workloads available in this installation: Microsoft.NETCore.App.Runtime.AOT.Cross.net6.ios-arm Microsoft.NETCore.App.Runtime.AOT.Cross.net6.ios-arm64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-arm64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-x64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-x86 [/Users/bruno/git/sentry-dotnet/src/Sentry.Maui/Sentry.Maui.csproj::TargetFramework=net6.0-ios]
/usr/local/share/dotnet/sdk/8.0.100-rc.1.23455.8/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: You may need to build the project on another operating system or architecture, or update the .NET SDK. [/Users/bruno/git/sentry-dotnet/src/Sentry.Maui/Sentry.Maui.csproj::TargetFramework=net6.0-ios]
/usr/local/share/dotnet/sdk/8.0.100-rc.1.23455.8/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: The project depends on the following workload packs that do not exist in any of the workloads available in this installation: Microsoft.NETCore.App.Runtime.AOT.Cross.net6.ios-arm Microsoft.NETCore.App.Runtime.AOT.Cross.net6.ios-arm64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-arm64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-x64 Microsoft.NETCore.App.Runtime.AOT.Cross.net6.iossimulator-x86 [/Users/bruno/git/sentry-dotnet/src/Sentry/Sentry.csproj::TargetFramework=net6.0-ios]
/usr/local/share/dotnet/sdk/8.0.100-rc.1.23455.8/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: You may need to build the project on another operating system or architecture, or update the .NET SDK. [/Users/bruno/git/sentry-dotnet/src/Sentry/Sentry.csproj::TargetFramework=net6.0-ios]
This happens on a mac (build output): https://github.com/getsentry/sentry-dotnet/actions/runs/6202867194/job/16842466816?pr=2622
On Linux, where we don't build the iOS targets, it doesn't.
Workaround: use dotnet build <csproj> --framework net6.0 -p:TargetFrameworks=net6.0
It was suggested I raise my query here via: https://github.com/xamarin/xamarin-macios/issues/18634
Describe the bug
I have the following csproj
When I execute the following command on Windows, Mac or Linux:
the build errors due to missing iOS workload.
On windows & Mac, this is easily solved by installing the ios workload.
On Linux, it recommends I install the macos workload. Doing so then results in:
Why it this? I had assumed a multi-target project would only need the iOS workload installed when you specifcy
--framework net6.0-ios
?Further technical details
dotnet --info
Happens on both dotnet v6 & v7 running on Windows, Mac-x64 & Linux-x64 machines either via the command line or via Visual Studio 19, Visual Studio 22 (Windows & Mac)