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

[build] remove .NET 6 support #7900

Merged
merged 1 commit into from
Mar 22, 2023
Merged

Conversation

jonathanpeppers
Copy link
Member

Context: https://dotnet.microsoft.com/platform/support/policy/maui

A major version of .NET MAUI receives support for a minimum of 6
months after a successor (the next major release) ships. For
example, .NET MAUI 6.0 will be supported for 6 months after .NET
MAUI 7.0 ships. Similarly, .NET MAUI 7.0 will receive support for 6
months after .NET MAUI 8.0 ships.

By the time .NET 8 GA ships, .NET 6 MAUI projects will not be supported.

Remove .NET 6 support from the android workload.

I removed net6.0-android parameters from various tests, making sure we still have .NET 7 and .NET 8 tests.

jonathanpeppers added a commit to xamarin/Xamarin.Legacy.Sdk that referenced this pull request Mar 20, 2023
Context: dotnet/android#7900

After attempted removal of .NET 6 (from .NET 8), we got the build error:

    Xamarin.Legacy.Android.targets(33,3): error : Could not resolve SDK "Microsoft.Android.Sdk.net6". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
    Xamarin.Legacy.Android.targets(33,3): error :   SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" returned null.
    Xamarin.Legacy.Android.targets(33,3): error :   The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json.
    Xamarin.Legacy.Android.targets(33,3): error :   MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.Android.Sdk.net6" because directory "/Users/runner/work/1/s/xamarin-android/bin/Release/dotnet/sdk/8.0.100-preview.3.23163.4/Sdks/Microsoft.Android.Sdk.net6/Sdk" did not exist.

Add support for the .NET 8 SDK, I am unsure how it was working at all
before? It must have somehow imported the .NET 6 targets.
jonathanpeppers added a commit to xamarin/Xamarin.Legacy.Sdk that referenced this pull request Mar 20, 2023
Context: dotnet/android#7900

After attempted removal of .NET 6 (from .NET 8), we got the build error:

    Xamarin.Legacy.Android.targets(33,3): error : Could not resolve SDK "Microsoft.Android.Sdk.net6". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
    Xamarin.Legacy.Android.targets(33,3): error :   SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" returned null.
    Xamarin.Legacy.Android.targets(33,3): error :   The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json.
    Xamarin.Legacy.Android.targets(33,3): error :   MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.Android.Sdk.net6" because directory "/Users/runner/work/1/s/xamarin-android/bin/Release/dotnet/sdk/8.0.100-preview.3.23163.4/Sdks/Microsoft.Android.Sdk.net6/Sdk" did not exist.

Add support for the .NET 8 SDK, I am unsure how it was working at all
before? It must have somehow imported the .NET 6 targets.
Context: https://dotnet.microsoft.com/platform/support/policy/maui

> A major version of .NET MAUI receives support for a minimum of 6
> months after a successor (the next major release) ships. For
> example, .NET MAUI 6.0 will be supported for 6 months after .NET
> MAUI 7.0 ships. Similarly, .NET MAUI 7.0 will receive support for 6
> months after .NET MAUI 8.0 ships.

By the time .NET 8 GA ships, .NET 6 MAUI projects will not be supported.

Remove .NET 6 support from the `android` workload.

I removed `net6.0-android` parameters from various tests, making sure
we still have .NET 7 and .NET 8 tests.
Copy link
Contributor

@dellis1972 dellis1972 left a comment

Choose a reason for hiding this comment

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

I do wonder if there is a better way to drive what we include in the manifest. Some way that means fewer changes overall. Like a property or item group which xaprepare uses to "include" the required versions which are supported.

@jonathanpeppers
Copy link
Member Author

I do wonder if there is a better way to drive what we include in the manifest. Some way that means fewer changes overall. Like a property or item group which xaprepare uses to "include" the required versions which are supported.

I think when we move to .NET 9, might be a good place to try doing this. At that point, I think we might have the patterns down. Right now things are still getting renamed/changing related to workloads.

@jonpryor jonpryor merged commit 4e34daa into dotnet:main Mar 22, 2023
@jonathanpeppers jonathanpeppers deleted the remove-net6 branch March 23, 2023 03:04
jonathanpeppers added a commit that referenced this pull request Mar 23, 2023
Context: https://dotnet.microsoft.com/platform/support/policy/maui

> A major version of .NET MAUI receives support for a minimum of 6
> months after a successor (the next major release) ships. For
> example, .NET MAUI 6.0 will be supported for 6 months after .NET
> MAUI 7.0 ships. Similarly, .NET MAUI 7.0 will receive support for 6
> months after .NET MAUI 8.0 ships.

By the time .NET 8 GA ships, .NET 6 MAUI projects will not be supported.

Remove .NET 6 support from the .NET 8 `android` workload.

I removed `net6.0-android` parameters from various tests, making sure
we still have .NET 7 and .NET 8 tests.
grendello added a commit to grendello/xamarin-android that referenced this pull request Mar 23, 2023
* main:
  [build] remove .NET 6 support (dotnet#7900)
  [profiled-aot] update `dotnet.aotprofile` for .NET 8 (dotnet#7908)
  [tests] Add backup ssl sites in case of 429 response. (dotnet#7909)
  $(AndroidPackVersionSuffix)=preview.4; net8 is 34.0.0-preview.4 (dotnet#7912)
grendello added a commit to grendello/xamarin-android that referenced this pull request Apr 6, 2023
* main: (94 commits)
  [ci] Remove remaining Classic test jobs. (dotnet#7924)
  Add Nightly Tests for Humanizer
  [readme] Add aka.ms links for d17.5. (dotnet#7935)
  [tests] Remove `net472` multitargeting (dotnet#7932)
  [monodroid] Fix `ld` build error on Nightly Builds. (dotnet#7925)
  Bump to xamarin/Java.Interop/main@0355acf (dotnet#7931)
  [tests] Use msftconnecttest.com in QuoteInvalidQuoteUrlsShouldWork (dotnet#7919)
  [ci] Don't set demands for megapipeline (dotnet#7929)
  [Mono.Android] Bind API-UpsideDownCake Developer Preview 1 (dotnet#7796)
  Bump to dotnet/installer@d109cba3ff 8.0.100-preview.4.23176.5 (dotnet#7921)
  [Xamarin.Android.Build.Tasks] Fix Android Version Code for Release builds (dotnet#7795)
  Bump to dotnet/installer@27d6769dfb 8.0.100-preview.4.23172.16 (dotnet#7910)
  [Xamarin.Android.Build.Tasks] Fix native code generation when marshal methods are disabled (dotnet#7899)
  [ci] Optimize 'APK's .NET' test job overhead. (dotnet#7904)
  [Mono.Android] delay JNINativeWrapper.get_runtime_types() (dotnet#7913)
  Bump external/Java.Interop from `73ebad2` to `53bfb4a` (dotnet#7914)
  [build] remove .NET 6 support (dotnet#7900)
  [profiled-aot] update `dotnet.aotprofile` for .NET 8 (dotnet#7908)
  [tests] Add backup ssl sites in case of 429 response. (dotnet#7909)
  $(AndroidPackVersionSuffix)=preview.4; net8 is 34.0.0-preview.4 (dotnet#7912)
  ...
@maxkatz6
Copy link

Do I understand it correctly, that it's not possible to build a .NET 6 compatible project (single- or multi-target) while on .NET 8 SDK now? Even if the project itself has nothing to do with MAUI and uses native controls or other framework?

@jonathanpeppers
Copy link
Member Author

jonathanpeppers commented Sep 20, 2023

Yeah, this was following the support policy here: https://dotnet.microsoft.com/en-us/platform/support/policy/maui

It is basically the "modern support policy" brought forward from Xamarin.

If you need to build net6.0-android projects, you can continue to use the .NET 6 or 7 SDKs for this.

@tuyen-vuduc
Copy link

This removal will impact library owners like me because I cannot target additional .NET8, but have to remove .NET6 and MonoAndroid as well from the supported target frameworks. :(

@dellis1972
Copy link
Contributor

@tuyen-vuduc this might be a good stop gap https://github.com/xamarin/Xamarin.Legacy.Sdk

@tuyen-vuduc
Copy link

tuyen-vuduc commented Dec 1, 2023

@dellis1972 It fails to compile and package the nuget packages even if .NET8 isn't a part of supported frameworks. :( . The check should show as a warning, rather than a error.

I'll try again to see if I can use global.json to configure to use .NET7 and previous ones.

Regarding legacy SDK, yes, I am using it right now to target multiple frameworks including MonoAndroid and .NET6+

You can check out my binding libraries in this repo.

@jonathanpeppers
Copy link
Member Author

Given the support policy: https://dotnet.microsoft.com/platform/support/policy/maui

Why do you need to support net6.0-android if we don't? You can continue to do this with the .NET 7 SDK in an unsupported fashion, but can you just target net7.0-android instead? It seems like you should file an issue describing your scenario instead of commenting on a pull request. Thanks!

@dotnet dotnet locked as off-topic and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants