Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when targeting net6.0-ios and net6.0-macos from net 8 #18790

Closed
haritha-mohan opened this issue Aug 23, 2023 · 2 comments · Fixed by #20142
Closed

Improve error message when targeting net6.0-ios and net6.0-macos from net 8 #18790

haritha-mohan opened this issue Aug 23, 2023 · 2 comments · Fixed by #20142
Assignees
Labels
enhancement The issue or pull request is an enhancement
Milestone

Comments

@haritha-mohan
Copy link
Contributor

Recently when trying to fix our sample submissions in maccore using the net8.0-xcode15 branch of macios, I was running into the following issue for the dotnet apps:

error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools-net6
error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

..which doesn't make much sense why wasm is needed for these projects. Turns out this is the error displayed when targeting net6 from net8. The android SDK team faced a similar issue and addressed it and I think we can follow suit.

we dropped net6 support for net8 here: #17901
XA issue: dotnet/android#8003
XA fix: dotnet/android#8047

Wondering if we could do the same? I can implement the fix, just want to check if this is the correct course of action.

@rolfbjarne
Copy link
Member

I'm already working on something like this (as part of a fix for dotnet/sdk#30103), so I can do this.

@rolfbjarne rolfbjarne self-assigned this Aug 23, 2023
@rolfbjarne rolfbjarne added the enhancement The issue or pull request is an enhancement label Aug 23, 2023
@rolfbjarne rolfbjarne added this to the .NET 8 milestone Aug 23, 2023
rolfbjarne added a commit that referenced this issue Sep 5, 2023
…eting. (#18896)

Multi targetting is described here:
https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md

This PR implements support building using the latest .NET 7 packages
we're shipping, by specifying the OS version in the target framework.

It does so by:

* Renaming the ref, sdk and runtime packs to contain the target
framework and
  the target platfrom version, so the packages will now be named:

	* iOS

		* Microsoft.iOS.Sdk.net7.0_16.4
		* Microsoft.iOS.Ref.net7.0_16.4
		* Microsoft.iOS.Runtime.ios-arm64.net7.0_16.4
		* Microsoft.iOS.Runtime.iossimulator-arm64.net7.0_16.4
		* Microsoft.iOS.Runtime.iossimulator-x64.net7.0_16.4

	* tvOS

		* Microsoft.tvOS.Sdk.net7.0_16.4
		* Microsoft.tvOS.Ref.net7.0_16.4
		* Microsoft.tvOS.Runtime.ios-arm64.net7.0_16.4
		* Microsoft.tvOS.Runtime.iossimulator-arm64.net7.0_16.4
		* Microsoft.tvOS.Runtime.iossimulator-x64.net7.0_16.4

	* Mac Catalyst

		* Microsoft.MacCatalyst.Sdk.net7.0_16.4
		* Microsoft.MacCatalyst.Ref.net7.0_16.4
		* Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net7.0_16.4
		* Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net7.0_16.4

	* macOS
		* Microsoft.macOS.Sdk.net7.0_13.3
		* Microsoft.macOS.Ref.net7.0_13.3
		* Microsoft.macOS.Runtime.osx-x64.net7.0_13.3
		* Microsoft.macOS.Runtime.osx-arm64.net7.0_13.3

* Note that the workloads are also updated in this PR.

Contributes towards:

* #18790.
* dotnet/sdk#30103.
* #18343.
rolfbjarne added a commit that referenced this issue Sep 5, 2023
…geting (#18884)

Multi targetting is described here:
https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md

This PR implements support building using the initial .NET 7 macOS and
Mac Catalyst packages we shipped, by adding "net7.0-maccatalyst15.4" or
"net7.0-macos12.3" as a target framework.

It does so by:

* Renaming the ref, sdk and runtime packs to contain the target
framework and the target platfrom version, so the packages will now be
named:

	* Microsoft.MacCatalyst.Sdk.net7.0_15.4
	* Microsoft.MacCatalyst.Ref.net7.0_15.4
	* Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net7.0_15.4
	* Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net7.0_15.4

	* Microsoft.macOS.Sdk.net7.0_12.3
	* Microsoft.macOS.Ref.net7.0_12.3
	* Microsoft.macOS.Runtime.osx-x64.net7.0_12.3
	* Microsoft.macOS.Runtime.osx-arm64.net7.0_12.3

* Only publish the above packages to NuGet (i.e. _not_ publish the template
   pack, nor the workload pack). This is because we don't need to publish
   any new templates/workloads, we only need to support being included in a
   newer   workload.

* Note that the workloads are also updated in this PR: these workloads will
  never be published, but it's to keep the tests working.

Contributes towards:

* #18790.
* dotnet/sdk#30103.
* #18343.
rolfbjarne added a commit that referenced this issue Sep 5, 2023
…ting (#18891)

Multi targetting is described here:
https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md

This PR implements support building using the initial .NET 7 macOS and
Mac Catalyst packages we shipped, by adding "net7.0-ios16.0" or
"net7.0-tvos16.0" as a target framework.

It does so by:

* Renaming the ref, sdk and runtime packs to contain the target framework
  and the target platfrom version, so the packages will now be named:

	* Microsoft.iOS.Sdk.net7.0_16.0
	* Microsoft.iOS.Ref.net7.0_16.0
	* Microsoft.iOS.Runtime.ios-arm64.net7.0_16.0
	* Microsoft.iOS.Runtime.iossimulator-arm64.net7.0_16.0
	* Microsoft.iOS.Runtime.iossimulator-x64.net7.0_16.0

	* Microsoft.tvOS.Sdk.net7.0_16.0
	* Microsoft.tvOS.Ref.net7.0_16.0
	* Microsoft.tvOS.Runtime.ios-arm64.net7.0_16.0
	* Microsoft.tvOS.Runtime.iossimulator-arm64.net7.0_16.0
	* Microsoft.tvOS.Runtime.iossimulator-x64.net7.0_16.0

* Only publish the above packages to NuGet (i.e. _not_ publish the template
  pack, nor the workload pack). This is because we don't need to publish any
  new templates/workloads, we only need to support being included in a
  newer workload.

* Note that the workloads are also updated in this PR: these workloads will
  never be published, but it's to keep the tests working.

Contributes towards:

* #18790.
* dotnet/sdk#30103.
* #18343.

This PR is best reviewed commit-by-commit.
rolfbjarne added a commit that referenced this issue Sep 6, 2023
Multi targetting is described here:
https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md

This change implements support for:

* Building using the first .NET 7 packages we shipped.
* Building using the last .NET 7 packages we've shipped.

In both cases by specifying the OS version in the target framework.

Additionally adding support for any other API/OS version is trivial: it's just
a matter of listing the corresponding versions in a few files (this is
particularly interesting to add support for preview versions).

It does so by:

* Renaming the ref, sdk and runtime packs to contain the target framework and
  the target platfrom version, so the packages will now be named:

    * iOS

        * Microsoft.iOS.Sdk.net8.0_16.4
        * Microsoft.iOS.Ref.net8.0_16.4
        * Microsoft.iOS.Runtime.ios-arm64.net8.0_16.4
        * Microsoft.iOS.Runtime.iossimulator-arm64.net8.0_16.4
        * Microsoft.iOS.Runtime.iossimulator-x64.net8.0_16.4

    * tvOS

        * Microsoft.tvOS.Sdk.net8.0_16.4
        * Microsoft.tvOS.Ref.net8.0_16.4
        * Microsoft.tvOS.Runtime.ios-arm64.net8.0_16.4
        * Microsoft.tvOS.Runtime.iossimulator-arm64.net8.0_16.4
        * Microsoft.tvOS.Runtime.iossimulator-x64.net8.0_16.4

    * Mac Catalyst

        * Microsoft.MacCatalyst.Sdk.net8.0_16.4
        * Microsoft.MacCatalyst.Ref.net8.0_16.4
        * Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net8.0_16.4
        * Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net8.0_16.4

    * macOS

        * Microsoft.macOS.Sdk.net8.0_13.3
        * Microsoft.macOS.Ref.net8.0_13.3
        * Microsoft.macOS.Runtime.osx-x64.net8.0_13.3
        * Microsoft.macOS.Runtime.osx-arm64.net8.0_13.3

* Updating the WorkloadManifest.json and WorkloadManifest.targets files to
  load the correct packs according to the TargetFramework in the developer's
  project.

* We're also now giving a better error message for invalid/unsupported/eol'ed
  target frameworks. Fixes #18790.

* Add a few tests.

Fixes:
* #18790.
* dotnet/sdk#30103.
* #16802.

Contributes towards:

* #18343.
@rolfbjarne
Copy link
Member

Fixed in #18931.

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Feb 19, 2024
…on't support.

If a project tried to use a .NET 6 project (say TargetFramework=net6.0-ios), then
we used to show these rather unhelpful errors:

    error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools-net6
    error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

The underlying problem is that we don't support .NET 6 anymore, so with this fix we now show:

    error NETSDK1202: The workload 'net6.0-ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

which is much more helpful.

References:

* dotnet/sdk#32426
* dotnet/android#8047

Fixes xamarin#18790.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Feb 20, 2024
…on't support.

If a project tried to use a .NET 6 project (say TargetFramework=net6.0-ios), then
we used to show these rather unhelpful errors:

    error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools-net6
    error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

The underlying problem is that we don't support .NET 6 anymore, so with this fix we now show:

    error NETSDK1202: The workload 'net6.0-ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

which is much more helpful.

References:

* dotnet/sdk#32426
* dotnet/android#8047

Fixes xamarin#18790.
rolfbjarne added a commit that referenced this issue Feb 21, 2024
…on't support. (#20142)

If a project tried to use a .NET 6 project (say TargetFramework=net6.0-ios), then
we used to show these rather unhelpful errors:

    error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools-net6
    error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

The underlying problem is that we don't support .NET 6 anymore, so with this fix we now show:

    error NETSDK1202: The workload 'net6.0-ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

which is much more helpful.

References:

* dotnet/sdk#32426
* dotnet/android#8047

Fixes #18790.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement
Projects
None yet
2 participants